![]() |
AliPhysics
2b88e80 (2b88e80)
|
Helper class handling the lifetime of the user object handled by AliEmcalTrackSelResultUserPtr. More...
#include <AliEmcalTrackSelResultPtr.h>
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... | |
TObject * | GetData () 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 &&) | |
AliEmcalTrackSelResultUserStorage & | operator= (const AliEmcalTrackSelResultUserStorage &) |
AliEmcalTrackSelResultUserStorage & | operator= (const AliEmcalTrackSelResultUserStorage &&) |
Private Attributes | |
TObject * | fData |
User data. More... | |
Int_t | fReferenceCount |
Reference counter. More... | |
Helper class handling the lifetime of the user object handled by AliEmcalTrackSelResultUserPtr.
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.
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
data |
Definition at line 156 of file AliEmcalTrackSelResultPtr.cxx.
|
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().
|
private |
|
private |
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=().
|
inline |
Get the user data handled by the storage.
Definition at line 100 of file AliEmcalTrackSelResultPtr.h.
|
inline |
Get the number of pointer instances connected to the storage.
Definition at line 93 of file AliEmcalTrackSelResultPtr.h.
|
private |
Referenced by GetData().
|
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().
|
private |
User data.
Definition at line 117 of file AliEmcalTrackSelResultPtr.h.
Referenced by GetData(), and ~AliEmcalTrackSelResultUserStorage().
|
private |
Reference counter.
Definition at line 118 of file AliEmcalTrackSelResultPtr.h.
Referenced by Connect(), GetReferenceCount(), and Release().