Home | C-Bits Package Documentation | Project Page |
#include <TempLock.h>
Collaboration diagram for cbits::TempLock:
Public Methods | |
TempLock (Lockable *l) | |
Constructor. More... | |
~TempLock () | |
Destructor. More... | |
operator Lockable * () | |
Type conversion operator. More... | |
operator Lockable & () | |
Type conversion operator. More... | |
Lockable & | get () |
Accessor for the embedded object. More... | |
Private Attributes | |
Lockable * | _lk |
The embedded object. More... |
The embedded object's interface must support a lock and unlock method.
For instance:
class A { public: void lock(); void unlock(); // ... }; // ... A a; { // create new scope; TempLock<A> locked_a(a); // 'a' is now 'locked' // ... } // end scope // 'a' is now unlocked.
|
Constructor. Locks the embedded object.
|
|
Destructor. Unlocks the embedded object. |
|
Accessor for the embedded object.
|
|
Type conversion operator. Allows TempLock instance to be passed in calls that take a reference to the embedded object's type. |
|
Type conversion operator. Allows TempLock instance to be passed in calls that take an pointer to embedded object's type. |
|
The embedded object.
|
|
|