EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairRegistry Class Reference

#include <EicRoot/blob/master/dbase/dbInterface/FairRegistry.h>

+ Inheritance diagram for FairRegistry:
+ Collaboration diagram for FairRegistry:

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 ()
 
FairRegistryoperator= (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
 

Detailed Description

Definition at line 16 of file FairRegistry.h.

View newest version in sPHENIX GitHub at line 16 of file FairRegistry.h

Member Typedef Documentation

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

Constructor & Destructor Documentation

FairRegistry::FairRegistry ( bool  readonly = true)
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().

+ Here is the call graph for this function:

FairRegistry::~FairRegistry ( )
virtual

Definition at line 197 of file FairRegistry.cxx.

View newest version in sPHENIX GitHub at line 197 of file FairRegistry.cxx

References fMap.

Member Function Documentation

virtual void FairRegistry::Browse ( TBrowser *  )
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>>().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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.

bool FairRegistry::IsDirty ( )
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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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.

virtual bool FairRegistry::KeysLocked ( void  ) const
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>>().

+ Here is the caller graph for this function:

virtual void FairRegistry::LockKeys ( void  )
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>>().

+ Here is the caller graph for this function:

virtual void FairRegistry::LockValues ( void  )
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().

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

ostream & FairRegistry::PrettyPrint ( std::ostream &  os) const
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairRegistry::Print ( Option_t *  option = "") const
virtual

Definition at line 191 of file FairRegistry.cxx.

View newest version in sPHENIX GitHub at line 191 of file FairRegistry.cxx

References PrettyPrint().

+ Here is the call graph for this function:

std::ostream & FairRegistry::PrintStream ( std::ostream &  os) const
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<<().

+ Here is the caller graph for this function:

std::istream & FairRegistry::ReadStream ( std::istream &  is)
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>>().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

bool FairRegistry::Set ( const char *  key,
int  i 
)
bool FairRegistry::Set ( const char *  key,
double  d 
)
bool FairRegistry::Set ( const char *  key,
FairRegistry  r 
)
void FairRegistry::SetDirty ( bool  is_dirty = true)
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().

+ Here is the caller graph for this function:

void FairRegistry::SetErrorHandler ( ErrorHandler  eh)
inline

Definition at line 81 of file FairRegistry.h.

View newest version in sPHENIX GitHub at line 81 of file FairRegistry.h

References fErrorHandler.

unsigned int FairRegistry::Size ( ) const
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().

+ Here is the caller graph for this function:

virtual void FairRegistry::UnLockKeys ( void  )
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>>().

+ Here is the caller graph for this function:

virtual void FairRegistry::UnLockValues ( void  )
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().

+ Here is the caller graph for this function:

virtual bool FairRegistry::ValuesLocked ( void  ) const
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>>().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class FairRegistryKey
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().

Member Data Documentation

bool FairRegistry::fDirty
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().

ErrorHandler FairRegistry::fErrorHandler
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().

bool FairRegistry::fKeysLocked
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().

bool FairRegistry::fValuesLocked
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().


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