1 #include "ace/Synch_Options.h"
3 #include "ace/Global_Macros.h"
4 #include "ace/config-all.h"
8 "$Id: Synch_Options.cpp 80826 2008-03-04 14:51:23Z wotte $")
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 ACE_ALLOC_HOOK_DEFINE (ACE_Synch_Options
)
15 ACE_Synch_Options::dump (void) const
17 #if defined (ACE_HAS_DUMP)
18 ACE_TRACE ("ACE_Synch_Options::dump");
19 #endif /* ACE_HAS_DUMP */
22 // Static initialization.
23 // Note: these three objects require static construction and destruction.
26 ACE_Synch_Options
ACE_Synch_Options::defaults
;
29 ACE_Synch_Options
ACE_Synch_Options::synch
;
32 ACE_Synch_Options
ACE_Synch_Options::asynch (ACE_Synch_Options::USE_REACTOR
);
34 ACE_Synch_Options::ACE_Synch_Options (unsigned long options
,
35 const ACE_Time_Value
&timeout
,
38 // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options");
39 this->set (options
, timeout
, arg
);
43 ACE_Synch_Options::set (unsigned long options
,
44 const ACE_Time_Value
&timeout
,
47 // ACE_TRACE ("ACE_Synch_Options::set");
48 this->options_
= options
;
49 this->timeout_
= timeout
;
51 // Whoa, possible dependence on static initialization here. This
52 // function is called during initialization of the statics above.
53 // But, ACE_Time_Value::zero is a static object. Very fortunately,
54 // its bits have a value of 0.
55 if (this->timeout_
!= ACE_Time_Value::zero
)
56 ACE_SET_BITS (this->options_
, ACE_Synch_Options::USE_TIMEOUT
);
62 ACE_Synch_Options::operator[] (unsigned long option
) const
64 ACE_TRACE ("ACE_Synch_Options::operator[]");
65 return (this->options_
& option
) != 0;
69 ACE_Synch_Options::operator= (unsigned long option
)
71 ACE_TRACE ("ACE_Synch_Options::operator=");
72 this->options_
|= option
;
75 const ACE_Time_Value
&
76 ACE_Synch_Options::timeout (void) const
78 ACE_TRACE ("ACE_Synch_Options::timeout");
79 return this->timeout_
;
83 ACE_Synch_Options::timeout (const ACE_Time_Value
&tv
)
85 ACE_TRACE ("ACE_Synch_Options::timeout");
89 const ACE_Time_Value
*
90 ACE_Synch_Options::time_value (void) const
92 ACE_TRACE ("ACE_Synch_Options::time_value");
93 return (*this)[USE_TIMEOUT
] ? &this->timeout_
: 0;
97 ACE_Synch_Options::arg (void) const
99 ACE_TRACE ("ACE_Synch_Options::arg");
104 ACE_Synch_Options::arg (const void *a
)
106 ACE_TRACE ("ACE_Synch_Options::arg");
110 ACE_END_VERSIONED_NAMESPACE_DECL