*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
|
||||
//==========================================================================
|
||||
/**
|
||||
* @file Synch_Options.h
|
||||
@@ -8,15 +9,22 @@
|
||||
* @author Douglas C. Schmidt <[email protected]>
|
||||
*/
|
||||
//==========================================================================
|
||||
|
||||
#ifndef ACE_SYNCH_OPTIONS_H
|
||||
#define ACE_SYNCH_OPTIONS_H
|
||||
|
||||
#include /**/ "ace/pre.h"
|
||||
|
||||
#include /**/ "ace/ACE_export.h"
|
||||
|
||||
#if !defined (ACE_LACKS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif /* ACE_LACKS_PRAGMA_ONCE */
|
||||
|
||||
#include "ace/Time_Value.h"
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
/**
|
||||
* @class ACE_Synch_Options
|
||||
*
|
||||
@@ -60,6 +68,7 @@ public:
|
||||
/// Use the supplied timeout value.
|
||||
USE_TIMEOUT = 02
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the object to default values unless specified otherwise.
|
||||
*
|
||||
@@ -79,49 +88,66 @@ public:
|
||||
ACE_Synch_Options (unsigned long options = 0,
|
||||
const ACE_Time_Value &timeout = ACE_Time_Value::zero,
|
||||
const void *arg = 0);
|
||||
|
||||
/// Initialize the object; arguments are the same as for the
|
||||
/// constructor.
|
||||
void set (unsigned long options = 0,
|
||||
const ACE_Time_Value &timeout = ACE_Time_Value::zero,
|
||||
const void *arg = 0);
|
||||
|
||||
/// Returns true if the specified option(s) are enabled, false otherwise.
|
||||
bool operator[] (unsigned long option) const;
|
||||
|
||||
/// Adds the specified option(s) to the object; does not replace them.
|
||||
void operator= (unsigned long option);
|
||||
|
||||
/// Returns the "magic cookie" argument.
|
||||
const void *arg (void) const;
|
||||
|
||||
/// Set the "magic cookie" argument.
|
||||
void arg (const void *);
|
||||
|
||||
/// Returns a reference to the ACE_Time_Value. This value only makes
|
||||
/// sense if (*this)[USE_TIMEOUT] is true.
|
||||
const ACE_Time_Value &timeout (void) const;
|
||||
|
||||
/// Set the timeout value. This method does not alter the options; in
|
||||
/// particular, it doesn't add USE_TIMEOUT to the options when a non-zero
|
||||
/// timeout is specified as the constructor and set() do.
|
||||
void timeout (const ACE_Time_Value &tv);
|
||||
|
||||
/**
|
||||
* Returns a timeout pointer 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;
|
||||
|
||||
// = Static data members (singletons)
|
||||
|
||||
/// This is the default setting for options, which will block
|
||||
/// synchronously.
|
||||
static ACE_Synch_Options defaults;
|
||||
|
||||
/// This is the default synchronous setting.
|
||||
static ACE_Synch_Options synch;
|
||||
|
||||
/// This is the default asynchronous setting.
|
||||
static ACE_Synch_Options asynch;
|
||||
|
||||
/// Dump the state of an object.
|
||||
void dump (void) const;
|
||||
|
||||
/// Declare the dynamic allocation hooks.
|
||||
ACE_ALLOC_HOOK_DECLARE;
|
||||
|
||||
private:
|
||||
/// Keeps track of the enabled options.
|
||||
unsigned long options_;
|
||||
|
||||
/// Amount of time to wait for timeouts.
|
||||
ACE_Time_Value timeout_;
|
||||
|
||||
/**
|
||||
* "Magic cookie" always passed in as an argument to the ACE_Reactor's
|
||||
* schedule_timer() method. Used to communicate values for
|
||||
@@ -129,7 +155,10 @@ private:
|
||||
*/
|
||||
const void *arg_;
|
||||
};
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
#include /**/ "ace/post.h"
|
||||
|
||||
#endif /* ACE_SYNCH_OPTIONS_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user