|
Robot Raconteur Core C++ Library
|
Wrapper for RobotRaconteurNode::MonitorEnter() and RobotRaconteurNode::MonitorExit() to take advantage of RAII scoping. More...
#include <RobotRaconteurNode.h>
Public Member Functions | |
| boost::shared_ptr< RobotRaconteurNode > | GetNode () |
| Get the Node associated with the lock. | |
| ScopedMonitorLock (const boost::shared_ptr< RRObject > &obj, int32_t timeout=-1) | |
| Create a monitor lock for the specified object. | |
| void | lock (int32_t timeout=-1) |
| Relock the object after calling unlock(). | |
| void | unlock () |
| Releases the monitor lock. | |
| void | release () |
| Release the monitor lock from the class. | |
Wrapper for RobotRaconteurNode::MonitorEnter() and RobotRaconteurNode::MonitorExit() to take advantage of RAII scoping.
| RobotRaconteur::RobotRaconteurNode::ScopedMonitorLock::ScopedMonitorLock | ( | const boost::shared_ptr< RRObject > & | obj, |
| int32_t | timeout = -1 ) |
Create a monitor lock for the specified object.
Creates a monitor lock by calling RobotRaconteur::MonitorEnter(). Object will be locked once the object is created.
| obj | The object to monitor lock |
| timeout | The timeout in milliseconds to acquire the monitor lock, or RR_TIMEOUT_INFINITE |
| boost::shared_ptr< RobotRaconteurNode > RobotRaconteur::RobotRaconteurNode::ScopedMonitorLock::GetNode | ( | ) |
Get the Node associated with the lock.
| void RobotRaconteur::RobotRaconteurNode::ScopedMonitorLock::lock | ( | int32_t | timeout = -1 | ) |
Relock the object after calling unlock().
| timeout | The timeout in milliseconds to acquire the monitor lock, or RR_TIMEOUT_INFINITE |
| void RobotRaconteur::RobotRaconteurNode::ScopedMonitorLock::release | ( | ) |
Release the monitor lock from the class.
The monitor lock is released from the ScopedMonitorLock instance. The monitor lock will not be released by the ScopedMonitorLock destructor.
| void RobotRaconteur::RobotRaconteurNode::ScopedMonitorLock::unlock | ( | ) |
Releases the monitor lock.
The ScopedMonitorLock destructor will release the lock automatically, so in most cases it is not necessary to call this function