2 //=============================================================================
6 * @author originally David Levine (levine@cs.wustl.edu) and Tim Harrison (harrison@cs.wustl.edu) modified Michael Kircher (mk1@cs.wustl.edu)
8 //=============================================================================
14 #include "ace/SString.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "orbsvcs/RtecEventChannelAdminC.h"
21 #include "orbsvcs/RtecEventCommS.h"
22 #include "orbsvcs/RtecSchedulerC.h"
25 * @class Demo_Consumer
27 * @brief Demo Consumer
29 * Simple example of a consumer that registers for supplier
32 class Demo_Consumer
: public POA_RtecEventComm::PushConsumer
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
,
47 /// The channel is disconnecting.
48 virtual void disconnect_push_consumer ();
50 // = (not protected to allow short-circuiting) protected:
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
);
59 /// Disconnect from the Event Service.
62 // = Event channel adminstration references.
63 RtecEventChannelAdmin::EventChannel_var channel_admin_
;
64 RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_
;
65 RtecEventChannelAdmin::ProxyPushSupplier_var suppliers_
;
68 RtecScheduler::handle_t rt_info_
;
71 #endif /* EVENT_CON_H */