#include <Synch_Options.h>
Collaboration diagram for ACE_Synch_Options:
Public Types | |
enum | { USE_REACTOR = 01, USE_TIMEOUT = 02 } |
Options flags for controlling synchronization. More... | |
Public Member Functions | |
ACE_Synch_Options (unsigned long options=0, const ACE_Time_Value &timeout=ACE_Time_Value::zero, const void *arg=0) | |
Initialize the Synch_Options based on parameters. | |
void | set (unsigned long options=0, const ACE_Time_Value &timeout=ACE_Time_Value::zero, const void *arg=0) |
Initialize the Synch_Options based on parameters. | |
int | operator[] (unsigned long option) const |
Get method for determining which options are enabled. | |
void | operator= (unsigned long option) |
Set method for enabling certain options. | |
const void * | arg (void) const |
Returns the "magic cookie" argument. | |
void | arg (const void *) |
Set the "magic cookie" argument. | |
const ACE_Time_Value & | timeout (void) const |
void | timeout (const ACE_Time_Value &tv) |
Set the ACE_Time_Value. | |
const ACE_Time_Value * | time_value (void) const |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Static Public Attributes | |
ACE_Synch_Options | defaults |
ACE_Synch_Options | synch |
This is the default synchronous setting. | |
ACE_Synch_Options | asynch |
This is the default asynchronous setting. | |
Private Attributes | |
unsigned long | options_ |
Keeps track of the enabled options. | |
ACE_Time_Value | timeout_ |
Amount of time to wait for timeouts. | |
const void * | arg_ |
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 63 of file Synch_Options.h.
|
Options flags for controlling synchronization. Note that these flags can be bit-wise "or'd" together if both options are desired. Definition at line 71 of file Synch_Options.h.
00072 { 00073 /// Use the Reactor. 00074 USE_REACTOR = 01, 00075 /// Interprete the Time_Value. 00076 USE_TIMEOUT = 02 00077 }; |
|
Initialize the Synch_Options based on parameters.
Definition at line 34 of file Synch_Options.cpp. References set().
00037 { 00038 // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options"); 00039 this->set (options, timeout, arg); 00040 } |
|
Set the "magic cookie" argument.
Definition at line 104 of file Synch_Options.cpp. References ACE_TRACE.
|
|
Returns the "magic cookie" argument.
Definition at line 97 of file Synch_Options.cpp. References ACE_TRACE.
|
|
Dump the state of an object.
Definition at line 15 of file Synch_Options.cpp. References ACE_TRACE.
00016 { 00017 #if defined (ACE_HAS_DUMP) 00018 ACE_TRACE ("ACE_Synch_Options::dump"); 00019 #endif /* ACE_HAS_DUMP */ 00020 } |
|
Set method for enabling certain options.
Definition at line 69 of file Synch_Options.cpp. References ACE_TRACE, and options_.
|
|
Get method for determining which options are enabled.
Definition at line 62 of file Synch_Options.cpp. References ACE_TRACE, and options_.
|
|
Initialize the Synch_Options based on parameters.
Definition at line 43 of file Synch_Options.cpp. References ACE_SET_BITS, options_, and USE_TIMEOUT. Referenced by ACE_Synch_Options(), and ACE_Token_Request::decode().
00046 { 00047 // ACE_TRACE ("ACE_Synch_Options::set"); 00048 this->options_ = options; 00049 this->timeout_ = (ACE_Time_Value &) timeout; 00050 00051 // Whoa, possible dependence on static initialization here. This 00052 // function is called during initialization of the statics above. 00053 // But, ACE_Time_Value::zero is a static object. Very fortunately, 00054 // its bits have a value of 0. 00055 if (this->timeout_ != ACE_Time_Value::zero) 00056 ACE_SET_BITS (this->options_, ACE_Synch_Options::USE_TIMEOUT); 00057 00058 this->arg_ = arg; 00059 } |
|
Returns the address of the timeout 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 90 of file Synch_Options.cpp. References ACE_TRACE, and USE_TIMEOUT. Referenced by ACE_Token_Proxy::handle_options(), and ACE_Name_Proxy::open().
00091 { 00092 ACE_TRACE ("ACE_Synch_Options::time_value"); 00093 return (*this)[USE_TIMEOUT] ? &this->timeout_ : 0; 00094 } |
|
Set the ACE_Time_Value.
Definition at line 83 of file Synch_Options.cpp. References ACE_TRACE.
|
|
Returns a reference to the ACE_Time_Value. This value only makes sense if (*this)[USE_TIMEOUT] is true. Definition at line 76 of file Synch_Options.cpp. References ACE_TRACE. Referenced by ACE_Token_Request::dump().
|
|
Declare the dynamic allocation hooks.
Definition at line 133 of file Synch_Options.h. |
|
"Magic cookie" always passed in as an argument to the ACE_Reactor's method. Used to communicate values for asynchronous programming. Definition at line 147 of file Synch_Options.h. |
|
This is the default asynchronous setting.
|
|
This is the default setting for options, which will block synchronously. Definition at line 26 of file Synch_Options.cpp. |
|
Keeps track of the enabled options.
Definition at line 137 of file Synch_Options.h. Referenced by operator=(), operator[](), and set(). |
|
This is the default synchronous setting.
Definition at line 29 of file Synch_Options.cpp. |
|
Amount of time to wait for timeouts.
Definition at line 140 of file Synch_Options.h. |