EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <EicRoot/blob/master/dbase/dbInterface/FairRegistry.h>
Classes | |
class | FairRegistryKey |
Public Types | |
typedef std::map< std::string, FairRegistryItem * > | tRegMap |
typedef void(* | ErrorHandler )(void) |
Public Member Functions | |
FairRegistry (bool readonly=true) | |
FairRegistry (const FairRegistry &rhs) | |
Deep copy constructor. | |
virtual | ~FairRegistry () |
FairRegistry & | operator= (const FairRegistry &rhs) |
Deep assignment. | |
void | Merge (const FairRegistry &rhs) |
Copy rhs into this, respects this's locks. | |
unsigned int | Size () const |
Return number of entries. | |
bool | KeyExists (const char *key) const |
Check if key exists. | |
void | RemoveKey (const char *key) |
void | Clear (Option_t *option="") |
Clear Registry - deletes all items. | |
void | Dump (void) const |
Dump to cerr. | |
virtual std::ostream & | PrintStream (std::ostream &os) const |
Print to cout (without extraneous bits of Dump()). | |
virtual std::istream & | ReadStream (std::istream &is) |
virtual void | Print (Option_t *option="") const |
virtual std::ostream & | PrettyPrint (std::ostream &os) const |
virtual void | Browse (TBrowser *) |
virtual bool | ValuesLocked (void) const |
Control if an existing value can be set. | |
virtual void | LockValues (void) |
virtual void | UnLockValues (void) |
virtual bool | KeysLocked (void) const |
Control if new key/value pairs can be added. | |
virtual void | LockKeys (void) |
virtual void | UnLockKeys (void) |
void | SetDirty (bool is_dirty=true) |
bool | IsDirty () |
void | SetErrorHandler (ErrorHandler eh) |
bool | Get (const char *key, char &c) const |
bool | Get (const char *key, const char *&s) const |
bool | Get (const char *key, int &i) const |
bool | Get (const char *key, double &d) const |
bool | Get (const char *key, FairRegistry &r) const |
const std::type_info & | GetType (const char *key) const |
std::string | GetTypeAsString (const char *key) const |
Return "int", "double", "char", "string", "Registry" or "void". | |
std::string | GetValueAsString (const char *key) const |
see format.txt | |
char | GetChar (const char *key) const |
const char * | GetCharString (const char *key) const |
int | GetInt (const char *key) const |
double | GetDouble (const char *key) const |
FairRegistry | GetFairRegistry (const char *key) const |
bool | Set (const char *key, char c) |
bool | Set (const char *key, const char *s) |
bool | Set (const char *key, int i) |
bool | Set (const char *key, double d) |
bool | Set (const char *key, FairRegistry r) |
FairRegistryKey | Key (void) const |
Private Attributes | |
bool | fValuesLocked |
bool | fKeysLocked |
ErrorHandler | fErrorHandler |
tRegMap | fMap |
bool | fDirty |
Friends | |
class | FairRegistryKey |
not written out | |
Definition at line 16 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 16 of file FairRegistry.h
typedef void(* FairRegistry::ErrorHandler)(void) |
Definition at line 20 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 20 of file FairRegistry.h
typedef std::map<std::string,FairRegistryItem*> FairRegistry::tRegMap |
Definition at line 19 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 19 of file FairRegistry.h
|
explicit |
Create a Registry. If readonly is false, any key's value can be set multiple times, o.w. only the first setting is allowed. See methods below regarding locking of keys and values.
FairRegistry::FairRegistry | ( | const FairRegistry & | rhs | ) |
Deep copy constructor.
Definition at line 40 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 40 of file FairRegistry.cxx
References fMap, Key(), Acts::UnitConstants::s, and SetDirty().
|
virtual |
Definition at line 197 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 197 of file FairRegistry.cxx
References fMap.
|
inlinevirtual |
Definition at line 61 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 61 of file FairRegistry.h
void FairRegistry::Clear | ( | Option_t * | option = "" | ) |
Clear Registry - deletes all items.
Definition at line 127 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 127 of file FairRegistry.cxx
References fKeysLocked, fMap, fValuesLocked, and SetDirty().
Referenced by operator=(), and FairDbConfigStream::operator>>().
void FairRegistry::Dump | ( | void | ) | const |
Dump to cerr.
Definition at line 145 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 145 of file FairRegistry.cxx
References fKeysLocked, fMap, fValuesLocked, and Size().
bool FairRegistry::Get | ( | const char * | key, |
char & | c | ||
) | const |
Access a value. Return true and set second argument if key is found, else returns false.
Referenced by FairDbTableProxyRegistry::Config(), GetFairRegistry(), FairDbConfDialog::Query(), FairDbConf::RegistryToString(), FairDbRollbackDates::Set(), and FairDbSimFlagAssociation::Set().
bool FairRegistry::Get | ( | const char * | key, |
const char *& | s | ||
) | const |
bool FairRegistry::Get | ( | const char * | key, |
int & | i | ||
) | const |
bool FairRegistry::Get | ( | const char * | key, |
double & | d | ||
) | const |
Definition at line 341 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 341 of file FairRegistry.cxx
References fMap, and FairRegistryItemXxx< T >::Get().
bool FairRegistry::Get | ( | const char * | key, |
FairRegistry & | r | ||
) | const |
char FairRegistry::GetChar | ( | const char * | key | ) | const |
Access a value. Returns value if key lookup succeeds, else prints warning message. Use above Get() methods for a safer access method.
const char* FairRegistry::GetCharString | ( | const char * | key | ) | const |
double FairRegistry::GetDouble | ( | const char * | key | ) | const |
FairRegistry FairRegistry::GetFairRegistry | ( | const char * | key | ) | const |
Definition at line 387 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 387 of file FairRegistry.cxx
References fErrorHandler, and Get().
int FairRegistry::GetInt | ( | const char * | key | ) | const |
const type_info & FairRegistry::GetType | ( | const char * | key | ) | const |
Return the type_info of the value corresponding to the given key. If key doesn't exist, type_info for type void is returned.
Definition at line 403 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 403 of file FairRegistry.cxx
References fMap, and nlohmann::detail::void().
string FairRegistry::GetTypeAsString | ( | const char * | key | ) | const |
Return "int", "double", "char", "string", "Registry" or "void".
Definition at line 409 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 409 of file FairRegistry.cxx
References fMap.
string FairRegistry::GetValueAsString | ( | const char * | key | ) | const |
see format.txt
Definition at line 416 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 416 of file FairRegistry.cxx
References fMap.
|
inline |
Definition at line 78 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 78 of file FairRegistry.h
References fDirty.
Referenced by FairDbConfigurable::Update().
FairRegistry::FairRegistryKey FairRegistry::Key | ( | void | ) | const |
Definition at line 233 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 233 of file FairRegistry.cxx
References FairRegistryKey.
Referenced by FairRegistry(), Merge(), operator=(), FairDbConfDialog::Query(), and FairDbConf::RegistryToString().
bool FairRegistry::KeyExists | ( | const char * | key | ) | const |
Check if key exists.
Definition at line 113 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 113 of file FairRegistry.cxx
References fMap.
|
inlinevirtual |
Control if new key/value pairs can be added.
Definition at line 69 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 69 of file FairRegistry.h
References fKeysLocked.
Referenced by FairDbConfigStream::operator>>().
|
inlinevirtual |
Definition at line 70 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 70 of file FairRegistry.h
References fKeysLocked.
Referenced by FairDbConfigStream::operator>>().
|
inlinevirtual |
Definition at line 65 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 65 of file FairRegistry.h
References fValuesLocked.
Referenced by FairDbConfigStream::operator>>(), FairDbConfigurable::Set(), FairDbConfDialog::SetCurrent(), and FairDbConfDialog::SetDefault().
void FairRegistry::Merge | ( | const FairRegistry & | rhs | ) |
Copy rhs into this, respects this's locks.
Definition at line 83 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 83 of file FairRegistry.cxx
References Acts::Concepts::exists, fKeysLocked, fMap, fValuesLocked, Key(), Acts::UnitConstants::s, and SetDirty().
Referenced by FairDbConfigurable::Set().
FairRegistry & FairRegistry::operator= | ( | const FairRegistry & | rhs | ) |
Deep assignment.
Definition at line 59 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 59 of file FairRegistry.cxx
References Clear(), fKeysLocked, fMap, fValuesLocked, Key(), Acts::UnitConstants::s, SetDirty(), Size(), UnLockKeys(), and UnLockValues().
|
virtual |
Definition at line 165 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 165 of file FairRegistry.cxx
References fKeysLocked, fMap, fValuesLocked, and Size().
Referenced by Print().
|
virtual |
Definition at line 191 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 191 of file FairRegistry.cxx
References PrettyPrint().
|
virtual |
Print to cout (without extraneous bits of Dump()).
Definition at line 480 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 480 of file FairRegistry.cxx
References fMap.
Referenced by FairDbConfigStream::operator<<(), and operator<<().
|
virtual |
Definition at line 504 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 504 of file FairRegistry.cxx
References bail(), c, fMap, name, Util::read_quoted_string(), and FairRegistryItem::ReadStream().
Referenced by FairDbConfigStream::operator>>().
void FairRegistry::RemoveKey | ( | const char * | key | ) |
Definition at line 118 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 118 of file FairRegistry.cxx
References fMap, and SetDirty().
Referenced by FairDbTableProxyRegistry::Config(), FairDbRollbackDates::Set(), and FairDbSimFlagAssociation::Set().
bool FairRegistry::Set | ( | const char * | key, |
char | c | ||
) |
Set the value associated with the given key. Return false if locks prevent setting or if type mismatch.
Referenced by FairDbConfDialog::Query(), and FairDbConf::StringToRegistry().
bool FairRegistry::Set | ( | const char * | key, |
const char * | s | ||
) |
Definition at line 280 of file FairRegistry.cxx.
View newest version in sPHENIX GitHub at line 280 of file FairRegistry.cxx
References fKeysLocked, fMap, fValuesLocked, and SetDirty().
bool FairRegistry::Set | ( | const char * | key, |
int | i | ||
) |
bool FairRegistry::Set | ( | const char * | key, |
double | d | ||
) |
bool FairRegistry::Set | ( | const char * | key, |
FairRegistry | r | ||
) |
|
inline |
Access an internal "dirty" flag Registry maintains (but does not use) It will be set any time a non-const method is accessed, or explicitly via SetDirty(). Initially a Registry is dirty (original sin?).
Definition at line 77 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 77 of file FairRegistry.h
References fDirty.
Referenced by Clear(), FairRegistry(), Merge(), operator=(), RemoveKey(), Set(), and FairDbConfigurable::Update().
|
inline |
Definition at line 81 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 81 of file FairRegistry.h
References fErrorHandler.
|
inline |
Return number of entries.
Definition at line 39 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 39 of file FairRegistry.h
References fMap.
Referenced by Dump(), operator=(), and PrettyPrint().
|
inlinevirtual |
Definition at line 71 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 71 of file FairRegistry.h
References fKeysLocked.
Referenced by operator=(), and FairDbConfigStream::operator>>().
|
inlinevirtual |
Definition at line 66 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 66 of file FairRegistry.h
References fValuesLocked.
Referenced by operator=(), FairDbConfigStream::operator>>(), FairDbConfDialog::Query(), FairDbConfigurable::Set(), FairDbConfDialog::SetCurrent(), and FairDbConfDialog::SetDefault().
|
inlinevirtual |
Control if an existing value can be set.
Definition at line 64 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 64 of file FairRegistry.h
References fValuesLocked.
Referenced by FairDbConfigStream::operator>>().
|
friend |
not written out
Definition at line 148 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 148 of file FairRegistry.h
Referenced by Key().
|
private |
Definition at line 151 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 151 of file FairRegistry.h
Referenced by IsDirty(), and SetDirty().
|
private |
Definition at line 146 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 146 of file FairRegistry.h
Referenced by GetFairRegistry(), and SetErrorHandler().
|
private |
Definition at line 145 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 145 of file FairRegistry.h
Referenced by Clear(), Dump(), KeysLocked(), LockKeys(), Merge(), operator=(), PrettyPrint(), Set(), and UnLockKeys().
|
private |
Definition at line 149 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 149 of file FairRegistry.h
Referenced by Clear(), Dump(), FairRegistry(), FairRegistry::FairRegistryKey::FairRegistryKey(), Get(), GetType(), GetTypeAsString(), GetValueAsString(), KeyExists(), Merge(), operator=(), PrettyPrint(), PrintStream(), ReadStream(), RemoveKey(), Set(), Size(), and ~FairRegistry().
|
private |
Definition at line 144 of file FairRegistry.h.
View newest version in sPHENIX GitHub at line 144 of file FairRegistry.h
Referenced by Clear(), Dump(), LockValues(), Merge(), operator=(), PrettyPrint(), Set(), UnLockValues(), and ValuesLocked().