diff options
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h')
-rw-r--r-- | TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h new file mode 100644 index 00000000000..cc3de7ec8a2 --- /dev/null +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h @@ -0,0 +1,51 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file ClientTask.h + * + * $Id$ + * + * @author Tim Bradley <bradley_t@ociweb.com> + */ +//============================================================================= + +#ifndef CLIENT_TASK_H +#define CLIENT_TASK_H + +#include "CSD_TP_Test_Export.h" +#include "ClientEngine.h" +#include "ace/Task.h" +#include "ace/Vector_T.h" +#include "ace/Synch.h" + + +class CSD_TP_Test_Export ClientTask : public ACE_Task_Base +{ + public: + + ClientTask(bool shutdown_after_done = false); + virtual ~ClientTask(); + + void add_engine(ClientEngine* engine); + + virtual int open(void* arg = 0); + virtual int svc(); + virtual int close(u_long); + + unsigned failure_count () const; + + private: + + typedef ACE_SYNCH_MUTEX LockType; + typedef ACE_Guard<LockType> GuardType; + + typedef ACE_Vector<ClientEngine_Handle> EngineVector; + + LockType lock_; + EngineVector engines_; + bool shutdown_after_done_; + unsigned failure_count_; +}; + +#endif |