Go to the documentation of this file.
16 #ifndef SURGSIM_DATASTRUCTURES_BUFFEREDVALUE_H
17 #define SURGSIM_DATASTRUCTURES_BUFFEREDVALUE_H
21 #include <boost/thread.hpp>
26 namespace DataStructures
56 std::shared_ptr<const T>
safeGet()
const;
59 typedef boost::shared_lock<boost::shared_mutex>
SharedLock;
60 typedef boost::unique_lock<boost::shared_mutex>
UniqueLock;
boost::shared_mutex m_mutex
The mutex used to lock for reading and writing.
Definition: BufferedValue.h:69
T & unsafeGet()
Get the value.
Definition: BufferedValue-inl.h:53
std::shared_ptr< const T > m_safeValue
The buffered value.
Definition: BufferedValue.h:66
Definition: CompoundShapeToGraphics.cpp:29
void publish()
Make the current value the one returned by calls to safeGet.
Definition: BufferedValue-inl.h:43
~BufferedValue()
Destructor.
Definition: BufferedValue-inl.h:38
boost::unique_lock< boost::shared_mutex > UniqueLock
Definition: BufferedValue.h:60
T m_value
The raw value.
Definition: BufferedValue.h:63
boost::shared_lock< boost::shared_mutex > SharedLock
Definition: BufferedValue.h:59
BufferedValue is a class to enable a representation of two values for one variable,...
Definition: BufferedValue.h:33
BufferedValue()
Definition: BufferedValue-inl.h:25
std::shared_ptr< const T > safeGet() const
Get the buffered value.
Definition: BufferedValue-inl.h:59