AliPhysics  8d00e07 (8d00e07)
PWG::EMCAL::AliEmcalTrackSelResultUserStorage Class Reference

Helper class handling the lifetime of the user object handled by AliEmcalTrackSelResultUserPtr. More...

#include <AliEmcalTrackSelResultPtr.h>

Inheritance diagram for PWG::EMCAL::AliEmcalTrackSelResultUserStorage:

Public Member Functions

 AliEmcalTrackSelResultUserStorage ()
 
 AliEmcalTrackSelResultUserStorage (TObject *data)
 Main constructor. More...
 
void Connect ()
 Connect new user pointer instance to the storage. More...
 
void Release ()
 Release user pointer from the storage. More...
 
Int_t GetReferenceCount () const
 Get the number of pointer instances connected to the storage. More...
 
TObjectGetData () const
 Get the user data handled by the storage. More...
 

Protected Member Functions

virtual ~AliEmcalTrackSelResultUserStorage ()
 Destructor. More...
 

Private Member Functions

 AliEmcalTrackSelResultUserStorage (const AliEmcalTrackSelResultUserStorage &)
 
 AliEmcalTrackSelResultUserStorage (const AliEmcalTrackSelResultUserStorage &&)
 
AliEmcalTrackSelResultUserStorageoperator= (const AliEmcalTrackSelResultUserStorage &)
 
AliEmcalTrackSelResultUserStorageoperator= (const AliEmcalTrackSelResultUserStorage &&)
 

Private Attributes

TObjectfData
 User data. More...
 
Int_t fReferenceCount
 Reference counter. More...
 

Detailed Description

Helper class handling the lifetime of the user object handled by AliEmcalTrackSelResultUserPtr.

Author
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch, Oak Ridge National Laboratory
Since
Dec 11, 2017

Common storage class for multiple instances of AliEmcalTrackSelResultUserPointers. Together with the data the storage keeps track of the number of pointer instances connected to it via the reference count. Instances can connect and disconnect by the functions Connect and Release.

This class is foreseen to be used only from within AliEmcalTrackSelResultUserPtr. It is a suicide object which kills itself once it goes out-of-scope.

Definition at line 54 of file AliEmcalTrackSelResultPtr.h.

Constructor & Destructor Documentation

AliEmcalTrackSelResultUserStorage::AliEmcalTrackSelResultUserStorage ( )

Definition at line 148 of file AliEmcalTrackSelResultPtr.cxx.

Referenced by GetData().

AliEmcalTrackSelResultUserStorage::AliEmcalTrackSelResultUserStorage ( TObject data)

Main constructor.

Sets the data and the reference count to 1

Parameters
data

Definition at line 156 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserStorage::~AliEmcalTrackSelResultUserStorage ( )
protectedvirtual

Destructor.

Deletes the data associated to the storage. Only to be used from within AliEmcalTrackSelResultUserPtr

Definition at line 163 of file AliEmcalTrackSelResultPtr.cxx.

Referenced by GetData().

PWG::EMCAL::AliEmcalTrackSelResultUserStorage::AliEmcalTrackSelResultUserStorage ( const AliEmcalTrackSelResultUserStorage )
private
PWG::EMCAL::AliEmcalTrackSelResultUserStorage::AliEmcalTrackSelResultUserStorage ( const AliEmcalTrackSelResultUserStorage &&  )
private

Member Function Documentation

void AliEmcalTrackSelResultUserStorage::Connect ( )

Connect new user pointer instance to the storage.

Used in the copy constructor and assignment operator of AliEmcalTrackSelResultUserPtr. This function is there in order to tell then storage that a new user pointer instance has connected to the storage. Increases the reference count. Not to be used outside of class AliEmcalTrackSelResultUserPtr

Definition at line 168 of file AliEmcalTrackSelResultPtr.cxx.

Referenced by PWG::EMCAL::AliEmcalTrackSelResultUserPtr::AliEmcalTrackSelResultUserPtr(), and PWG::EMCAL::AliEmcalTrackSelResultUserPtr::operator=().

TObject* PWG::EMCAL::AliEmcalTrackSelResultUserStorage::GetData ( ) const
inline

Get the user data handled by the storage.

Returns
User data handled by the storage

Definition at line 100 of file AliEmcalTrackSelResultPtr.h.

Int_t PWG::EMCAL::AliEmcalTrackSelResultUserStorage::GetReferenceCount ( ) const
inline

Get the number of pointer instances connected to the storage.

Returns
Number of pointer instances connected to the storage

Definition at line 93 of file AliEmcalTrackSelResultPtr.h.

AliEmcalTrackSelResultUserStorage& PWG::EMCAL::AliEmcalTrackSelResultUserStorage::operator= ( const AliEmcalTrackSelResultUserStorage )
private

Referenced by GetData().

AliEmcalTrackSelResultUserStorage& PWG::EMCAL::AliEmcalTrackSelResultUserStorage::operator= ( const AliEmcalTrackSelResultUserStorage &&  )
private
void AliEmcalTrackSelResultUserStorage::Release ( )

Release user pointer from the storage.

Used in the destructor of AliEmcalTrackSelUserPtr. This function is there in order to tell the storage that a user pointer instance has disconnected. Reduces the reference count. Not to be called ountside of class AliEmcalTrackSelResultUserPtr.

Definition at line 172 of file AliEmcalTrackSelResultPtr.cxx.

Referenced by PWG::EMCAL::AliEmcalTrackSelResultUserPtr::operator=(), and PWG::EMCAL::AliEmcalTrackSelResultUserPtr::~AliEmcalTrackSelResultUserPtr().

Member Data Documentation

TObject* PWG::EMCAL::AliEmcalTrackSelResultUserStorage::fData
private

User data.

Definition at line 117 of file AliEmcalTrackSelResultPtr.h.

Referenced by GetData(), and ~AliEmcalTrackSelResultUserStorage().

Int_t PWG::EMCAL::AliEmcalTrackSelResultUserStorage::fReferenceCount
private

Reference counter.

Definition at line 118 of file AliEmcalTrackSelResultPtr.h.

Referenced by Connect(), GetReferenceCount(), and Release().


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