3 * @file Periodic_Consumer.h
5 * @author Pradeep Gore <pradeep@oomworks.com>
8 #ifndef TAO_Notify_Tests_PERIODIC_CONSUMER_H
9 #define TAO_Notify_Tests_PERIODIC_CONSUMER_H
10 #include /**/ "ace/pre.h"
12 #include "notify_test_export.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "Task_Stats.h"
19 #include "Notify_StructuredPushConsumer.h"
20 #include "ace/Arg_Shifter.h"
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 ACE_END_VERSIONED_NAMESPACE_DECL
26 class TAO_Notify_Tests_Task_Callback
;
29 * @class TAO_Notify_Tests_Periodic_Consumer
31 * @brief Receives Structured events periodically.
33 class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Periodic_Consumer
: public TAO_Notify_Tests_StructuredPushConsumer
37 TAO_Notify_Tests_Periodic_Consumer ();
40 ~TAO_Notify_Tests_Periodic_Consumer ();
42 /// set the helper callback
43 void task_callback(TAO_Notify_Tests_Task_Callback
* client
);
45 /// Init the state of this object.
46 virtual int init_state (ACE_Arg_Shifter
& arg_shifter
);
49 void dump_stats (ACE_TCHAR
* msg
, int dump_samples
);
52 virtual void push_structured_event (
53 const CosNotification::StructuredEvent
& notification
);
55 void handle_start_event (const CosNotification::PropertySeq
& prop_seq
);
56 void check_priority (const CosNotification::PropertySeq
& prop_seq
);
60 TAO_SYNCH_MUTEX lock_
;
62 /// count of events received.
65 /// We need to count down these initial events.
66 int warmup_countdown_
;
68 /// max events expected.
69 /// Sometimes max count may not be the number of events that the supplier will send.
70 /// A filter might not allow some events to through. we can tell the consumer what to expect.
76 /// Stats house keeping
80 TAO_Notify_Tests_Task_Callback
* client_
;
82 /// Flag to indicate if we want to check the expected priority.
85 /// This Flag is set if we received an event asking us to "Stop".
89 #include /**/ "ace/post.h"
90 #endif /* TAO_Notify_Tests_PERIODIC_CONSUMER_H */