summaryrefslogtreecommitdiff
path: root/ace/Synch_Options.h
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-01 22:17:39 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-01 22:17:39 +0000
commit53284e215e3d3351a7d7e9c4b68f14b427fb4377 (patch)
tree97236ece363cff48fd287c780db4290da39b02cb /ace/Synch_Options.h
parent7b7c52ad2abd228138ba1a948d5e28bf6dc3b880 (diff)
downloadATCD-53284e215e3d3351a7d7e9c4b68f14b427fb4377.tar.gz
ChangeLogTag:Wed Nov 1 14:11:48 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'ace/Synch_Options.h')
-rw-r--r--ace/Synch_Options.h159
1 files changed, 82 insertions, 77 deletions
diff --git a/ace/Synch_Options.h b/ace/Synch_Options.h
index 5ce8d3f9b96..2c7bf196607 100644
--- a/ace/Synch_Options.h
+++ b/ace/Synch_Options.h
@@ -1,18 +1,15 @@
/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// ace
-//
-// = FILENAME
-// ACE_Synch_Options.h
-//
-// = AUTHOR
-// Doug Schmidt
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file ACE_Synch_Options.h
+ *
+ * $Id$
+ *
+ * @author Doug Schmidt
+ */
+//=============================================================================
+
#ifndef ACE_SYNCH_OPTIONS_H
#define ACE_SYNCH_OPTIONS_H
@@ -24,121 +21,129 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+/**
+ * @class ACE_Synch_Options
+ *
+ * @brief 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"):
+ *
+ * <CODE>
+ * | 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)
+ * </CODE>
+ */
class ACE_Export ACE_Synch_Options
{
- // = TITLE
- // Contains the values of options used to determine the
- // synchronous and asynchronous behavior.
- //
- // = DESCRIPTION
- // Values support the following behavior (TV == "timeout"
- // and UR == "use ACE_Reactor"):
- //
- // = BEGIN<CODE>
- // 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)
- // = END<CODE>
public:
- // = Options flags for controlling synchronization. Note that these
- // flags can be bit-wise "or'd" together if both options are
- // desired.
+ /// Options flags for controlling synchronization.
+ /**
+ * Note that these flags can be bit-wise "or'd" together if both
+ * options are desired.
+ */
enum
{
+ /// Use the Reactor.
USE_REACTOR = 01,
- // Use the Reactor.
+ /// Interprete the Time_Value.
USE_TIMEOUT = 02
- // Interprete the Time_Value.
};
// = Initialization methods.
+ /// Initialize the Synch_Options based on parameters.
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.
+ /// Default dtor.
~ACE_Synch_Options (void);
- // Default dtor.
+ /// Initialize the Synch_Options based on parameters.
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.
+ /// Get method for determining which options are enabled.
int operator[] (u_long option) const;
- // Get method for determining which options are enabled.
+ /// Set method for enabling certain options.
void operator= (u_long option);
- // Set method for enabling certain options.
+ /// Returns the "magic cookie" argument.
const void *arg (void) const;
- // Returns the "magic cookie" argument.
+ /// Set the "magic cookie" argument.
void arg (const void *);
- // Set the "magic cookie" argument.
+ /// Returns a reference to the <Time_Value>. This value only makes
+ /// sense if (*this)[USE_TIMEOUT] is true.
const ACE_Time_Value &timeout (void) const;
- // Returns a reference to the <Time_Value>. This value only makes
- // sense if (*this)[USE_TIMEOUT] is true.
+ /// Set the <Time_Value>.
void timeout (const ACE_Time_Value &tv);
- // Set the <Time_Value>.
+ /**
+ * 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...
+ */
const ACE_Time_Value *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...
// = Static data members (singletons)
+ /// This is the default setting for options, which will block
+ /// synchronously.
static ACE_Synch_Options defaults;
- // This is the default setting for options, which will block
- // synchronously.
+ /// This is the default synchronous setting.
static ACE_Synch_Options synch;
- // This is the default synchronous setting.
+ /// This is the default asynchronous setting.
static ACE_Synch_Options asynch;
- // This is the default asynchronous setting.
+ /// Dump the state of an object.
void dump (void) const;
- // Dump the state of an object.
+ /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
- // Declare the dynamic allocation hooks.
private:
+ /// Keeps track of the enabled options.
u_long options_;
- // Keeps track of the enabled options.
+ /// Amount of time to wait for timeouts.
ACE_Time_Value timeout_;
- // Amount of time to wait for timeouts.
+ /**
+ * "Magic cookie" always passed in as an argument to the ACE_Reactor's
+ * <schedule_timer> method. Used to communicate values for
+ * asynchronous programming.
+ */
const void *arg_;
- // "Magic cookie" always passed in as an argument to the ACE_Reactor's
- // <schedule_timer> method. Used to communicate values for
- // asynchronous programming.
};
#if defined (__ACE_INLINE__)