ACE_Creation_Strategy< SVC_HANDLER > 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< SVC_HANDLER >:

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

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 Member Functions

 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)
virtual int make_svc_handler (SVC_HANDLER *&sh)
void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Protected Attributes

ACE_Thread_Managerthr_mgr_
 Pointer to a thread manager.

ACE_Reactorreactor_
 Pointer to an ACE_Reactor.


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 84 of file Strategies_T.h.


Member Typedef Documentation

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

Definition at line 89 of file Strategies_T.h.

template<class SVC_HANDLER>
typedef SVC_HANDLER ACE_Creation_Strategy< SVC_HANDLER >::handler_type
 

Definition at line 90 of file Strategies_T.h.

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

Definition at line 91 of file Strategies_T.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 31 of file Strategies_T.inl.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, and ACE_Creation_Strategy< SVC_HANDLER >::open().

00033 {
00034   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy");
00035   if (this->open (thr_mgr, reactor) == -1)
00036     ACE_ERROR ((LM_ERROR,
00037                 ACE_LIB_TEXT ("%p\n"),
00038                 ACE_LIB_TEXT ("ACE_Creation_Strategy")));
00039 }

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

Definition at line 1444 of file Strategies_T.cpp.

References ACE_TRACE.

01445 {
01446   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::~ACE_Creation_Strategy");
01447 }


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< SVC_HANDLER >, and ACE_DLL_Strategy< SVC_HANDLER >.

Definition at line 1464 of file Strategies_T.cpp.

References ACE_TRACE.

Referenced by ACE_Strategy_Acceptor< SVC_HANDLER, >::dump().

01465 {
01466 #if defined (ACE_HAS_DUMP)
01467   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::dump");
01468 #endif /* ACE_HAS_DUMP */
01469 }

template<class SVC_HANDLER>
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 if == 0 (passing in the ), else is unchanged. Returns -1 on failure, else 0.

Reimplemented in ACE_Singleton_Strategy< SVC_HANDLER >, ACE_DLL_Strategy< SVC_HANDLER >, and ACE_NOOP_Creation_Strategy< SVC_HANDLER >.

Definition at line 1453 of file Strategies_T.cpp.

References ACE_NEW_RETURN, and ACE_TRACE.

Referenced by ACE_Strategy_Acceptor< SVC_HANDLER, >::make_svc_handler().

01454 {
01455   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::make_svc_handler");
01456 
01457   if (sh == 0)
01458     ACE_NEW_RETURN (sh, SVC_HANDLER (this->thr_mgr_), -1);
01459   sh->reactor (this->reactor_);
01460   return 0;
01461 }

template<class SVC_HANDLER>
ACE_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 21 of file Strategies_T.inl.

References ACE_TRACE.

Referenced by ACE_Creation_Strategy< SVC_HANDLER >::ACE_Creation_Strategy().

00023 {
00024   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::open");
00025   this->thr_mgr_ = thr_mgr;
00026   this->reactor_ = reactor;
00027   return 0;
00028 }


Member Data Documentation

template<class SVC_HANDLER>
ACE_Creation_Strategy< SVC_HANDLER >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_Singleton_Strategy< SVC_HANDLER >, and ACE_DLL_Strategy< SVC_HANDLER >.

Definition at line 119 of file Strategies_T.h.

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

Pointer to an ACE_Reactor.

Definition at line 126 of file Strategies_T.h.

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

Pointer to a thread manager.

Definition at line 123 of file Strategies_T.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:21:13 2006 for ACE by doxygen 1.3.6