3 // ============================================================================
6 // An example on custom marshaling in TAO.
8 // ============================================================================
10 #ifndef ECM_CONSUMER_H
11 #define ECM_CONSUMER_H
15 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
19 #include "orbsvcs/Channel_Clients_T.h"
20 #include "orbsvcs/RtecEventChannelAdminC.h"
21 #include "ace/OS_NS_time.h"
25 class Test_Consumer
: public POA_RtecEventComm::PushConsumer
29 // Receive the events.
33 Test_Consumer (Driver
* driver
, void* cookie
);
35 void connect (int event_a
,
37 RtecEventChannelAdmin::EventChannel_ptr ec
);
38 // This method connects the consumer to the EC.
41 // Disconnect from the EC.
43 virtual void push (const RtecEventComm::EventSet
& events
);
44 virtual void disconnect_push_consumer ();
45 // The skeleton methods.
49 // The main driver for the test.
52 // A magic cookie passed by the driver that we pass back in our
55 RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_
;
56 // We talk to the EC using this proxy.
71 // Maximum number of consumers.
74 int run (int argc
, ACE_TCHAR
* argv
[]);
77 void push_consumer (void* consumer_cookie
,
79 const RtecEventComm::EventSet
& events
);
80 // Callback method for consumers, if any of our consumers has
81 // received events it will invoke this method.
84 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
85 // parse the command line args
87 void connect_consumers (RtecEventChannelAdmin::EventChannel_ptr local_ec
);
88 void disconnect_consumers ();
89 // Connect and disconnect the consumers.
92 Test_Consumer
* consumers_
[Driver::MAX_CONSUMERS
];
93 // The consumer array.
96 // The number of consumers.
99 // How many messages we will send in the suppliers
103 // We send two types of events, with different contents.
105 const ACE_TCHAR
* pid_file_name_
;
106 // The name of a file where the process stores its pid
108 TAO_SYNCH_MUTEX recv_count_mutex_
;
110 // How many events we have received.
113 #endif /* ECM_CONSUMER_H */