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

Synch_Options.cpp

Go to the documentation of this file.
00001 #include "ace_pch.h"
00002 // $Id: Synch_Options.cpp,v 1.1.1.3.40.1 2003/03/13 19:44:22 chad Exp $
00003 
00004 #include "ace/Synch_Options.h"
00005 
00006 #if !defined (__ACE_INLINE__)
00007 #include "ace/Synch_Options.i"
00008 #endif /* __ACE_INLINE__ */
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 // Static initialization.
00021 // Note: these three objects require static construction and destruction.
00022 
00023 /* static */
00024 ACE_Synch_Options ACE_Synch_Options::defaults;
00025 
00026 /* static */
00027 ACE_Synch_Options ACE_Synch_Options::synch;
00028 
00029 /* static */
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   // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options");
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   // 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 }
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 }

Generated on Mon Jun 16 11:21:40 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002