2 //=============================================================================
4 * @file Counting_Consumer.h
6 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
8 //=============================================================================
11 #ifndef EC_COUNTING_CONSUMER_H
12 #define EC_COUNTING_CONSUMER_H
14 #include "ectest_export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "orbsvcs/RtecEventCommS.h"
21 #include "orbsvcs/RtecEventChannelAdminC.h"
24 * @class EC_Counting_Consumer
26 * @brief Simple consumer object to implement EC tests.
28 * This is a simple consumer that counts the events it receives.
30 class EC_Test_Export EC_Counting_Consumer
: public POA_RtecEventComm::PushConsumer
34 EC_Counting_Consumer (const char* name
);
36 /// Simple connect/disconnect methods..
37 void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
,
38 const RtecEventChannelAdmin::ConsumerQOS
&qos
);
39 void disconnect (void);
40 void deactivate (void);
42 /// Print out an error message if the event count is too far from the
44 void dump_results (int expected_count
, int tolerance
);
46 // = The RtecEventComm::PushConsumer methods
48 /// The skeleton methods.
49 virtual void push (const RtecEventComm::EventSet
& events
);
50 virtual void disconnect_push_consumer (void);
52 /// Keep track of the number of events received.
53 CORBA::ULong event_count
;
55 /// Keep track of the number of disconnect calls received.
56 CORBA::ULong disconnect_count
;
60 RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_
;
66 #endif /* ECT_CONSUMER_H */