GENIEGenerator
Loading...
Searching...
No Matches
genie::RegistryItem< T > Class Template Reference

A templated concrete implementation of the RegistryItemI interface. Provides an arbitrary basic type (bool, int, double, string) value for RegistryI-type containers. More...

#include <RegistryItem.h>

Inheritance diagram for genie::RegistryItem< T >:
[legend]
Collaboration diagram for genie::RegistryItem< T >:
[legend]

Public Member Functions

 RegistryItem ()
 RegistryItem (T item, bool locked=false, bool local=true)
 RegistryItem (const RegistryItem *ri)
 ~RegistryItem ()
RegistryItemIClone (void) const
RgType_t TypeInfo (void) const
const T & Data (void) const
bool IsLocked (void) const
void Lock (void)
void UnLock (void)
bool IsLocal (void) const
void SetLocal (bool isloc)
void Print (ostream &stream) const
 ~RegistryItem ()
 ~RegistryItem ()
 ~RegistryItem ()
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
RgType_t TypeInfo (void) const
void Print (ostream &stream) const
void Print (ostream &stream) const
void Print (ostream &stream) const
void Print (ostream &stream) const
Public Member Functions inherited from genie::RegistryItemI
virtual ~RegistryItemI ()

Private Attributes

fItem
bool fIsLocked
bool fIsLocal

Friends

ostream & operator<< (ostream &stream, const RegistryItem< T > &rec)

Additional Inherited Members

Protected Member Functions inherited from genie::RegistryItemI
 RegistryItemI ()

Detailed Description

template<typename T>
class genie::RegistryItem< T >

A templated concrete implementation of the RegistryItemI interface. Provides an arbitrary basic type (bool, int, double, string) value for RegistryI-type containers.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n May 06, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 36 of file RegistryItem.h.

Constructor & Destructor Documentation

◆ RegistryItem() [1/3]

template<typename T>
genie::RegistryItem< T >::RegistryItem ( )
inline

Definition at line 39 of file RegistryItem.h.

39{ };

Referenced by Clone(), operator<<, and RegistryItem().

◆ RegistryItem() [2/3]

template<typename T>
genie::RegistryItem< T >::RegistryItem ( T item,
bool locked = false,
bool local = true )

Definition at line 47 of file RegistryItem.cxx.

48{
49 fItem = item;
52}
A templated concrete implementation of the RegistryItemI interface. Provides an arbitrary basic type ...

References fIsLocal, fIsLocked, and fItem.

◆ RegistryItem() [3/3]

template<typename T>
genie::RegistryItem< T >::RegistryItem ( const RegistryItem< T > * ri)

Definition at line 54 of file RegistryItem.cxx.

55{
56 fItem = ri->fItem;
59}

References fIsLocal, fIsLocked, fItem, and RegistryItem().

◆ ~RegistryItem() [1/4]

template<typename T>
genie::RegistryItem< T >::~RegistryItem ( )

Definition at line 61 of file RegistryItem.cxx.

62{
63
64}

◆ ~RegistryItem() [2/4]

Definition at line 66 of file RegistryItem.cxx.

67{
68 if (fItem) delete fItem;
69}

References fItem.

◆ ~RegistryItem() [3/4]

Definition at line 71 of file RegistryItem.cxx.

72{
73 if (fItem) delete fItem;
74}

References fItem.

◆ ~RegistryItem() [4/4]

Definition at line 76 of file RegistryItem.cxx.

77{
78 if (fItem) delete fItem;
79}

References fItem.

Member Function Documentation

◆ Clone()

template<typename T>
RegistryItemI * genie::RegistryItem< T >::Clone ( void ) const
virtual

◆ Data()

◆ IsLocal()

template<typename T>
bool genie::RegistryItem< T >::IsLocal ( void ) const
inlinevirtual

Implements genie::RegistryItemI.

Definition at line 50 of file RegistryItem.h.

50{ return fIsLocal; }

References fIsLocal.

◆ IsLocked()

template<typename T>
bool genie::RegistryItem< T >::IsLocked ( void ) const
inlinevirtual

Implements genie::RegistryItemI.

Definition at line 47 of file RegistryItem.h.

47{ return fIsLocked; }

References fIsLocked.

◆ Lock()

template<typename T>
void genie::RegistryItem< T >::Lock ( void )
inlinevirtual

Implements genie::RegistryItemI.

Definition at line 48 of file RegistryItem.h.

48{ fIsLocked = true; }

References fIsLocked.

◆ Print() [1/5]

void genie::RegistryItem< RgAlg >::Print ( ostream & stream) const
virtual

Implements genie::RegistryItemI.

Definition at line 136 of file RegistryItem.cxx.

137{
138 stream << ((fIsLocked) ? "[ locked]" : "[unlocked]")
139 << " "
140 << ((fIsLocal) ? "[l]" : "[g]")
141 << " : "
142 << (fItem);
143}

References fIsLocal, fIsLocked, and fItem.

◆ Print() [2/5]

void genie::RegistryItem< RgH1F >::Print ( ostream & stream) const
virtual

Implements genie::RegistryItemI.

Definition at line 145 of file RegistryItem.cxx.

146{
147 TH1F * histo = dynamic_cast<TH1F *>(fItem);
148 if(!histo) stream << "*** NULL RgH1F ***";
149
150 stream << ((fIsLocked) ? "[ locked]" : "[unlocked]")
151 << " "
152 << ((fIsLocal) ? "[l]" : "[g]")
153 << " : "
154 << (histo ? histo->GetName() : "NULL");
155}

