GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TSingleton< T > Class Template Reference

template<class T>
class TSingleton< T >

This class is intended as a base class for singletons, especially those that are written to file. The Get() function is written such that it reads the class from file if needed. This is the case if it hasn't been read yet, or if the gDirectory has been changed. This means in a loop over different input files, Get() will always return the info of the current file.

Definition at line 31 of file TSingleton.h.

Static Public Member Functions

static T * AddCurrent ()
 
static T * Get (bool verbose=false)
 
static T * GetAll ()
 
static void PrintDirectory ()
 
static void Set (T *val)
 

Protected Member Functions

 TSingleton ()
 
 ~TSingleton ()
 

Static Private Attributes

static TDirectory * fDir = nullptr
 
static T * fSingleton = nullptr
 

#include <TSingleton.h>

+ Inheritance diagram for TSingleton< T >:
+ Collaboration diagram for TSingleton< T >:

Member Function Documentation

◆ AddCurrent()

template<class T>
static T* TSingleton< T >::AddCurrent ( )
inlinestatic

Definition at line 137 of file TSingleton.h.

◆ Get()

template<class T>
static T* TSingleton< T >::Get ( bool  verbose = false)
inlinestatic

◆ GetAll()

template<class T>
static T* TSingleton< T >::GetAll ( )
inlinestatic

Definition at line 62 of file TSingleton.h.

◆ PrintDirectory()

template<class T>
static void TSingleton< T >::PrintDirectory ( )
inlinestatic

Definition at line 166 of file TSingleton.h.

Referenced by TRunInfo::Print().

◆ Set()

template<class T>
static void TSingleton< T >::Set ( T *  val)
inlinestatic

Definition at line 129 of file TSingleton.h.

Referenced by TSingleton< TParsingDiagnostics >::Get().