[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / Synch_Options.cpp
blobdc857e289ec3bb3ad3810f23307b28df3c5f8003
1 #include "ace/Synch_Options.h"
3 #include "ace/Global_Macros.h"
4 #include "ace/config-all.h"
6 ACE_RCSID (ace,
7 Synch_Options,
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)
14 void
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.
25 /* static */
26 ACE_Synch_Options ACE_Synch_Options::defaults;
28 /* static */
29 ACE_Synch_Options ACE_Synch_Options::synch;
31 /* static */
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,
36 const void *arg)
38 // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options");
39 this->set (options, timeout, arg);
42 void
43 ACE_Synch_Options::set (unsigned long options,
44 const ACE_Time_Value &timeout,
45 const void *arg)
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);
58 this->arg_ = arg;
61 bool
62 ACE_Synch_Options::operator[] (unsigned long option) const
64 ACE_TRACE ("ACE_Synch_Options::operator[]");
65 return (this->options_ & option) != 0;
68 void
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_;
82 void
83 ACE_Synch_Options::timeout (const ACE_Time_Value &tv)
85 ACE_TRACE ("ACE_Synch_Options::timeout");
86 this->timeout_ = tv;
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;
96 const void *
97 ACE_Synch_Options::arg (void) const
99 ACE_TRACE ("ACE_Synch_Options::arg");
100 return this->arg_;
103 void
104 ACE_Synch_Options::arg (const void *a)
106 ACE_TRACE ("ACE_Synch_Options::arg");
107 this->arg_ = a;
110 ACE_END_VERSIONED_NAMESPACE_DECL