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

ACE_Synch_Options Class Reference

Contains the values of options used to determine the synchronous and asynchronous behavior. More...

#include <Synch_Options.h>

Collaboration diagram for ACE_Synch_Options:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { USE_REACTOR = 01, USE_TIMEOUT = 02 }
 Options flags for controlling synchronization. More...


Public Methods

 ACE_Synch_Options (u_long options=0, const ACE_Time_Value &timeout=ACE_Time_Value::zero, const void *arg=0)
 Initialize the Synch_Options based on parameters. More...

 ~ACE_Synch_Options (void)
 Default dtor. More...

void set (u_long options=0, const ACE_Time_Value &timeout=ACE_Time_Value::zero, const void *arg=0)
 Initialize the Synch_Options based on parameters. More...

int operator[] (u_long option) const
 Get method for determining which options are enabled. More...

void operator= (u_long option)
 Set method for enabling certain options. More...

const void * arg (void) const
 Returns the "magic cookie" argument. More...

void arg (const void *)
 Set the "magic cookie" argument. More...

const ACE_Time_Valuetimeout (void) const
 Returns a reference to the <Time_Value>. This value only makes sense if (*this)[USE_TIMEOUT] is true. More...

void timeout (const ACE_Time_Value &tv)
 Set the <Time_Value>. More...

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Static Public Attributes

ACE_Synch_Options defaults
 This is the default setting for options, which will block synchronously. More...

ACE_Synch_Options synch
 This is the default synchronous setting. More...

ACE_Synch_Options asynch
 This is the default asynchronous setting. More...


Private Attributes

u_long options_
 Keeps track of the enabled options. More...

ACE_Time_Value timeout_
 Amount of time to wait for timeouts. More...

const void * arg_

Detailed Description

Contains the values of options used to determine the synchronous and asynchronous behavior.

Values support the following behavior (TV == "timeout" and UR == "use ACE_Reactor"):

