GENIEGenerator
Loading...
Searching...
No Matches
RegistryItem.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::RegistryItem
5
6\brief A templated concrete implementation of the RegistryItemI interface.
7 Provides an arbitrary basic type (bool, int, double, string) value
8 for RegistryI-type containers.
9
10\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
11 University of Liverpool
12
13\created May 06, 2004
14
15\cpright Copyright (c) 2003-2025, The GENIE Collaboration
16 For the full text of the license visit http://copyright.genie-mc.org
17*/
18//____________________________________________________________________________
19
20#ifndef _REGISTRY_ITEM_H_
21#define _REGISTRY_ITEM_H_
22
23#include <map>
24#include <string>
25#include <ostream>
26
29
30namespace genie {
31
32template<typename T> class RegistryItem;
33template<typename T>
34 ostream & operator << (ostream & stream, const RegistryItem<T> & rec);
35
36template<typename T> class RegistryItem : public RegistryItemI {
37
38public:
40 RegistryItem(T item, bool locked=false, bool local=true);
41 RegistryItem(const RegistryItem * ri);
43
44 RegistryItemI * Clone (void) const;
45 RgType_t TypeInfo (void) const;
46 const T & Data (void) const { return fItem; }
47 bool IsLocked (void) const { return fIsLocked; }
48 void Lock (void) { fIsLocked = true; }
49 void UnLock (void) { fIsLocked = false; }
50 bool IsLocal (void) const { return fIsLocal; }
51 void SetLocal (bool isloc) { fIsLocal = isloc; }
52
53 void Print(ostream& stream) const;
54
55 friend ostream & operator <<
56 <T>(ostream & stream, const RegistryItem<T> & rec);
57
58private:
59
63};
64
65} // genie namespace
66
67#endif // _REGISTRY_ITEM_H_
Registry item pABC.
A templated concrete implementation of the RegistryItemI interface. Provides an arbitrary basic type ...
bool IsLocked(void) const
RgType_t TypeInfo(void) const
void Print(ostream &stream) const
const T & Data(void) const
void SetLocal(bool isloc)
RegistryItemI * Clone(void) const
bool IsLocal(void) const
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
enum genie::ERgType RgType_t
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)