ACE 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
ACE_Thread_Strategy< SVC_HANDLER > Class Template Reference

Defines the interface for specifying a concurrency strategy for a SVC_HANDLER based on multithreading. More...

#include <Strategies_T.h>

Inheritance diagram for ACE_Thread_Strategy< SVC_HANDLER >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Thread_Strategy< SVC_HANDLER >:
Collaboration graph
[legend]

Public Types

typedef ACE_Concurrency_Strategy< SVC_HANDLERbase_type
 
- Public Types inherited from ACE_Concurrency_Strategy< SVC_HANDLER >
typedef SVC_HANDLER::addr_type addr_type
 
typedef SVC_HANDLER handler_type
 
typedef SVC_HANDLER::stream_type stream_type
 

Public Member Functions

 ACE_Thread_Strategy (int flags=0)
 "Do-nothing constructor"
 
 ACE_Thread_Strategy (ACE_Thread_Manager *tm, long thr_flags, int n_threads=1, int flags=0)
 Initialize the strategy.
 
virtual int open (ACE_Thread_Manager *tm, long thr_flags, int n_threads=1, int flags=0)
 Initialize the strategy.
 
virtual ~ACE_Thread_Strategy ()
 
virtual int activate_svc_handler (SVC_HANDLER *svc_handler, void *arg=0)
 
void dump () const
 Dump the state of an object.
 
- Public Member Functions inherited from ACE_Concurrency_Strategy< SVC_HANDLER >
 ACE_Concurrency_Strategy (int flags=0)
 Constructor.
 
virtual ~ACE_Concurrency_Strategy ()
 
void dump () const
 Dump the state of an object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 
- Public Attributes inherited from ACE_Concurrency_Strategy< SVC_HANDLER >
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Protected Types

typedef ACE_Concurrency_Strategy< SVC_HANDLERinherited
 

Protected Attributes

ACE_Thread_Managerthr_mgr_
 Thread manager for this class (must be provided).
 
long thr_flags_
 Flags to pass into the <SVC_HANDLER::activate> method.
 
int n_threads_
 Number of threads to spawn.
 
- Protected Attributes inherited from ACE_Concurrency_Strategy< SVC_HANDLER >
int flags_
 

Detailed Description

template<class SVC_HANDLER>
class ACE_Thread_Strategy< SVC_HANDLER >

Defines the interface for specifying a concurrency strategy for a SVC_HANDLER based on multithreading.

This class provides a strategy that manages the creation of threads to handle requests from clients concurrently via a thread-per-connection model. It behaves as a "thread factory", spawning threads "on-demand" to run the service specified by a user-supplied SVC_HANDLER.

Member Typedef Documentation

◆ base_type

◆ inherited

Constructor & Destructor Documentation

◆ ACE_Thread_Strategy() [1/2]

"Do-nothing constructor"

◆ ACE_Thread_Strategy() [2/2]

template<class SVC_HANDLER >
ACE_Thread_Strategy< SVC_HANDLER >::ACE_Thread_Strategy ( ACE_Thread_Manager * tm,
long thr_flags,
int n_threads = 1,
int flags = 0 )
inline

Initialize the strategy.

◆ ~ACE_Thread_Strategy()

Member Function Documentation

◆ activate_svc_handler()

template<class SVC_HANDLER >
int ACE_Thread_Strategy< SVC_HANDLER >::activate_svc_handler ( SVC_HANDLER * svc_handler,
void * arg = 0 )
virtual

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.

Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >.

◆ dump()

template<class SVC_HANDLER >
void ACE_Thread_Strategy< SVC_HANDLER >::dump ( ) const

Dump the state of an object.

◆ open()

template<class SVC_HANDLER >
int ACE_Thread_Strategy< SVC_HANDLER >::open ( ACE_Thread_Manager * tm,
long thr_flags,
int n_threads = 1,
int flags = 0 )
virtual

Initialize the strategy.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<class SVC_HANDLER >
ACE_Thread_Strategy< SVC_HANDLER >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ n_threads_

template<class SVC_HANDLER >
int ACE_Thread_Strategy< SVC_HANDLER >::n_threads_
protected

Number of threads to spawn.

◆ thr_flags_

template<class SVC_HANDLER >
long ACE_Thread_Strategy< SVC_HANDLER >::thr_flags_
protected

Flags to pass into the <SVC_HANDLER::activate> method.

◆ thr_mgr_

Thread manager for this class (must be provided).


The documentation for this class was generated from the following files: