Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / LongUpcalls / AMI_Manager.h
blob55783b506ff335ea75d2320a3e4e575577da3f97
1 #ifndef LONGUPCALLS_AMI_MANAGER_H
2 #define LONGUPCALLS_AMI_MANAGER_H
4 #include "TestS.h"
5 #include "ace/Task.h"
7 class AMI_Manager
8 : public virtual POA_Test::Manager
10 public:
11 AMI_Manager (CORBA::ORB_ptr orb);
12 // Constructor
14 // = The skeleton methods
15 virtual void start_workers (CORBA::Short worker_count,
16 CORBA::Long milliseconds,
17 Test::Controller_ptr controller);
18 virtual void shutdown ();
20 private:
21 CORBA::ORB_var orb_;
22 // The ORB, to shutdown
25 // ****************************************************************
27 class Worker : public ACE_Task_Base
29 public:
30 Worker (ACE_Thread_Manager *thr_mgr,
31 Test::Controller_ptr controller,
32 CORBA::Long milliseconds,
33 CORBA::ORB_ptr orb);
35 virtual int svc ();
36 // The service method
38 private:
39 Test::Controller_var controller_;
40 // The controller pointer
42 CORBA::Long milliseconds_;
43 // The number of milliseconds.
45 CORBA::ORB_var orb_;
46 // The orb
49 // ****************************************************************
51 class Controller_Handler
52 : public virtual POA_Test::AMI_ControllerHandler
54 public:
55 Controller_Handler (TAO_SYNCH_MUTEX *mutex,
56 int *pending_replies);
57 // Constructor
59 virtual void worker_started ();
60 virtual void worker_started_excep (::Messaging::ExceptionHolder*);
61 virtual void worker_finished ();
62 virtual void worker_finished_excep (::Messaging::ExceptionHolder*);
64 private:
65 TAO_SYNCH_MUTEX *mutex_;
66 int *pending_replies_;
67 // The pending replies is decremented each time a reply is
68 // received.
69 // The mutex is used to protect the access to the flag.
72 #endif /* LONGUPCALLS_AMI_MANAGER_H */