Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / lib / Periodic_Consumer.h
blob423b38510a51e4bd46634f805c8d7f781bc602ac
1 /* -*- C++ -*- */
2 /**
3 * @file Periodic_Consumer.h
5 * @author Pradeep Gore <pradeep@oomworks.com>
6 */
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)
15 # 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
23 class ACE_Barrier;
24 ACE_END_VERSIONED_NAMESPACE_DECL
26 class TAO_Notify_Tests_Task_Callback;
28 /**
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
35 public:
36 /// Constructor
37 TAO_Notify_Tests_Periodic_Consumer ();
39 /// Destructor
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);
48 /// dump stats
49 void dump_stats (ACE_TCHAR* msg, int dump_samples);
51 protected:
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);
58 /// = Data members.
59 /// Serialize state.
60 TAO_SYNCH_MUTEX lock_;
62 /// count of events received.
63 int count_;
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.
71 int max_count_;
73 /// The Load
74 CORBA::ULong load_;
76 /// Stats house keeping
77 Task_Stats stats_;
79 /// Client
80 TAO_Notify_Tests_Task_Callback* client_;
82 /// Flag to indicate if we want to check the expected priority.
83 int check_priority_;
85 /// This Flag is set if we received an event asking us to "Stop".
86 int stop_received_;
89 #include /**/ "ace/post.h"
90 #endif /* TAO_Notify_Tests_PERIODIC_CONSUMER_H */