Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / examples / Simulator / Event_Supplier / Event_Con.h
blob377344095a743f074ac56d35f1e05f3c2bfaa7e6
2 //=============================================================================
3 /**
4 * @file Event_Con.h
6 * @author originally David Levine (levine@cs.wustl.edu) and Tim Harrison (harrison@cs.wustl.edu) modified Michael Kircher (mk1@cs.wustl.edu)
7 */
8 //=============================================================================
11 #ifndef EVENT_CON_H
12 #define EVENT_CON_H
14 #include "ace/SString.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "orbsvcs/RtecEventChannelAdminC.h"
21 #include "orbsvcs/RtecEventCommS.h"
22 #include "orbsvcs/RtecSchedulerC.h"
24 /**
25 * @class Demo_Consumer
27 * @brief Demo Consumer
29 * Simple example of a consumer that registers for supplier
30 * notifications.
32 class Demo_Consumer : public POA_RtecEventComm::PushConsumer
34 public:
35 Demo_Consumer ();
37 /**
38 * Uses the name server to obtain a reference to the <supplier_name>
39 * and registers with channel to receive notifications from the
40 * supplier. Also registers to receive shutdown messages from the
41 * supplier. Stores <my_name> for printing out messages. Returns 0
42 * on success, -1 on failure.
44 int open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
45 const char *my_name);
47 /// The channel is disconnecting.
48 virtual void disconnect_push_consumer ();
50 // = (not protected to allow short-circuiting) protected:
51 /**
52 * If the <events>[0] is a notification, prints out the data from
53 * the supplier. If its a shutdown message, the consumer
54 * disconnects from the channel.
56 virtual void push (const RtecEventComm::EventSet &events);
58 protected:
59 /// Disconnect from the Event Service.
60 void shutdown ();
62 // = Event channel adminstration references.
63 RtecEventChannelAdmin::EventChannel_var channel_admin_;
64 RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
65 RtecEventChannelAdmin::ProxyPushSupplier_var suppliers_;
67 private:
68 RtecScheduler::handle_t rt_info_;
71 #endif /* EVENT_CON_H */