Guard.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef COIL_GUARD_H
21 #define COIL_GUARD_H
22 
23 #include <coil/Mutex.h>
24 
25 namespace coil
26 {
40  template <class M>
41  class Guard
42  {
43  public:
44 
64  Guard(M& mutex) : m_mutex(mutex)
65  {
66  m_mutex.lock();
67  }
68 
85  {
86  m_mutex.unlock();
87  }
88 
89  private:
90  Guard(const Guard&);
91  Guard& operator=(const Guard&);
92  M& m_mutex;
93  };
94 };
95 #endif // COIL_GUARD_H
M & m_mutex
Definition: Guard.h:92
Guard(M &mutex)
Constructor.
Definition: Guard.h:64
~Guard()
Destructor.
Definition: Guard.h:84
Guard & operator=(const Guard &)
Common Object Interface Layer.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:58