diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/apps/JAWS3/jaws3/Concurrency.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/apps/JAWS3/jaws3/Concurrency.h')
-rw-r--r-- | ACE/apps/JAWS3/jaws3/Concurrency.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/ACE/apps/JAWS3/jaws3/Concurrency.h b/ACE/apps/JAWS3/jaws3/Concurrency.h new file mode 100644 index 00000000000..2f8b8a18873 --- /dev/null +++ b/ACE/apps/JAWS3/jaws3/Concurrency.h @@ -0,0 +1,74 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef JAWS_CONCURRENCY_H +#define JAWS_CONCURRENCY_H + +#include "ace/Task.h" +#include "ace/Singleton.h" +#include "ace/Synch_Traits.h" + +#include "jaws3/Export.h" +#include "jaws3/Protocol_Handler.h" + + +typedef ACE_Task<ACE_SYNCH> JAWS_CONCURRENCY_TASK; + +class JAWS_Export JAWS_Concurrency_Impl : public JAWS_CONCURRENCY_TASK +{ +public: + + virtual ~JAWS_Concurrency_Impl (void) {}; + + virtual int putq (JAWS_Protocol_Handler *ph) = 0; + + virtual int getq (JAWS_Protocol_Handler *&ph) = 0; + + int svc (void); + +}; + + +// Include the templates here. +#include "jaws3/Concurrency_T.h" + + +template<> +class JAWS_Export JAWS_Concurrency_Bridge<JAWS_Concurrency_Impl> +{ +public: + + JAWS_Concurrency_Bridge (JAWS_Concurrency_Impl *impl = 0); + + int putq (JAWS_Protocol_Handler *ph); + int getq (JAWS_Protocol_Handler *&ph); + + void shutdown (void); + +protected: + + JAWS_Concurrency_Impl *impl_; + +}; + + +#ifndef JAWS_CONCURRENCY_CONCRETE_IMPL +#define JAWS_CONCURRENCY_CONCRETE_IMPL JAWS_Concurrency_Impl +#endif /* JAWS_CONCURRENCY_CONCRETE_IMPL */ + + +class JAWS_Export JAWS_Concurrency + : public JAWS_Concurrency_Bridge<JAWS_CONCURRENCY_CONCRETE_IMPL> +{ +public: + + static JAWS_Concurrency * instance (void) + { + return ACE_Singleton<JAWS_Concurrency, ACE_SYNCH_MUTEX>::instance (); + } + +}; + + +#endif /* JAWS_CONCURRENCY_H */ |