00001 #include "ace_pch.h"
00002
00003
00004 #include "ace/Synch_Options.h"
00005
00006 #if !defined (__ACE_INLINE__)
00007 #include "ace/Synch_Options.i"
00008 #endif
00009
00010 ACE_RCSID(ace, Synch_Options, "$Id: Synch_Options.cpp,v 1.1.1.3.40.1 2003/03/13 19:44:22 chad Exp $")
00011
00012 ACE_ALLOC_HOOK_DEFINE(ACE_Synch_Options)
00013
00014 void
00015 ACE_Synch_Options::dump (void) const
00016 {
00017 ACE_TRACE ("ACE_Synch_Options::dump");
00018 }
00019
00020
00021
00022
00023
00024 ACE_Synch_Options ACE_Synch_Options::defaults;
00025
00026
00027 ACE_Synch_Options ACE_Synch_Options::synch;
00028
00029
00030 ACE_Synch_Options ACE_Synch_Options::asynch (ACE_Synch_Options::USE_REACTOR);
00031
00032 ACE_Synch_Options::ACE_Synch_Options (u_long options,
00033 const ACE_Time_Value &timeout,
00034 const void *arg)
00035 {
00036
00037 this->set (options, timeout, arg);
00038 }
00039
00040 void
00041 ACE_Synch_Options::set (u_long options,
00042 const ACE_Time_Value &timeout,
00043 const void *arg)
00044 {
00045
00046 this->options_ = options;
00047 this->timeout_ = (ACE_Time_Value &) timeout;
00048
00049
00050
00051
00052
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 }
00058
00059 int
00060 ACE_Synch_Options::operator[] (u_long option) const
00061 {
00062 ACE_TRACE ("ACE_Synch_Options::operator[]");
00063 return (this->options_ & option) != 0;
00064 }
00065
00066 void
00067 ACE_Synch_Options::operator= (u_long option)
00068 {
00069 ACE_TRACE ("ACE_Synch_Options::operator=");
00070 this->options_ |= option;
00071 }
00072
00073 const ACE_Time_Value &
00074 ACE_Synch_Options::timeout (void) const
00075 {
00076 ACE_TRACE ("ACE_Synch_Options::timeout");
00077 return this->timeout_;
00078 }
00079
00080 void
00081 ACE_Synch_Options::timeout (const ACE_Time_Value &tv)
00082 {
00083 ACE_TRACE ("ACE_Synch_Options::timeout");
00084 this->timeout_ = tv;
00085 }
00086
00087 const ACE_Time_Value *
00088 ACE_Synch_Options::time_value (void) const
00089 {
00090 ACE_TRACE ("ACE_Synch_Options::time_value");
00091 return (*this)[USE_TIMEOUT] ? &this->timeout_ : 0;
00092 }
00093
00094 const void *
00095 ACE_Synch_Options::arg (void) const
00096 {
00097 ACE_TRACE ("ACE_Synch_Options::arg");
00098 return this->arg_;
00099 }
00100
00101 void
00102 ACE_Synch_Options::arg (const void *a)
00103 {
00104 ACE_TRACE ("ACE_Synch_Options::arg");
00105 this->arg_ = a;
00106 }