A registry. Provides the container for algorithm configuration parameters. More...
Public Member Functions | |
Registry () | |
Registry (string name, bool isReadOnly=true) | |
Registry (const Registry &) | |
virtual | ~Registry () |
Registry & | operator= (const Registry ®) |
Registry & | operator+= (const Registry ®) |
void | operator() (RgKey key, int item) |
void | operator() (RgKey key, bool item) |
void | operator() (RgKey key, double item) |
void | operator() (RgKey key, const char *item) |
void | operator() (RgKey key, string item) |
void | Lock (void) |
locks the registry More... | |
void | UnLock (void) |
unlocks the registry (doesn't unlock items) More... | |
bool | IsLocked (void) const |
checks registry lock More... | |
void | InhibitItemLocks (void) |
override individual item locks More... | |
void | RestoreItemLocks (void) |
restore individual item locks More... | |
bool | ItemLocksAreActive (void) const |
check if item locks are active More... | |
void | LockItem (RgKey key) |
locks the registry item More... | |
void | UnLockItem (RgKey key) |
unlocks the registry item More... | |
bool | ItemIsLocked (RgKey key) const |
check item lock More... | |
bool | ItemIsLocal (RgKey key) const |
local or global? More... | |
void | OverrideGlobalDef (RgKey key) |
let item override global default (i.e. a 'local' item) More... | |
void | LinkToGlobalDef (RgKey key) |
link its value to a global default (i.e. a 'global' item) More... | |
void | Set (RgIMapPair entry) |
void | Set (RgKey key, RgBool item) |
void | Set (RgKey key, RgInt item) |
void | Set (RgKey key, RgDbl item) |
void | Set (RgKey key, RgStr item) |
void | Set (RgKey key, RgAlg item) |
void | Set (RgKey key, RgCChAr item) |
void | Set (RgKey key, RgH1F item) |
void | Set (RgKey key, RgH2F item) |
void | Set (RgKey key, RgTree item) |
void | Get (RgKey key, const RegistryItemI *&item) const |
void | Get (RgKey key, RgBool &item) const |
void | Get (RgKey key, RgInt &item) const |
void | Get (RgKey key, RgDbl &item) const |
void | Get (RgKey key, RgStr &item) const |
void | Get (RgKey key, RgAlg &item) const |
void | Get (RgKey key, RgH1F &item) const |
void | Get (RgKey key, RgH2F &item) const |
void | Get (RgKey key, RgTree &item) const |
RgBool | GetBool (RgKey key) const |
RgInt | GetInt (RgKey key) const |
RgDbl | GetDouble (RgKey key) const |
RgStr | GetString (RgKey key) const |
RgAlg | GetAlg (RgKey key) const |
RgH1F | GetH1F (RgKey key) const |
RgH2F | GetH2F (RgKey key) const |
RgTree | GetTree (RgKey key) const |
RgBool | GetBoolDef (RgKey key, RgBool def_opt, bool set_def=true) |
RgInt | GetIntDef (RgKey key, RgInt def_opt, bool set_def=true) |
RgDbl | GetDoubleDef (RgKey key, RgDbl def_opt, bool set_def=true) |
RgStr | GetStringDef (RgKey key, RgStr def_opt, bool set_def=true) |
RgAlg | GetAlgDef (RgKey key, RgAlg def_opt, bool set_def=true) |
RgIMapConstIter | SafeFind (RgKey key) const |
int | NEntries (void) const |
get number of items More... | |
bool | Exists (RgKey key) const |
item with input key exists? More... | |
bool | CanSetItem (RgKey key) const |
can I set the specifed item? More... | |
bool | DeleteEntry (RgKey key) |
delete the spcified item More... | |
void | SetName (string name) |
set the registry name More... | |
string | Name (void) const |
get the registry name More... | |
void | Print (ostream &stream) const |
print the registry to stream More... | |
void | Copy (const Registry &) |
copy the input registry More... | |
void | Append (const Registry &, RgKey pfx="") |
append the input registry. Entries already in the registry are not updated More... | |
void | Merge (const Registry &, RgKey pfx="") |
append the input registry. Entries already in the registry are updated More... | |
void | Clear (bool force=false) |
clear the registry More... | |
void | Init (void) |
initialize the registry More... | |
RgType_t | ItemType (RgKey key) const |
return item type More... | |
RgKeyList | FindKeys (RgKey key_part) const |
create list with all keys containing 'key_part' More... | |
const RgIMap & | GetItemMap (void) const |
void | CopyToFolder (TFolder *folder) const |
void | AssertExistence (RgKey key0) const |
void | AssertExistence (RgKey key0, RgKey key1) const |
void | AssertExistence (RgKey key0, RgKey key1, RgKey key2) const |
Private Member Functions | |
RegistryItemI * | CloneRegistryItem (const RgKey &key) const |
Properly clone a registry Item according to its type. More... | |
Private Attributes | |
string | fName |
registry's name More... | |
bool | fIsReadOnly |
is read only? More... | |
bool | fInhibitItemLocks |
RgIMap | fRegistry |
'key' -> 'value' map More... | |
Friends | |
ostream & | operator<< (ostream &stream, const Registry ®istry) |
A registry. Provides the container for algorithm configuration parameters.
May 04, 2004
Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE
Definition at line 66 of file Registry.h.
Registry::Registry | ( | ) |
Registry::Registry | ( | string | name, |
bool | isReadOnly = true |
||
) |
Definition at line 105 of file Registry.cxx.
Registry::Registry | ( | const Registry & | registry | ) |
Definition at line 113 of file Registry.cxx.
References Copy().
|
virtual |
append the input registry. Entries already in the registry are not updated
Definition at line 758 of file Registry.cxx.
References genie::RgType::AsString(), CloneRegistryItem(), fRegistry, InhibitItemLocks(), IsLocked(), LOG, Name(), pERROR, pINFO, pWARN, and moon_position_table_new3::second.
Referenced by Copy(), and operator+=().
Definition at line 617 of file Registry.cxx.
References Exists(), exit(), LOG, Name(), pERROR, and pFATAL.
Referenced by AssertExistence(), and GetItemMap().
bool Registry::CanSetItem | ( | RgKey | key | ) | const |
can I set the specifed item?
Definition at line 271 of file Registry.cxx.
References IsLocked(), ItemIsLocked(), and ItemLocksAreActive().
Referenced by Set().
void Registry::Clear | ( | bool | force = false | ) |
clear the registry
Definition at line 879 of file Registry.cxx.
References fRegistry, IsLocked(), LOG, Name(), pINFO, and pWARN.
Referenced by Copy(), and ~Registry().
|
private |
Properly clone a registry Item according to its type.
Definition at line 905 of file Registry.cxx.
References genie::RgType::AsString(), exit(), fRegistry, GetAlg(), GetBool(), GetDouble(), GetH1F(), GetH2F(), GetInt(), GetString(), GetTree(), histo, genie::RegistryItemI::IsLocked(), it, genie::kRgAlg, genie::kRgBool, genie::kRgDbl, genie::kRgH1F, genie::kRgH2F, genie::kRgInt, genie::kRgStr, genie::kRgTree, LOG, Name(), pDEBUG, pERROR, pFATAL, moon_position_table_new3::second, compareCafs::tree, and genie::RegistryItemI::TypeInfo().
Referenced by Append(), GetItemMap(), and Merge().
copy the input registry
Definition at line 737 of file Registry.cxx.
References Append(), Clear(), fInhibitItemLocks, fIsReadOnly, fName, Init(), IsLocked(), LOG, Name(), pINFO, and pWARN.
Referenced by main(), operator=(), and Registry().
void Registry::CopyToFolder | ( | TFolder * | folder | ) | const |
Definition at line 641 of file Registry.cxx.
References genie::RgType::AsString(), RgAlg::config, HTMLTools::entry(), fRegistry, GetAlg(), GetBool(), GetDouble(), GetInt(), GetString(), findDuplicateFiles::key, genie::kRgAlg, genie::kRgBool, genie::kRgDbl, genie::kRgH1F, genie::kRgH2F, genie::kRgInt, genie::kRgStr, genie::kRgTree, LOG, RgAlg::name, pINFO, and genie::RegistryItemI::TypeInfo().
Referenced by GetItemMap(), and genie::NtpMCJobConfig::Load().
bool Registry::DeleteEntry | ( | RgKey | key | ) |
delete the spcified item
Definition at line 584 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fIsReadOnly, and fRegistry.
Referenced by Set().
bool Registry::Exists | ( | RgKey | key | ) | const |
item with input key exists?
Definition at line 578 of file Registry.cxx.
References HTMLTools::entry(), and fRegistry.
Referenced by AssertExistence(), DeleteEntry(), genie::utils::config::GetDoubleKeyPDG(), genie::utils::config::GetDoubleKeyRangeNucA(), genie::GetValueOrUseDefault(), ItemIsLocal(), ItemIsLocked(), LinkToGlobalDef(), LockItem(), OverrideGlobalDef(), and UnLockItem().
create list with all keys containing 'key_part'
Definition at line 855 of file Registry.cxx.
References fRegistry, and findDuplicateFiles::key.
Referenced by genie::Decayer::LoadConfig(), and main().
void Registry::Get | ( | RgKey | key, |
const RegistryItemI *& | item | ||
) | const |
Definition at line 340 of file Registry.cxx.
References HTMLTools::entry(), and SafeFind().
Referenced by CheckUnitarityLimit(), GetAlg(), GetBool(), GetDouble(), GetInt(), GetString(), genie::GetValueOrUseDefault(), and main().
Definition at line 346 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, and SafeFind().
Definition at line 362 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, and SafeFind().
Definition at line 378 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, and SafeFind().
Definition at line 394 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, and SafeFind().
Definition at line 410 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, and SafeFind().
Definition at line 427 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 443 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 459 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), findDuplicateFiles::key, LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 503 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::IBDXSecMap::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::PauliBlocker::LoadModelType(), and genie::utils::nuclear::NuclQELXSecSuppression().
Definition at line 560 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Definition at line 475 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), genie::Decayer::LoadConfig(), and main().
Definition at line 540 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), and main().
Definition at line 489 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), genie::GVldContext::Decode(), genie::KPhaseSpace::GetTMaxDFR(), genie::NewQELXSec::Integrate(), and main().
Definition at line 550 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), genie::utils::config::GetDoubleKeyPDG(), genie::utils::config::GetDoubleKeyRangeNucA(), and main().
Definition at line 510 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), and fRegistry.
Referenced by CloneRegistryItem().
Definition at line 520 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), and fRegistry.
Referenced by CloneRegistryItem().
Definition at line 482 of file Registry.cxx.
References Get().
Referenced by genie::EventGeneratorListAssembler::AssembleGeneratorList(), CloneRegistryItem(), CopyToFolder(), and main().
Definition at line 545 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by main().
Definition at line 162 of file Registry.h.
References AssertExistence(), CloneRegistryItem(), CopyToFolder(), PandAna.Demos.tute_pid_validation::folder, and fRegistry.
Referenced by genie::Algorithm::ExtractLocalConfig(), genie::Algorithm::ExtractLowerConfig(), genie::Algorithm::FindConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::NuclearModelMap::LoadConfig(), and genie::SmithMonizUtils::LoadConfig().
Definition at line 496 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::Algorithm::FindConfig(), genie::NewQELXSec::Integrate(), and genie::P33PaschosLalakulichPXSec::XSec().
Definition at line 555 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Definition at line 530 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), HTMLTools::entry(), and fRegistry.
Referenced by CloneRegistryItem().
override individual item locks
Definition at line 178 of file Registry.cxx.
References fInhibitItemLocks.
Referenced by Append(), main(), and Merge().
initialize the registry
Definition at line 870 of file Registry.cxx.
References fInhibitItemLocks, fIsReadOnly, and fName.
Referenced by Copy(), and Registry().
bool Registry::IsLocked | ( | void | ) | const |
checks registry lock
Definition at line 173 of file Registry.cxx.
References fIsReadOnly.
Referenced by Append(), CanSetItem(), Clear(), Copy(), genie::GetValueOrUseDefault(), and Merge().
bool Registry::ItemIsLocal | ( | RgKey | key | ) | const |
local or global?
Definition at line 193 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fRegistry, LOG, and pDEBUG.
Referenced by genie::Algorithm::FindConfig(), and genie::GetValueOrUseDefault().
bool Registry::ItemIsLocked | ( | RgKey | key | ) | const |
check item lock
Definition at line 233 of file Registry.cxx.
References HTMLTools::entry(), Exists(), and fRegistry.
Referenced by CanSetItem(), and genie::SetRegistryItem().
bool Registry::ItemLocksAreActive | ( | void | ) | const |
check if item locks are active
Definition at line 188 of file Registry.cxx.
References fInhibitItemLocks.
Referenced by CanSetItem().
return item type
Definition at line 844 of file Registry.cxx.
References fRegistry, genie::kRgUndefined, and genie::RegistryItemI::TypeInfo().
Referenced by main().
link its value to a global default (i.e. a 'global' item)
Definition at line 221 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fRegistry, LOG, and pWARN.
Referenced by genie::GetValueOrUseDefault().
locks the registry
Definition at line 163 of file Registry.cxx.
References fIsReadOnly.
Referenced by genie::GetValueOrUseDefault(), genie::AlgConfigPool::LoadRegistries(), and main().
locks the registry item
Definition at line 249 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fRegistry, LOG, and pWARN.
Referenced by main().
append the input registry. Entries already in the registry are updated
Definition at line 802 of file Registry.cxx.
References genie::RgType::AsString(), CloneRegistryItem(), fRegistry, InhibitItemLocks(), IsLocked(), LOG, Name(), pINFO, pWARN, and moon_position_table_new3::second.
get the registry name
Definition at line 612 of file Registry.cxx.
References fName.
Referenced by Append(), AssertExistence(), Clear(), CloneRegistryItem(), genie::Algorithm::Configure(), Copy(), genie::Algorithm::ExtractLocalConfig(), genie::Algorithm::ExtractLowerConfig(), Merge(), Print(), and SafeFind().
get number of items
Definition at line 597 of file Registry.cxx.
References fRegistry.
Referenced by genie::Algorithm::Configure().
Definition at line 135 of file Registry.cxx.
References findDuplicateFiles::key, operator()(), and Set().
Definition at line 157 of file Registry.cxx.
References Append().
Definition at line 151 of file Registry.cxx.
References Copy().
let item override global default (i.e. a 'local' item)
Definition at line 209 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fRegistry, LOG, and pWARN.
void Registry::Print | ( | ostream & | stream | ) | const |
print the registry to stream
Definition at line 694 of file Registry.cxx.
References genie::RgType::AsString(), allTimeWatchdog::endl, fInhibitItemLocks, fIsReadOnly, fRegistry, findDuplicateFiles::key, LOG, Name(), pDEBUG, pERROR, genie::RegistryItemI::Print(), string, and genie::RegistryItemI::TypeInfo().
Referenced by genie::operator<<().
restore individual item locks
Definition at line 183 of file Registry.cxx.
References fInhibitItemLocks.
RgIMapConstIter Registry::SafeFind | ( | RgKey | key | ) | const |
Definition at line 565 of file Registry.cxx.
References HTMLTools::entry(), exit(), fRegistry, genie::gAbortingInErr, LOG, Name(), and pFATAL.
Referenced by Get().
void Registry::Set | ( | RgIMapPair | entry | ) |
Definition at line 282 of file Registry.cxx.
References CanSetItem(), DeleteEntry(), fRegistry, findDuplicateFiles::key, LOG, and pWARN.
Referenced by genie::AlgConfigPool::AddBasicParameter(), genie::AlgConfigPool::AddRootObjParameter(), genie::HadronTransporter::Configure(), genie::EmpiricalMECPXSec2015::Configure(), genie::QPMDISPXSec::Configure(), genie::QPMDMDISPXSec::Configure(), genie::SmithMonizQELCCXSec::Configure(), genie::QELEventGeneratorSM::Configure(), genie::SmithMonizQELCCPXSec::Configure(), genie::NuclearModelMap::Configure(), genie::GetValueOrUseDefault(), IncrementCoefficients(), main(), operator()(), Set(), genie::SetRegistryItem(), and testReconfigInCommonPool().
Definition at line 294 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 299 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 304 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 315 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 320 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 325 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 330 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 335 of file Registry.cxx.
References genie::SetRegistryItem().
set the registry name
Definition at line 603 of file Registry.cxx.
References fIsReadOnly, fName, LOG, and pWARN.
Referenced by genie::AlgConfigPool::LoadRegistries().
unlocks the registry (doesn't unlock items)
Definition at line 168 of file Registry.cxx.
References fIsReadOnly.
Referenced by genie::GetValueOrUseDefault(), main(), and testReconfigInCommonPool().
unlocks the registry item
Definition at line 260 of file Registry.cxx.
References HTMLTools::entry(), Exists(), fRegistry, LOG, and pWARN.
|
friend |
Definition at line 92 of file Registry.cxx.
|
private |
Definition at line 183 of file Registry.h.
Referenced by Copy(), InhibitItemLocks(), Init(), ItemLocksAreActive(), Print(), and RestoreItemLocks().
|
private |
is read only?
Definition at line 182 of file Registry.h.
Referenced by Copy(), DeleteEntry(), Init(), IsLocked(), Lock(), Print(), SetName(), and UnLock().
|
private |
|
private |
'key' -> 'value' map
Definition at line 184 of file Registry.h.
Referenced by Append(), Clear(), CloneRegistryItem(), CopyToFolder(), DeleteEntry(), Exists(), FindKeys(), GetH1F(), GetH2F(), GetItemMap(), GetTree(), ItemIsLocal(), ItemIsLocked(), ItemType(), LinkToGlobalDef(), LockItem(), Merge(), NEntries(), OverrideGlobalDef(), Print(), SafeFind(), Set(), and UnLockItem().