AliPhysics  0937c79 (0937c79)
PWG::EMCAL::AliEmcalTrackSelResultUserPtr Class Reference

Handler for user objects attached to the track selection result ptr. More...

#include <AliEmcalTrackSelResultPtr.h>

Inheritance diagram for PWG::EMCAL::AliEmcalTrackSelResultUserPtr:

Public Member Functions

 AliEmcalTrackSelResultUserPtr ()
 Dummy constructor. More...
 
 AliEmcalTrackSelResultUserPtr (TObject *o)
 Main constructor setting the data. More...
 
 AliEmcalTrackSelResultUserPtr (const AliEmcalTrackSelResultUserPtr &ref)
 Copy constructor. More...
 
 AliEmcalTrackSelResultUserPtr (AliEmcalTrackSelResultUserPtr &&ref)
 Move constructor. More...
 
AliEmcalTrackSelResultUserPtroperator= (const AliEmcalTrackSelResultUserPtr &ref)
 Assignment operator. More...
 
AliEmcalTrackSelResultUserPtroperator= (AliEmcalTrackSelResultUserPtr &&ref)
 Move assignment operator. More...
 
virtual ~AliEmcalTrackSelResultUserPtr ()
 Destructor. More...
 
TObjectGetData () const
 Get the object handled by the storage. More...
 

Private Attributes

AliEmcalTrackSelResultUserStoragefUserStorage
 Underlying user storage for reference counting. More...
 

Detailed Description

Handler for user objects attached to the track selection result ptr.

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

Handling the lifetime of the object attached to the AliEmcalTrackSelResultPtr using reference counting technique. Pointer instances created from the current pointer using the copy constructor or assignment operator connect to the common storage and disconnect once they are constructed. The last instance connected to a storage deletes it.

This class is foreseen to be used only from within AliEmcalTrackSelResultPtr.

Definition at line 140 of file AliEmcalTrackSelResultPtr.h.

Constructor & Destructor Documentation

AliEmcalTrackSelResultUserPtr::AliEmcalTrackSelResultUserPtr ( )

Dummy constructor.

Not handling object

Definition at line 183 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserPtr::AliEmcalTrackSelResultUserPtr ( TObject o)

Main constructor setting the data.

Allocating the storage for the data hanlding and initializes the reference count

Parameters
oObject to be handled by the user pointer

Definition at line 190 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserPtr::AliEmcalTrackSelResultUserPtr ( const AliEmcalTrackSelResultUserPtr ref)

Copy constructor.

Creating a new pointer instance connected to the same storage

Parameters
refReference for the copy

Definition at line 197 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserPtr::AliEmcalTrackSelResultUserPtr ( AliEmcalTrackSelResultUserPtr &&  ref)

Move constructor.

Only transferring the storage, has no consequence on the reference count

Parameters
refObject to be moved

Definition at line 207 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserPtr::~AliEmcalTrackSelResultUserPtr ( )
virtual

Destructor.

Disconnects pointer instance from the common storage. If it is the last pointer instance conneted to the storage deletes the storage as well.

Definition at line 253 of file AliEmcalTrackSelResultPtr.cxx.

Member Function Documentation

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

Get the object handled by the storage.

Returns
User object handled by the pointer if storage exists, nullptr otherwise

Definition at line 212 of file AliEmcalTrackSelResultPtr.h.

Referenced by PWG::EMCAL::AliEmcalTrackSelResultPtr::PrintStream().

AliEmcalTrackSelResultUserPtr & AliEmcalTrackSelResultUserPtr::operator= ( const AliEmcalTrackSelResultUserPtr ref)

Assignment operator.

Connecting pointer instance to the storage connected to by ref. In case the pointer handles a storage itself disconnects from the storage

Parameters
refReference for assignment
Returns
Pointer instance after assignment

Definition at line 218 of file AliEmcalTrackSelResultPtr.cxx.

AliEmcalTrackSelResultUserPtr & AliEmcalTrackSelResultUserPtr::operator= ( AliEmcalTrackSelResultUserPtr &&  ref)

Move assignment operator.

Connecting pointer instance to the storage connected to by ref. In case the pointer handles a storage itself disconnects from the storage

Parameters
refObject to be moved
Returns
Pointer instance after move

Definition at line 235 of file AliEmcalTrackSelResultPtr.cxx.

Member Data Documentation

AliEmcalTrackSelResultUserStorage* PWG::EMCAL::AliEmcalTrackSelResultUserPtr::fUserStorage
private

Underlying user storage for reference counting.

Definition at line 215 of file AliEmcalTrackSelResultPtr.h.

Referenced by AliEmcalTrackSelResultUserPtr(), operator=(), and ~AliEmcalTrackSelResultUserPtr().


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