ardour
Public Member Functions | Private Attributes | List of all members
RCUWriter< T > Class Template Reference

#include <rcu.h>

Public Member Functions

 RCUWriter (RCUManager< T > &manager)
 
 ~RCUWriter ()
 
boost::shared_ptr< T > get_copy () const
 

Private Attributes

RCUManager< T > & m_manager
 
boost::shared_ptr< T > m_copy
 

Detailed Description

template<class T>
class RCUWriter< T >

RCUWriter is a convenience object that implements write_copy/update via lifetime management. Creating the object obtains a writable copy, which can be obtained via the get_copy() method; deleting the object will update the manager's copy. Code doing a write/update thus looks like:

{

 RCUWriter writer (object_manager);
 boost::shared_ptr<T> copy = writer.get_copy();
 ... modify copy ...

} <= writer goes out of scope, update invoked

Definition at line 217 of file rcu.h.

Constructor & Destructor Documentation

template<class T>
RCUWriter< T >::RCUWriter ( RCUManager< T > &  manager)
inline

Definition at line 221 of file rcu.h.

template<class T>
RCUWriter< T >::~RCUWriter ( )
inline

Definition at line 226 of file rcu.h.

Member Function Documentation

template<class T>
boost::shared_ptr<T> RCUWriter< T >::get_copy ( ) const
inline

Definition at line 250 of file rcu.h.

Member Data Documentation

template<class T>
boost::shared_ptr<T> RCUWriter< T >::m_copy
private

Definition at line 254 of file rcu.h.

template<class T>
RCUManager<T>& RCUWriter< T >::m_manager
private

Definition at line 253 of file rcu.h.


The documentation for this class was generated from the following file: