diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-14 07:08:33 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-14 07:08:33 +0000 |
commit | 37981beb729b19337051eb79306b811b1a719641 (patch) | |
tree | 190d855d9e6d4fce16a7d9e2ef883a6c868e9efa /ace/Strategies_T.h | |
parent | 383b1f9f3a1bc9af2305065c4ba80833aaa8ecb4 (diff) | |
download | ATCD-37981beb729b19337051eb79306b811b1a719641.tar.gz |
Added ACE_Thread_Pool_Strategy and AE_Svc_Handler_Pool_Strategy
Diffstat (limited to 'ace/Strategies_T.h')
-rw-r--r-- | ace/Strategies_T.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ace/Strategies_T.h b/ace/Strategies_T.h index bb8f69bd08f..5c17c90f112 100644 --- a/ace/Strategies_T.h +++ b/ace/Strategies_T.h @@ -183,6 +183,36 @@ protected: }; template <class SVC_HANDLER> +class ACE_Svc_Handler_Pool_Strategy : public ACE_Creation_Strategy<SVC_HANDLER> +{ + // = TITLE + // Defines the interface for specifying a creation strategy for + // a <SVC_HANDLER> that always returns the same <SVC_HANDLER> (i.e., + // it's a Singleton). + // + // = DESCRIPTION + // Yadda, yadda... Unfinished... + // Note that this class takes over the ownership of the + // SVC_HANDLER passed into it as a parameter and it becomes + // responsible for deleting this object. +public: + // = Initialization and termination methods. + ACE_Svc_Handler_Pool_Strategy (ACE_Thread_Manager * = 0); + virtual ~ACE_Svc_Handler_Pool_Strategy (void); + + // = Factory method. + virtual int make_svc_handler (SVC_HANDLER *&); + // Create a Singleton SVC_HANDLER by always returning the same + // SVC_HANDLER. Returns -1 on failure, else 0. + + void dump (void) const; + // Dump the state of an object. + + ACE_ALLOC_HOOK_DECLARE; + // Declare the dynamic allocation hooks. +}; + +template <class SVC_HANDLER> class ACE_Concurrency_Strategy { // = TITLE @@ -334,6 +364,43 @@ protected: }; template <class SVC_HANDLER> +class ACE_Thread_Pool_Strategy : public ACE_Concurrency_Strategy<SVC_HANDLER> +{ + // = TITLE + // Defines the interface for specifying a concurrency strategy + // for a <SVC_HANDLER> based on multithreading. + // + // = DESCRIPTION + // This class provides a strategy that handle requests from + // clients concurrently using the current thread's context. It + // "activates" the user-supplied <SVC_HANDLER> by calling it's + // svc () method directly. +public: + // = Intialization and termination methods. + ACE_Thread_Pool_Strategy (int flags = 0); + // "Do-nothing constructor" + + virtual ~ACE_Thread_Pool_Strategy (void); + + // = Factory method. + virtual int activate_svc_handler (SVC_HANDLER *svc_handler, + void *arg = 0); + // Activate the <svc_handler> with an appropriate concurrency + // strategy. This method activates the SVC_HANDLER by first calling + // its open() method and then calling its activate() method to turn + // it into an active object. + + void dump (void) const; + // Dump the state of an object. + + ACE_ALLOC_HOOK_DECLARE; + // Declare the dynamic allocation hooks. + +protected: + typedef ACE_Concurrency_Strategy<SVC_HANDLER> inherited; +}; + +template <class SVC_HANDLER> class ACE_Process_Strategy : public ACE_Concurrency_Strategy<SVC_HANDLER> { // = TITLE |