ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Athena::RCUUpdater< T > Class Template Reference

Implementation of Updater for RCUSvc. More...

#include <RCUUpdater.h>

Collaboration diagram for Athena::RCUUpdater< T >:

Public Types

typedef EventContext Context_t
 Execution context type. More...
 

Public Member Functions

template<typename... Args>
 RCUUpdater (IRCUSvc &rcusvc, Args &&... args)
 Constructor. More...
 
void update (std::unique_ptr< T > p, const Context_t &ctx)
 Install a new object. More...
 
const T & get () const
 Return a reference to the current object. More...
 
void quiescent (const Context_t &ctx)
 Mark that an event slot is not referencing this object. More...
 
void discard (std::unique_ptr< T > p)
 Queue an object for later deletion. More...
 

Static Public Member Functions

static const Context_tdefaultContext ()
 Return the current event context. More...
 

Private Attributes

RCUObject< T > m_obj
 The managed object. More...
 

Detailed Description

template<class T>
class Athena::RCUUpdater< T >

Implementation of Updater for RCUSvc.

This is an implementation of the Updater interface defined in CxxUtils/ConcurrentRangeMap.h using RCUSvc.

This uses RCUObject to manage an instance of type T.

Definition at line 38 of file RCUUpdater.h.

Member Typedef Documentation

◆ Context_t

template<class T >
typedef EventContext Athena::RCUUpdater< T >::Context_t

Execution context type.

Definition at line 42 of file RCUUpdater.h.

Constructor & Destructor Documentation

◆ RCUUpdater()

template<class T >
template<typename... Args>
Athena::RCUUpdater< T >::RCUUpdater ( IRCUSvc rcusvc,
Args &&...  args 
)

Constructor.

Parameters
rcusvcRCU service instance.
argsAdditional arguments to pass to the T constructor.

Creates a new instance of T.

Member Function Documentation

◆ defaultContext()

template<class T >
static const Context_t& Athena::RCUUpdater< T >::defaultContext ( )
static

Return the current event context.

◆ discard()

template<class T >
void Athena::RCUUpdater< T >::discard ( std::unique_ptr< T >  p)

Queue an object for later deletion.

Parameters
pThe object to delete.

The object p will be queued for deletion once a grace period has passed for all slots. In contrast to using update, this does not change the current object. It also does not mark the current slot as having completed the grace period (so this can be called by a thread running outside of a slot context).

◆ get()

template<class T >
const T& Athena::RCUUpdater< T >::get ( ) const

Return a reference to the current object.

◆ quiescent()

template<class T >
void Athena::RCUUpdater< T >::quiescent ( const Context_t ctx)

Mark that an event slot is not referencing this object.

◆ update()

template<class T >
void Athena::RCUUpdater< T >::update ( std::unique_ptr< T >  p,
const Context_t ctx 
)

Install a new object.

Parameters
pThe new object to install.
ctxCurrent execution context.

The existing object should not be deleted until it can no longer be referenced by any thread.

Member Data Documentation

◆ m_obj

template<class T >
RCUObject<T> Athena::RCUUpdater< T >::m_obj
private

The managed object.

Definition at line 100 of file RCUUpdater.h.


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