ardour
Public Member Functions | Protected Attributes | List of all members
RCUManager< T > Class Template Referenceabstract

#include <rcu.h>

Inheritance diagram for RCUManager< T >:
SerializedRCUManager< T >

Public Member Functions

 RCUManager (T *new_rcu_value)
 
virtual ~RCUManager ()
 
boost::shared_ptr< T > reader () const
 
virtual boost::shared_ptr< T > write_copy ()=0
 
virtual bool update (boost::shared_ptr< T > new_value)=0
 

Protected Attributes

union {
   boost::shared_ptr< T > *   m_rcu_value
 
   volatile gpointer   gptr
 
x
 

Detailed Description

template<class T>
class RCUManager< T >

An RCUManager is an object which takes over management of a pointer to another object. It provides three key methods:

    - reader() : obtains a shared pointer to the managed object that may be used for reading, without synchronization
        - write_copy() : obtains a shared pointer to the object that may be used for writing/modification
        - update() : accepts a shared pointer to a (presumed) modified instance of the object and causes all
                     future reader() and write_copy() calls to use that instance.

Any existing users of the value returned by reader() can continue to use their copy even as a write_copy()/update() takes place. The RCU manager will manage the various instances of "the managed object" in a way that is transparent to users of the manager and managed object.

Definition at line 48 of file rcu.h.

Constructor & Destructor Documentation

template<class T>
RCUManager< T >::RCUManager ( T *  new_rcu_value)
inline

Definition at line 52 of file rcu.h.

template<class T>
virtual RCUManager< T >::~RCUManager ( )
inlinevirtual

Definition at line 56 of file rcu.h.

Member Function Documentation

template<class T>
boost::shared_ptr<T> RCUManager< T >::reader ( ) const
inline

Definition at line 58 of file rcu.h.

template<class T>
virtual bool RCUManager< T >::update ( boost::shared_ptr< T >  new_value)
pure virtual
template<class T>
virtual boost::shared_ptr<T> RCUManager< T >::write_copy ( )
pure virtual

Member Data Documentation

template<class T>
volatile gpointer RCUManager< T >::gptr
mutable

Definition at line 80 of file rcu.h.

template<class T>
boost::shared_ptr<T>* RCUManager< T >::m_rcu_value

Definition at line 79 of file rcu.h.

union { ... } RCUManager< T >::x

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