| Parameters | Description | |TV | UR | |-----|----------|------------------------------- | | |NULL | yes | infinite timeout (using ACE_Reactor) | | |time | yes | try asynch transaction for | | the specified time (using ACE_Reactor) | | |0,0 | yes | poll; try, if EWOULDBLOCK, | | then return immediately | | (using ACE_Reactor) | | |NULL | no | block forever (don't use ACE_Reactor) | | |time | no | do a blocking transaction | | for the specified time | | (don't use ACE_Reactor) | | |0,0 | no | poll; but do not initiate a | | nonblocking transaction | | (don't use ACE_Reactor)

Definition at line 61 of file Synch_Options.h.


Member Enumeration Documentation

anonymous enum
 

Options flags for controlling synchronization.

Note that these flags can be bit-wise "or'd" together if both options are desired.

Enumeration values:
USE_REACTOR  Use the Reactor.
USE_TIMEOUT  Interprete the Time_Value.

Definition at line 69 of file Synch_Options.h.

00070   {
00071     /// Use the Reactor.
00072     USE_REACTOR = 01,
00073     /// Interprete the Time_Value.
00074     USE_TIMEOUT = 02
00075   };


Constructor & Destructor Documentation

ACE_Synch_Options::ACE_Synch_Options u_long    options = 0,
const ACE_Time_Value   timeout = ACE_Time_Value::zero,
const void *    arg = 0
 

Initialize the Synch_Options based on parameters.

Definition at line 32 of file Synch_Options.cpp.

References arg, and set.

00035 {
00036   // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options");
00037   this->set (options, timeout, arg);
00038 }

ACE_INLINE ACE_Synch_Options::~ACE_Synch_Options void   
 

Default dtor.

Definition at line 7 of file Synch_Options.i.

00008 {
00009 }


Member Function Documentation

void ACE_Synch_Options::arg const void *   
 

Set the "magic cookie" argument.

Definition at line 102 of file Synch_Options.cpp.

References ACE_TRACE, and arg_.

00103 {
00104   ACE_TRACE ("ACE_Synch_Options::arg");
00105   this->arg_ = a;
00106 }

const void * ACE_Synch_Options::arg void    const
 

Returns the "magic cookie" argument.

Definition at line 95 of file Synch_Options.cpp.

References ACE_TRACE, and arg_.

Referenced by ACE_Synch_Options, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::create_AST, and set.

00096 {
00097   ACE_TRACE ("ACE_Synch_Options::arg");
00098   return this->arg_;
00099 }

void ACE_Synch_Options::dump void    const
 

Dump the state of an object.

Definition at line 15 of file Synch_Options.cpp.

References ACE_TRACE.

00016 {
00017   ACE_TRACE ("ACE_Synch_Options::dump");
00018 }

void ACE_Synch_Options::operator= u_long    option
 

Set method for enabling certain options.

Definition at line 67 of file Synch_Options.cpp.

References ACE_TRACE, and options_.

00068 {
00069   ACE_TRACE ("ACE_Synch_Options::operator=");
00070   this->options_ |= option;
00071 }

int ACE_Synch_Options::operator[] u_long    option const
 

Get method for determining which options are enabled.

Definition at line 60 of file Synch_Options.cpp.

References ACE_TRACE, and options_.

00061 {
00062   ACE_TRACE ("ACE_Synch_Options::operator[]");
00063   return (this->options_ & option) != 0;
00064 }

void ACE_Synch_Options::set u_long    options = 0,
const ACE_Time_Value   timeout = ACE_Time_Value::zero,
const void *    arg = 0
 

Initialize the Synch_Options based on parameters.

Definition at line 41 of file Synch_Options.cpp.

References ACE_SET_BITS, arg, arg_, options_, timeout_, USE_TIMEOUT, and ACE_Time_Value::zero.

Referenced by ACE_Synch_Options, and ACE_Token_Request::decode.

00044 {
00045   // ACE_TRACE ("ACE_Synch_Options::set");
00046   this->options_ = options;
00047   this->timeout_ = (ACE_Time_Value &) timeout;
00048 
00049   // Whoa, possible dependence on static initialization here.  This
00050   // function is called during initialization of the statics above.
00051   // But, ACE_Time_Value::zero is a static object.  Very fortunately,
00052   // its bits have a value of 0.
00053   if (this->timeout_ != ACE_Time_Value::zero)
00054     ACE_SET_BITS (this->options_, ACE_Synch_Options::USE_TIMEOUT);
00055 
00056   this->arg_ = arg;
00057 }

const ACE_Time_Value * ACE_Synch_Options::time_value void    const
 

Returns the address of the timeout <Time_Value> if (*this)[USE_TIMEOUT] is true, else 0. This should be used with care, e.g., the timeout pointer should not be stored in a manner that will lead to dangling pointers...

Definition at line 88 of file Synch_Options.cpp.

References ACE_TRACE, timeout_, and USE_TIMEOUT.

Referenced by ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::connect_i, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::create_AST, ACE_Token_Proxy::handle_options, and ACE_Name_Proxy::open.

00089 {
00090   ACE_TRACE ("ACE_Synch_Options::time_value");
00091   return (*this)[USE_TIMEOUT] ? &this->timeout_ : 0;
00092 }

void ACE_Synch_Options::timeout const ACE_Time_Value   tv
 

Set the <Time_Value>.

Definition at line 81 of file Synch_Options.cpp.

References ACE_TRACE, and timeout_.

00082 {
00083   ACE_TRACE ("ACE_Synch_Options::timeout");
00084   this->timeout_ = tv;
00085 }

const ACE_Time_Value & ACE_Synch_Options::timeout void    const
 

Returns a reference to the <Time_Value>. This value only makes sense if (*this)[USE_TIMEOUT] is true.

Definition at line 74 of file Synch_Options.cpp.

References ACE_TRACE, and timeout_.

Referenced by ACE_Token_Request::dump.

00075 {
00076   ACE_TRACE ("ACE_Synch_Options::timeout");
00077   return this->timeout_;
00078 }


Member Data Documentation

ACE_Synch_Options::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 134 of file Synch_Options.h.

const void* ACE_Synch_Options::arg_ [private]
 

"Magic cookie" always passed in as an argument to the ACE_Reactor's <schedule_timer> method. Used to communicate values for asynchronous programming.

Definition at line 148 of file Synch_Options.h.

Referenced by arg, and set.

ACE_Synch_Options ACE_Synch_Options::asynch [static]
 

This is the default asynchronous setting.

Referenced by ACE_Remote_Token_Proxy::acquire, and ACE_Remote_Token_Proxy::renew.

ACE_Synch_Options ACE_Synch_Options::defaults [static]
 

This is the default setting for options, which will block synchronously.

Definition at line 24 of file Synch_Options.cpp.

Referenced by ACE_Null_Token::acquire, ACE_Null_Token::release, ACE_Null_Token::remove, and ACE_Null_Token::renew.

u_long ACE_Synch_Options::options_ [private]
 

Keeps track of the enabled options.

Definition at line 138 of file Synch_Options.h.

Referenced by operator=, operator[], and set.

ACE_Synch_Options ACE_Synch_Options::synch [static]
 

This is the default synchronous setting.

Definition at line 27 of file Synch_Options.cpp.

Referenced by ACE_Remote_Token_Proxy::tryacquire.

ACE_Time_Value ACE_Synch_Options::timeout_ [private]
 

Amount of time to wait for timeouts.

Definition at line 141 of file Synch_Options.h.

Referenced by set, time_value, and timeout.


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