ACE_Concurrency_Strategy< SVC_HANDLER > Class Template Reference

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

#include <Strategies_T.h>

Inheritance diagram for ACE_Concurrency_Strategy< SVC_HANDLER >:

Inheritance graph
[legend]
List of all members.

Public Types

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

Public Member Functions

 ACE_Concurrency_Strategy (int flags=0)
 Constructor.
virtual int activate_svc_handler (SVC_HANDLER *svc_handler, void *arg=0)
virtual ~ACE_Concurrency_Strategy (void)
void dump (void) const
 Dump the state of an object.

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Protected Attributes

int flags_

Detailed Description

template<class SVC_HANDLER>
class ACE_Concurrency_Strategy< SVC_HANDLER >

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

Default behavior is to activate the SVC_HANDLER by calling its <open> method (which allows the SVC_HANDLER to define its own concurrency strategy). However, subclasses can override this default strategy to do more sophisticated concurrency activations (such as creating the SVC_HANDLER as an active object via multi-threading or multi-processing).

Definition at line 251 of file Strategies_T.h.


Member Typedef Documentation

template<class SVC_HANDLER>
typedef SVC_HANDLER::addr_type ACE_Concurrency_Strategy< SVC_HANDLER >::addr_type

Definition at line 256 of file Strategies_T.h.

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

Definition at line 257 of file Strategies_T.h.

template<class SVC_HANDLER>
typedef SVC_HANDLER::stream_type ACE_Concurrency_Strategy< SVC_HANDLER >::stream_type

Definition at line 258 of file Strategies_T.h.


Constructor & Destructor Documentation

template<class SVC_HANDLER>
ACE_INLINE ACE_Concurrency_Strategy< SVC_HANDLER >::ACE_Concurrency_Strategy ( int  flags = 0  ) 

Constructor.

Definition at line 66 of file Strategies_T.inl.

References ACE_TRACE.

00067   : flags_ (flags)
00068 {
00069   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::ACE_Concurrency_Strategy");
00070 }

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

Definition at line 1241 of file Strategies_T.cpp.

References ACE_TRACE.

01242 {
01243   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::~ACE_Concurrency_Strategy");
01244 }


Member Function Documentation

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

Activate the <svc_handler> with an appropriate concurrency strategy. The default behavior of this method is to activate the SVC_HANDLER by calling its <open> method (which allows the SVC_HANDLER to define its own concurrency strategy).

Reimplemented in ACE_Reactive_Strategy< SVC_HANDLER >, ACE_Thread_Strategy< SVC_HANDLER >, ACE_Process_Strategy< SVC_HANDLER >, and ACE_NOOP_Concurrency_Strategy< SVC_HANDLER >.

Definition at line 178 of file Strategies_T.cpp.

References ACE_BIT_ENABLED, ACE_NONBLOCK, and ACE_TRACE.

Referenced by ACE_Process_Strategy< SVC_HANDLER >::activate_svc_handler(), ACE_Reactive_Strategy< SVC_HANDLER >::activate_svc_handler(), and ACE_Strategy_Connector< SVC_HANDLER, >::activate_svc_handler().

00180 {
00181   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler");
00182 
00183   int result = 0;
00184 
00185   // See if we should enable non-blocking I/O on the <svc_handler>'s
00186   // peer.
00187   if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0)
00188     {
00189       if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1)
00190         result = -1;
00191     }
00192   // Otherwise, make sure it's disabled by default.
00193   else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1)
00194     result = -1;
00195 
00196   if (result == 0 && svc_handler->open (arg) == -1)
00197     result = -1;
00198 
00199   if (result == -1)
00200     svc_handler->close (0);
00201 
00202   return result;
00203 }

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

Dump the state of an object.

Reimplemented in ACE_Reactive_Strategy< SVC_HANDLER >, ACE_Thread_Strategy< SVC_HANDLER >, and ACE_Process_Strategy< SVC_HANDLER >.

Definition at line 1248 of file Strategies_T.cpp.

References ACE_TRACE.

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

01249 {
01250 #if defined (ACE_HAS_DUMP)
01251   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::dump");
01252 #endif /* ACE_HAS_DUMP */
01253 }


Member Data Documentation

template<class SVC_HANDLER>
ACE_Concurrency_Strategy< SVC_HANDLER >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

Reimplemented in ACE_Reactive_Strategy< SVC_HANDLER >, ACE_Thread_Strategy< SVC_HANDLER >, and ACE_Process_Strategy< SVC_HANDLER >.

Definition at line 279 of file Strategies_T.h.

template<class SVC_HANDLER>
int ACE_Concurrency_Strategy< SVC_HANDLER >::flags_ [protected]

Flags that are parsed to set options for the connected SVC_HANDLER.

Definition at line 285 of file Strategies_T.h.

Referenced by ACE_Process_Strategy< SVC_HANDLER >::open(), ACE_Thread_Strategy< SVC_HANDLER >::open(), and ACE_Reactive_Strategy< SVC_HANDLER >::open().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:00 2010 for ACE by  doxygen 1.4.7