Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Creation_Strategy Class Template Reference

Defines the interface for specifying a creation strategy for a SVC_HANDLER. More...

#include <Strategies_T.h>

Inheritance diagram for ACE_Creation_Strategy:

Inheritance graph
[legend]
Collaboration diagram for ACE_Creation_Strategy:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_TYPENAME SVC_HANDLER::addr_type addr_type
typedef SVC_HANDLER handler_type
typedef ACE_TYPENAME SVC_HANDLER::stream_type stream_type

Public Methods

 ACE_Creation_Strategy (ACE_Thread_Manager *=0, ACE_Reactor *=ACE_Reactor::instance())
 Default constructor. More...

int open (ACE_Thread_Manager *=0, ACE_Reactor *=ACE_Reactor::instance())
 An ACE_Thread_Manager is useful when creating active objects and the ACE_Reactor is used to initialize the service handler's reactor. More...

virtual ~ACE_Creation_Strategy (void)
virtual int make_svc_handler (SVC_HANDLER *&sh)
void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Attributes

ACE_Thread_Managerthr_mgr_
 Pointer to a thread manager. More...

ACE_Reactorreactor_
 Pointer to an ACE_Reactor. More...


Detailed Description

template<class SVC_HANDLER>
class ACE_Creation_Strategy< SVC_HANDLER >

Defines the interface for specifying a creation strategy for a SVC_HANDLER.

The default behavior is to make a new SVC_HANDLER. However, subclasses can override this strategy to perform SVC_HANDLER creation in any way that they like (such as creating subclass instances of SVC_HANDLER, using a singleton, dynamically linking the handler, etc.).

Definition at line 81 of file Strategies_T.h.


Member Typedef Documentation

template<class SVC_HANDLER>
typedef ACE_TYPENAME SVC_HANDLER::addr_type ACE_Creation_Strategy::addr_type
 

Definition at line 86 of file Strategies_T.h.

template<class SVC_HANDLER>
typedef SVC_HANDLER ACE_Creation_Strategy::handler_type
 

Definition at line 87 of file Strategies_T.h.

template<class SVC_HANDLER>
typedef ACE_TYPENAME SVC_HANDLER::stream_type ACE_Creation_Strategy::stream_type
 

Definition at line 88 of file Strategies_T.h.


Constructor & Destructor Documentation

template<class SVC_HANDLER>
ASYS_INLINE ACE_Creation_Strategy< SVC_HANDLER >::ACE_Creation_Strategy ACE_Thread_Manager   = 0,
ACE_Reactor   = ACE_Reactor::instance()
 

Default constructor.

Definition at line 67 of file Strategies_T.i.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, and open.

00069 {
00070   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy");
00071   if (this->open (thr_mgr, reactor) == -1)
00072     ACE_ERROR ((LM_ERROR,
00073                 ACE_LIB_TEXT ("%p\n"),
00074                 ACE_LIB_TEXT ("ACE_Creation_Strategy")));
00075 }

template<class SVC_HANDLER>
ASYS_INLINE ACE_Creation_Strategy< SVC_HANDLER >::~ACE_Creation_Strategy void    [virtual]
 

Definition at line 92 of file Strategies_T.i.

References ACE_TRACE.

00093 {
00094   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::~ACE_Creation_Strategy");
00095 }


Member Function Documentation

template<class SVC_HANDLER>
void ACE_Creation_Strategy< SVC_HANDLER >::dump void    const
 

Dump the state of an object.

Reimplemented in ACE_Singleton_Strategy.

Definition at line 1216 of file Strategies_T.cpp.

References ACE_TRACE.

Referenced by ACE_Strategy_Acceptor::dump.

01217 {
01218   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::dump");
01219 }

template<class SVC_HANDLER>
ASYS_INLINE int ACE_Creation_Strategy< SVC_HANDLER >::make_svc_handler SVC_HANDLER *&    sh [virtual]
 

Create a SVC_HANDLER with the appropriate creation strategy. The default behavior of this method is to make a new <SVC_HANDLER> if <sh> == 0 (passing in the <Thread_Manager>), else <sh> is unchanged. Returns -1 on failure, else 0.

Reimplemented in ACE_Singleton_Strategy.

Definition at line 81 of file Strategies_T.i.

References ACE_NEW_RETURN, and ACE_TRACE.

Referenced by ACE_Strategy_Connector::make_svc_handler, and ACE_Strategy_Acceptor::make_svc_handler.

00082 {
00083   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::make_svc_handler");
00084 
00085   if (sh == 0)
00086     ACE_NEW_RETURN (sh, SVC_HANDLER (this->thr_mgr_), -1);
00087   sh->reactor (this->reactor_);
00088   return 0;
00089 }

template<class SVC_HANDLER>
ASYS_INLINE int ACE_Creation_Strategy< SVC_HANDLER >::open ACE_Thread_Manager   = 0,
ACE_Reactor   = ACE_Reactor::instance()
 

An ACE_Thread_Manager is useful when creating active objects and the ACE_Reactor is used to initialize the service handler's reactor.

Definition at line 57 of file Strategies_T.i.

References ACE_TRACE, reactor_, and thr_mgr_.

Referenced by ACE_Creation_Strategy.

00059 {
00060   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::open");
00061   this->thr_mgr_ = thr_mgr;
00062   this->reactor_ = reactor;
00063   return 0;
00064 }


Member Data Documentation

template<class SVC_HANDLER>
ACE_Creation_Strategy::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_Singleton_Strategy.

Definition at line 116 of file Strategies_T.h.

template<class SVC_HANDLER>
ACE_Reactor* ACE_Creation_Strategy::reactor_ [protected]
 

Pointer to an ACE_Reactor.

Definition at line 123 of file Strategies_T.h.

Referenced by open.

template<class SVC_HANDLER>
ACE_Thread_Manager* ACE_Creation_Strategy::thr_mgr_ [protected]
 

Pointer to a thread manager.

Definition at line 120 of file Strategies_T.h.

Referenced by open.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:46:59 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002