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

ACE_Reactive_Strategy Class Template Reference

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

#include <Strategies_T.h>

Inheritance diagram for ACE_Reactive_Strategy:

Inheritance graph
[legend]
Collaboration diagram for ACE_Reactive_Strategy:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Concurrency_Strategy<
SVC_HANDLER > 
base_type

Public Methods

 ACE_Reactive_Strategy (int flags=0)
 "Do-nothing constructor". More...

 ACE_Reactive_Strategy (ACE_Reactor *reactor, ACE_Reactor_Mask=ACE_Event_Handler::READ_MASK, int flags=0)
 Initialize the strategy. More...

virtual int open (ACE_Reactor *reactor, ACE_Reactor_Mask=ACE_Event_Handler::READ_MASK, int flags=0)
 Initialize the strategy. More...

virtual ~ACE_Reactive_Strategy (void)
 Destructor. More...

virtual int activate_svc_handler (SVC_HANDLER *svc_handler, void *arg=0)
 Activate the <svc_handler> by registering it with the <Reactor> and then calling it's <open> hook. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Types

typedef ACE_Concurrency_Strategy<
SVC_HANDLER > 
inherited

Protected Attributes

ACE_Reactorreactor_
 Pointer to the Reactor we'll use to register the <SVC_HANDLER>. More...

ACE_Reactor_Mask mask_
 The mask that we pass to the <Reactor> when we register the <SVC_HANDLER>. More...


Detailed Description

template<class SVC_HANDLER>
class ACE_Reactive_Strategy< SVC_HANDLER >

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

This class provides a strategy that registers the <SVC_HANDLER> with a <Reactor>.

Definition at line 295 of file Strategies_T.h.


Member Typedef Documentation

template<class SVC_HANDLER>
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Reactive_Strategy::base_type
 

Definition at line 300 of file Strategies_T.h.

template<class SVC_HANDLER>
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Reactive_Strategy::inherited [protected]
 

Definition at line 332 of file Strategies_T.h.


Constructor & Destructor Documentation

template<class SVC_HANDLER>
ASYS_INLINE ACE_Reactive_Strategy< SVC_HANDLER >::ACE_Reactive_Strategy int    flags = 0
 

"Do-nothing constructor".

Definition at line 150 of file Strategies_T.i.

References ACE_TRACE.

00151   : ACE_Concurrency_Strategy<SVC_HANDLER> (flags),
00152     reactor_ (0),
00153     mask_ (ACE_Event_Handler::NULL_MASK)
00154 {
00155   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
00156 }

template<class SVC_HANDLER>
ASYS_INLINE ACE_Reactive_Strategy< SVC_HANDLER >::ACE_Reactive_Strategy ACE_Reactor   reactor,
ACE_Reactor_Mask    = ACE_Event_Handler::READ_MASK,
int    flags = 0
 

Initialize the strategy.

Definition at line 135 of file Strategies_T.i.

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

00138 {
00139   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
00140 
00141   if (this->open (reactor,
00142                   mask,
00143                   flags) == -1)
00144     ACE_ERROR ((LM_ERROR,
00145                 ACE_LIB_TEXT ("%p\n"),
00146                 ACE_LIB_TEXT ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy")));
00147 }

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

Destructor.

Definition at line 159 of file Strategies_T.i.

References ACE_TRACE.

00160 {
00161   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::~ACE_Reactive_Strategy");
00162 }


Member Function Documentation

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

Activate the <svc_handler> by registering it with the <Reactor> and then calling it's <open> hook.

Reimplemented from ACE_Concurrency_Strategy.

Definition at line 173 of file Strategies_T.cpp.

References ACE_TRACE, reactor_, ACE_Reactor::register_handler, and ACE_Reactor::uses_event_associations.

00175 {
00176   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
00177 
00178   int result = 0;
00179 
00180   if (this->reactor_ == 0)
00181     result = -1;
00182 
00183   // Register with the Reactor with the appropriate <mask>.
00184   else if (this->reactor_->register_handler (svc_handler, this->mask_) == -1)
00185     result = -1;
00186 
00187   // If the implementation of the reactor uses event associations
00188   else if (this->reactor_->uses_event_associations ())
00189     {
00190       // If we don't have non-block on, it won't work with
00191       // WFMO_Reactor
00192       // This maybe too harsh
00193       // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
00194       // goto failure;
00195       if (svc_handler->open (arg) != -1)
00196         return 0;
00197       else
00198         result = -1;
00199     }
00200   else
00201     // Call up to our parent to do the SVC_HANDLER initialization.
00202     return this->inherited::activate_svc_handler (svc_handler, arg);
00203 
00204   if (result == -1)
00205     svc_handler->close (0);
00206 
00207   return result;
00208 }

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

Dump the state of an object.

Reimplemented from ACE_Concurrency_Strategy.

Definition at line 1155 of file Strategies_T.cpp.

References ACE_TRACE.

01156 {
01157   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::dump");
01158 }

template<class SVC_HANDLER>
int ACE_Reactive_Strategy< SVC_HANDLER >::open ACE_Reactor   reactor,
ACE_Reactor_Mask    = ACE_Event_Handler::READ_MASK,
int    flags = 0
[virtual]
 

Initialize the strategy.

Definition at line 156 of file Strategies_T.cpp.

References ACE_Reactor_Mask, ACE_TRACE, ACE_Concurrency_Strategy::flags_, mask_, and reactor_.

Referenced by ACE_Reactive_Strategy.

00159 {
00160   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::open");
00161   this->reactor_ = reactor;
00162   this->mask_ = mask;
00163   this->flags_ = flags;
00164 
00165   // Must have a <Reactor>
00166   if (this->reactor_ == 0)
00167     return -1;
00168   else
00169     return 0;
00170 }


Member Data Documentation

template<class SVC_HANDLER>
ACE_Reactive_Strategy::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Concurrency_Strategy.

Definition at line 329 of file Strategies_T.h.

template<class SVC_HANDLER>
ACE_Reactor_Mask ACE_Reactive_Strategy::mask_ [protected]
 

The mask that we pass to the <Reactor> when we register the <SVC_HANDLER>.

Definition at line 339 of file Strategies_T.h.

Referenced by open.

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

Pointer to the Reactor we'll use to register the <SVC_HANDLER>.

Definition at line 335 of file Strategies_T.h.

Referenced by activate_svc_handler, and open.


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