25 #ifndef WSHAREDOBJECTTICKETREAD_H
26 #define WSHAREDOBJECTTICKETREAD_H
29 #include <boost/shared_ptr.hpp>
32 #include "WCondition.h"
33 #include "WSharedObjectTicket.h"
39 template <
typename Data >
61 const Data&
get()
const
74 WSharedObjectTicketRead( Data& data, boost::shared_ptr< boost::shared_mutex > mutex, boost::shared_ptr< WCondition > condition ):
76 m_lock( boost::shared_lock< boost::shared_mutex >( *mutex ) )
83 boost::shared_lock< boost::shared_mutex >
m_lock;
96 #endif // WSHAREDOBJECTTICKETREAD_H
boost::shared_lock< boost::shared_mutex > m_lock
The lock.
WSharedObjectTicketRead(Data &data, boost::shared_ptr< boost::shared_mutex > mutex, boost::shared_ptr< WCondition > condition)
Create a new instance.
Wrapper around an object/type for thread safe sharing of objects among multiple threads.
virtual void unlock()
Unlocks the mutex.
virtual ~WSharedObjectTicketRead()
Destroys the ticket and releases the lock.
Class which represents granted access to a locked object.
Class which represents granted access to a locked object.