OpenDaVINCI  4.16.0
base/Condition.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_BASE_CONDITION_H_
21 #define OPENDAVINCI_CORE_BASE_CONDITION_H_
22 
24 #include <memory>
27 
28 namespace odcore {
29  namespace base {
30 
64  class OPENDAVINCI_API Condition : public Mutex {
65  private:
66  friend class Lock;
67 
73  Condition(const Condition&);
74 
80  Condition& operator=(const Condition &);
81 
82  public:
83  Condition();
84 
85  virtual ~Condition();
86 
91  void waitOnSignal();
92 
99  bool waitOnSignalWithTimeout(const unsigned long& ms);
100 
104  void wakeOne();
105 
110  void wakeAll();
111 
112  protected:
116  virtual void lock();
117 
123  virtual bool tryLock();
124 
128  virtual void unlock();
129 
130  private:
131  std::shared_ptr<wrapper::Condition> m_condition;
132  };
133 
134  }
135 } // odcore::base
136 
137 #endif /*OPENDAVINCI_CORE_BASE_CONDITION_H_*/
Definition: base/Condition.h:64
Definition: base/Mutex.h:49
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: Lock.h:46