Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Big_Request_Muxing / Client_Task.h
blob1ab52fa9b086c830c8b85fe2f96390031c82fdc1
2 #ifndef BIG_REQUEST_MUXING_CLIENT_TASK_H
3 #define BIG_REQUEST_MUXING_CLIENT_TASK_H
4 #include /**/ "ace/pre.h"
6 #include "TestC.h"
7 #include "tao/Messaging/Messaging.h"
8 #include "ace/Task.h"
9 #include "ace/SString.h"
10 #include "ace/OS_NS_unistd.h"
11 #include "ace/Atomic_Op.h"
13 #if !defined (ACE_LACKS_PRAGMA_ONCE)
14 # pragma once
15 #endif /* ACE_LACKS_PRAGMA_ONCE */
17 /// Implement a Task to run the experiments using multiple threads.
18 class Client_Task : public ACE_Task_Base
20 public:
21 /// Constructor
22 Client_Task (ACE_Thread_Manager *thr_mgr,
23 Test::Payload_Receiver_ptr receiver,
24 CORBA::Long event_count,
25 CORBA::ULong event_size,
26 CORBA::ORB_ptr orb,
27 Messaging::SyncScope sync_scope,
28 const ACE_CString& ident);
30 /// Thread entry point
31 int svc ();
33 bool done() const;
34 const char *ID () const;
36 private:
37 /// Make sure that all threads have connections available to
38 /// workaround bug 189
39 void validate_connection ();
41 private:
42 /// Reference to the test interface
43 Test::Payload_Receiver_var payload_receiver_;
45 /// Total number of events
46 CORBA::Long event_count_;
48 /// Size of each message
49 CORBA::ULong event_size_;
51 /// Keep a reference to the ORB, used to initialize the SyncScope
52 /// policy
53 CORBA::ORB_var orb_;
55 /// The SyncScope used in this Task
56 Messaging::SyncScope sync_scope_;
58 /// Track the number of tasks still running.
59 ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> tasks_running_;
61 bool done_;
63 ACE_CString id_;
66 #include /**/ "ace/post.h"
67 #endif /* BIG_REQUEST_MUXING_CLIENT_TASK_H */