ACE 8.0.5
Loading...
Searching...
No Matches
ACE_Singleton_Strategy< SVC_HANDLER > Class Template Reference

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). More...

#include <Strategies_T.h>

Inheritance diagram for ACE_Singleton_Strategy< SVC_HANDLER >:
Collaboration diagram for ACE_Singleton_Strategy< SVC_HANDLER >:

Public Types

typedef ACE_Creation_Strategy< SVC_HANDLER > base_type
Public Types inherited from ACE_Creation_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_Singleton_Strategy (SVC_HANDLER *=0, ACE_Thread_Manager *=0)
int open (SVC_HANDLER *, ACE_Thread_Manager *=0)
virtual ~ACE_Singleton_Strategy ()
virtual int make_svc_handler (SVC_HANDLER *&)
void dump () const
 Dump the state of an object.
Public Member Functions inherited from ACE_Creation_Strategy< SVC_HANDLER >
 ACE_Creation_Strategy (ACE_Thread_Manager *=0, ACE_Reactor *=ACE_Reactor::instance())
 Default constructor.
int open (ACE_Thread_Manager *=0, ACE_Reactor *=ACE_Reactor::instance())
virtual ~ACE_Creation_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_Creation_Strategy< SVC_HANDLER >
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Protected Attributes

SVC_HANDLER * svc_handler_
 Pointer to the Singleton svc_handler.
bool delete_svc_handler_
 Keep track of whether we need to delete the SVC_HANDLER.
Protected Attributes inherited from ACE_Creation_Strategy< SVC_HANDLER >
ACE_Thread_Managerthr_mgr_
 Pointer to a thread manager.
ACE_Reactorreactor_
 Pointer to an ACE_Reactor.

Detailed Description

template<class SVC_HANDLER>
class ACE_Singleton_Strategy< SVC_HANDLER >

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).

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.

Member Typedef Documentation

◆ base_type

template<class SVC_HANDLER>
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Singleton_Strategy< SVC_HANDLER >::base_type

Constructor & Destructor Documentation

◆ ACE_Singleton_Strategy()

template<class SVC_HANDLER>
ACE_Singleton_Strategy< SVC_HANDLER >::ACE_Singleton_Strategy ( SVC_HANDLER * sh = 0,
ACE_Thread_Manager * tm = 0 )
inline

◆ ~ACE_Singleton_Strategy()

template<class SVC_HANDLER>
ACE_Singleton_Strategy< SVC_HANDLER >::~ACE_Singleton_Strategy ( )
virtual

Member Function Documentation

◆ dump()

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

Dump the state of an object.

◆ make_svc_handler()

template<class SVC_HANDLER>
int ACE_Singleton_Strategy< SVC_HANDLER >::make_svc_handler ( SVC_HANDLER *& sh)
virtual

Create a Singleton SVC_HANDLER by always returning the same SVC_HANDLER. Returns -1 on failure, else 0.

Reimplemented from ACE_Creation_Strategy< SVC_HANDLER >.

◆ open()

template<class SVC_HANDLER>
int ACE_Singleton_Strategy< SVC_HANDLER >::open ( SVC_HANDLER * sh,
ACE_Thread_Manager * = 0 )

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<class SVC_HANDLER>
ACE_Singleton_Strategy< SVC_HANDLER >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ delete_svc_handler_

template<class SVC_HANDLER>
bool ACE_Singleton_Strategy< SVC_HANDLER >::delete_svc_handler_
protected

Keep track of whether we need to delete the SVC_HANDLER.

◆ svc_handler_

template<class SVC_HANDLER>
SVC_HANDLER* ACE_Singleton_Strategy< SVC_HANDLER >::svc_handler_
protected

Pointer to the Singleton svc_handler.


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