Ardour  9.0-pre0-582-g084a23a80d
RCUWriter< T > Class Template Reference

#include <rcu.h>

Public Member Functions

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

Private Attributes

RCUManager< T > & _manager
 
std::shared_ptr< T > _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);
std::shared_ptr<T> copy = writer.get_copy();
... modify copy ...
} <= writer goes out of scope, update invoked
Definition: rcu.h:297

Definition at line 296 of file rcu.h.

Constructor & Destructor Documentation

◆ RCUWriter()

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

Definition at line 299 of file rcu.h.

◆ ~RCUWriter()

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

Definition at line 305 of file rcu.h.

Member Function Documentation

◆ get_copy()

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

Definition at line 329 of file rcu.h.

Member Data Documentation

◆ _copy

template<class T >
std::shared_ptr<T> RCUWriter< T >::_copy
private

Definition at line 336 of file rcu.h.

◆ _manager

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

Definition at line 335 of file rcu.h.


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