Removed ACE_HAS_BSTRING, not used
[ACE_TAO.git] / ACE / ace / Null_Condition.h
bloba86e0c54bec280e8aa66f09ce6650e674eef5113
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Null_Condition.h
7 * Moved from Synch.h.
9 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
11 //==========================================================================
13 #ifndef ACE_NULL_CONDITION_H
14 #define ACE_NULL_CONDITION_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Null_Mutex.h"
18 #include "ace/Condition_T.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/os_include/os_errno.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 class ACE_Time_Value;
29 class ACE_Condition_Attributes;
30 template <class MUTEX> class ACE_Condition;
32 /**
33 * @brief ACE_Condition template specialization written using
34 * ACE_Null_Mutexes. Implements a do nothing ACE_Condition
35 * specialization, i.e., all methods are no ops.
37 template <>
38 class ACE_Condition<ACE_Null_Mutex>
40 public:
41 ACE_Condition (const ACE_Null_Mutex &m,
42 const ACE_TCHAR * = 0,
43 void * = 0)
44 : mutex_ ((ACE_Null_Mutex &) m) {}
46 ACE_Condition (const ACE_Null_Mutex &m,
47 const ACE_Condition_Attributes &,
48 const ACE_TCHAR * = 0,
49 void * = 0)
50 : mutex_ ((ACE_Null_Mutex &) m) {}
52 ~ACE_Condition (void) {}
54 /// Returns 0.
55 int remove (void) {return 0;}
57 /// Returns -1 with @c errno == @c ETIME.
58 int wait (const ACE_Time_Value * = 0) {errno = ETIME; return -1;}
60 /// Returns -1 with @c errno == @c ETIME.
61 int wait (ACE_Null_Mutex &,
62 const ACE_Time_Value * = 0) {errno = ETIME; return -1;}
64 /// Returns 0.
65 int signal (void) {return 0;}
67 /// Returns 0.
68 int broadcast (void) {return 0;}
69 ACE_Null_Mutex &mutex (void) {return this->mutex_;};
71 /// Dump the state of an object.
72 void dump (void) const {}
74 // ACE_ALLOC_HOOK_DECLARE;
75 // Declare the dynamic allocation hooks.
77 protected:
78 ACE_Null_Mutex &mutex_; // Reference to mutex lock.
80 private:
81 // = Prevent assignment and initialization.
82 void operator= (const ACE_Condition<ACE_Null_Mutex> &);
83 ACE_Condition (const ACE_Condition<ACE_Null_Mutex> &);
86 typedef ACE_Condition<ACE_Null_Mutex> ACE_Null_Condition;
88 ACE_END_VERSIONED_NAMESPACE_DECL
90 #include /**/ "ace/post.h"
91 #endif /* ACE_NULL_CONDITION_H */