References fIsLocal, fIsLocked, and fItem.

◆ Print() [3/5]

void genie::RegistryItem< RgH2F >::Print ( ostream & stream) const
virtual

Implements genie::RegistryItemI.

Definition at line 157 of file RegistryItem.cxx.

158{
159 TH2F * histo = dynamic_cast<TH2F *>(fItem);
160 if(!histo) stream << "*** NULL RgH2F ***";
161
162 stream << ((fIsLocked) ? "[ locked]" : "[unlocked]")
163 << " "
164 << ((fIsLocal) ? "[l]" : "[g]")
165 << " : "
166 << (histo ? histo->GetName() : "NULL");
167}

References fIsLocal, fIsLocked, and fItem.

◆ Print() [4/5]

void genie::RegistryItem< RgTree >::Print ( ostream & stream) const
virtual

Implements genie::RegistryItemI.

Definition at line 169 of file RegistryItem.cxx.

170{
171 TTree * tree = dynamic_cast<TTree *>(fItem);
172 if(!tree) stream << "*** NULL RgTree ***";
173
174 stream << ((fIsLocked) ? "[ locked]" : "[unlocked]")
175 << " "
176 << ((fIsLocal) ? "[l]" : "[g]")
177 << " : "
178 << (tree ? tree->GetName() : "NULL");
179}

References fIsLocal, fIsLocked, and fItem.

◆ Print() [5/5]

template<typename T>
void genie::RegistryItem< T >::Print ( ostream & stream) const
virtual

Implements genie::RegistryItemI.

Definition at line 127 of file RegistryItem.cxx.

128{
129 stream << ((fIsLocked) ? "[ locked]" : "[unlocked]")
130 << " "
131 << ((fIsLocal) ? "[l]" : "[g]")
132 << " : "
133 << (fItem);
134}

References fIsLocal, fIsLocked, and fItem.

Referenced by operator<<.

◆ SetLocal()

template<typename T>
void genie::RegistryItem< T >::SetLocal ( bool isloc)
inlinevirtual

Implements genie::RegistryItemI.

Definition at line 51 of file RegistryItem.h.

51{ fIsLocal = isloc; }

References fIsLocal.

◆ TypeInfo() [1/9]

RgType_t genie::RegistryItem< RgBool >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 87 of file RegistryItem.cxx.

88{
89 return kRgBool;
90}

References genie::kRgBool.

◆ TypeInfo() [2/9]

RgType_t genie::RegistryItem< RgInt >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 92 of file RegistryItem.cxx.

93{
94 return kRgInt;
95}

References genie::kRgInt.

◆ TypeInfo() [3/9]

RgType_t genie::RegistryItem< RgDbl >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 97 of file RegistryItem.cxx.

98{
99 return kRgDbl;
100}

References genie::kRgDbl.

◆ TypeInfo() [4/9]

RgType_t genie::RegistryItem< RgStr >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 102 of file RegistryItem.cxx.

103{
104 return kRgStr;
105}

References genie::kRgStr.

◆ TypeInfo() [5/9]

RgType_t genie::RegistryItem< RgAlg >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 107 of file RegistryItem.cxx.

108{
109 return kRgAlg;
110}

References genie::kRgAlg.

◆ TypeInfo() [6/9]

RgType_t genie::RegistryItem< RgH1F >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 112 of file RegistryItem.cxx.

113{
114 return kRgH1F;
115}

References genie::kRgH1F.

◆ TypeInfo() [7/9]

RgType_t genie::RegistryItem< RgH2F >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 117 of file RegistryItem.cxx.

118{
119 return kRgH2F;
120}

References genie::kRgH2F.

◆ TypeInfo() [8/9]

RgType_t genie::RegistryItem< RgTree >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

Definition at line 122 of file RegistryItem.cxx.

123{
124 return kRgTree;
125}

References genie::kRgTree.

◆ TypeInfo() [9/9]

template<typename T>
RgType_t genie::RegistryItem< T >::TypeInfo ( void ) const
virtual

Implements genie::RegistryItemI.

◆ UnLock()

template<typename T>
void genie::RegistryItem< T >::UnLock ( void )
inlinevirtual

Implements genie::RegistryItemI.

Definition at line 49 of file RegistryItem.h.

49{ fIsLocked = false; }

References fIsLocked.

◆ operator<<

template<typename T>
ostream & operator<< ( ostream & stream,
const RegistryItem< T > & rec )
friend

Definition at line 40 of file RegistryItem.cxx.

41{
43 return stream;
44}
void Print(ostream &stream) const

References Print(), and RegistryItem().

Member Data Documentation

◆ fIsLocal

template<typename T>
bool genie::RegistryItem< T >::fIsLocal
private

Definition at line 62 of file RegistryItem.h.

Referenced by IsLocal(), Print(), RegistryItem(), RegistryItem(), and SetLocal().

◆ fIsLocked

template<typename T>
bool genie::RegistryItem< T >::fIsLocked
private

Definition at line 61 of file RegistryItem.h.

Referenced by Clone(), IsLocked(), Lock(), Print(), RegistryItem(), RegistryItem(), and UnLock().

◆ fItem

template<typename T>
T genie::RegistryItem< T >::fItem
private

Definition at line 60 of file RegistryItem.h.

Referenced by Clone(), Data(), Print(), RegistryItem(), RegistryItem(), and ~RegistryItem().


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