![]() |
Diana Software
|
template class to handle diana global QObject with QGlobalDataManager More...
Public Member Functions | |
| GlobalHandle (const std::string &name, const std::string &defaultOwner="") | |
| ctor More... | |
| GlobalHandle (const GlobalHandle< Q > &other) | |
| copy ctor More... | |
| virtual | ~GlobalHandle () |
| dtor More... | |
| const QGlobalLabel & | GetLabel () const |
| Get label. More... | |
| const std::string & | GetName () const |
| Get object name. More... | |
| const std::string & | GetOwner () const |
| Get object owner. More... | |
| const std::string & | GetDefaultOwner () const |
| Get default owner (may be set by inheriting classes) More... | |
| int | GetChannel () const |
| Get Channel associated to the object. More... | |
| int | GetChannel2 () const |
| Get Second Channel associated to the object. More... | |
| int | GetBeginRun () const |
| Get first run of validity. More... | |
| int | GetEndRun () const |
| Get last run of validity. More... | |
| int | GetRun () const |
| Get run of validity. More... | |
| int | GetBeginDataset () const |
| Get first dataset of validity. More... | |
| int | GetEndDataset () const |
| Get last dataset of validity. More... | |
| int | GetDataset () const |
| Get dataset of validity. More... | |
| void | GetValidityInterval (int &beginRun, int &endRun) const |
| Get run validity interval. More... | |
| void | SetChannel (const int chan) |
| Set Channel. More... | |
| void | SetChannel2 (const int chan) |
| Set Channel2. More... | |
| void | SetRunInterval (const int start, const int end) |
| Set Validity Interval. More... | |
| void | SetRun (const int run) |
| Set BeginRun = EndRun = run. More... | |
| void | SetDatasetInterval (const int start, const int end) |
| Set Dataset Validity Interval. More... | |
| void | SetDataset (const int ds) |
| Set dataset of validity. More... | |
| void | AddKey (const std::string &key, const int digits) |
| Add an extra integer key to the label. More... | |
| void | SetKey (const std::string &key, const int value) |
| Set extra integer key to value. More... | |
| int | GetKey (const std::string &key) const |
| Get extra integer key. More... | |
| bool | HaveKey (const std::string &key) const |
| void | Set (const Q &obj) |
| set the QObject More... | |
| const Q & | Get () const |
| get the QObject More... | |
| bool | IsValid () const |
| check QObject validity More... | |
| const QError & | GetError () const |
| Get I/O error. More... | |
| void | SetDescription (const std::string &descr) |
| set object description (experimental) More... | |
| virtual QError | FillFromFile (const std::string &fname) |
| fill QObject from file fname More... | |
| virtual QError | StoreOnFile (const std::string &fname) const |
| store object on file fname More... | |
| virtual QError | FillFromDB () |
| fill object from DB More... | |
| virtual QError | StoreOnDB () const |
| store object on DB More... | |
| virtual QError | StoreOnDB () |
| store object on DB, non const version More... | |
| std::string | GetVersion () const |
| Get version tag of the object, if any. More... | |
Protected Member Functions | |
| Q ** | GetAddress () |
| get object address More... | |
| Q **const | GetAddress () const |
| get object address (const) More... | |
| void | CreateObject () |
| instantiate object of type Q More... | |
Private Member Functions | |
| void | SetOwner (const std::string &owner) |
| set object owner More... | |
| GlobalHandle () | |
| default ctor. Needed to compile on gcc3 More... | |
| const GlobalHandle< Q > & | operator= (const GlobalHandle< Q > &other) |
| operator= must not be used, use copy ctor More... | |
| void | SetVersion (const std::string &tag) |
| set version tag of the object to be read (used by QGlobalDataManager) More... | |
Private Attributes | |
| Q * | fObject |
| Object. More... | |
| Q * | fMyObject |
| Object created by this class. More... | |
| QGlobalLabel | fLabel |
| unique identifier of the object More... | |
| std::string | fVersion |
| Version of the QObject to be read / written. More... | |
| std::string | fDefaultOwner |
| Default owner of the QObject. More... | |
| QError | fGlobalDataManagerError |
| I/O error from the QGlobalDataManager. More... | |
| std::string | fDescription |
| Object description. More... | |
Friends | |
| class | QGlobalDataManager |
template class to handle diana global QObject with QGlobalDataManager
GlobalHandle is the access class to the QObject's handled by the QGlobalDataManger. It stores all the ancillary data necessary to save or get a global QObject. Each global QObject can be retrived or stored only if handled by this class. A GlobalHandle<Type> object stores only one object, and can be passed to the QGlobalDataManager only once. Ancillary data are all optional and can be:
File I/O is provided by this class, using the QGlobalReaderDispatcher / QGlobalWriterDispatcher classes. Inheriting classes implement DB I/O interfaces for specific QObject s. Examples of inheriting classes are QAveragePulseHandle, or QRunDataHandle in pkg/dianaglobalhandle. When adding new handles remember to update the LinkDef.hh file and RootCintIncludes.hh files in the pkg/dianaglobalhandle package.
Definition at line 40 of file QGlobalHandle.hh.
|
inline |
ctor
| name | name of the QObject |
Definition at line 47 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fDefaultOwner, GlobalHandle< Q >::fDescription, GlobalHandle< Q >::fGlobalDataManagerError, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fMyObject, QGlobalLabel::fName, GlobalHandle< Q >::fObject, QGlobalLabel::fOwner, GlobalHandle< Q >::fVersion, and QERR_SUCCESS.
|
inline |
copy ctor
Definition at line 62 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fDefaultOwner, GlobalHandle< Q >::fDescription, GlobalHandle< Q >::fGlobalDataManagerError, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fMyObject, GlobalHandle< Q >::fObject, GlobalHandle< Q >::fVersion, GlobalHandle< Q >::Get(), and GlobalHandle< Q >::Set().
|
inlinevirtual |
|
inlineprivate |
default ctor. Needed to compile on gcc3
Definition at line 337 of file QGlobalHandle.hh.
|
inline |
Add an extra integer key to the label.
Definition at line 128 of file QGlobalHandle.hh.
References QGlobalLabel::ExtraKey::Clear(), QGlobalLabel::ExtraKey::fDigits, QGlobalLabel::fExtraKeys, and GlobalHandle< Q >::fLabel.
|
inlineprotected |
instantiate object of type Q
Definition at line 316 of file QGlobalHandle.hh.
References Demangle(), DianaThrow, GlobalHandle< Q >::fMyObject, GlobalHandle< Q >::fObject, GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), and QERR_GLOBAL_HANDLE.
Referenced by GlobalHandle< Q >::Set().
|
inlinevirtual |
fill object from DB
Definition at line 272 of file QGlobalHandle.hh.
References Demangle(), err, GlobalHandle< Q >::fObject, GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), QERR_NOT_IMPLEMENTED, and QError::SetDescription().
Referenced by QGlobalDataManager::Get().
|
inlinevirtual |
fill QObject from file fname
Definition at line 202 of file QGlobalHandle.hh.
References err, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fObject, QGlobalReader::Get(), QGlobalReaderDispatcher::GetInstance(), QGlobalReaderDispatcher::GetReader(), QGlobalLabel::GetStringLabel(), QERR_SUCCESS, and GlobalHandle< Q >::Set().
Referenced by QRunDataHandle::FillFromFile(), and QGlobalDataManager::Get().
|
inline |
get the QObject
Definition at line 179 of file QGlobalHandle.hh.
References DianaThrow, GlobalHandle< Q >::fGlobalDataManagerError, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fObject, QError::GetDescription(), GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), QGlobalLabel::GetStringLabel(), GlobalHandle< Q >::IsValid(), QERR_GLOBAL_HANDLE, and QERR_SUCCESS.
Referenced by QFileWriter::Do(), QGlobalDataManager::Get(), GlobalHandle< Q >::GlobalHandle(), and QSequence::SaveConfig().
|
inlineprotected |
get object address
Definition at line 310 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fObject.
Referenced by QGlobalDataManager::Get(), and QGlobalDataManager::Set().
|
inlineprotected |
get object address (const)
Definition at line 313 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fObject.
|
inline |
Get first dataset of validity.
Definition at line 102 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginDataset, and GlobalHandle< Q >::fLabel.
|
inline |
Get first run of validity.
Definition at line 96 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginRun, and GlobalHandle< Q >::fLabel.
|
inline |
Get Channel associated to the object.
Definition at line 92 of file QGlobalHandle.hh.
References QGlobalLabel::fChannel, and GlobalHandle< Q >::fLabel.
|
inline |
Get Second Channel associated to the object.
Definition at line 94 of file QGlobalHandle.hh.
References QGlobalLabel::fChannel2, and GlobalHandle< Q >::fLabel.
|
inline |
Get dataset of validity.
Definition at line 106 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginDataset, and GlobalHandle< Q >::fLabel.
|
inline |
Get default owner (may be set by inheriting classes)
Definition at line 90 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fDefaultOwner.
Referenced by QGlobalDataManager::Get().
|
inline |
Get last dataset of validity.
Definition at line 104 of file QGlobalHandle.hh.
References QGlobalLabel::fEndDataset, and GlobalHandle< Q >::fLabel.
|
inline |
Get last run of validity.
Definition at line 98 of file QGlobalHandle.hh.
References QGlobalLabel::fEndRun, and GlobalHandle< Q >::fLabel.
|
inline |
Get I/O error.
Definition at line 196 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fGlobalDataManagerError.
Referenced by QSequence::SaveConfig().
|
inline |
Get extra integer key.
Definition at line 149 of file QGlobalHandle.hh.
References Demangle(), DianaThrow, QGlobalLabel::fExtraKeys, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fObject, and QERR_GLOBAL_HANDLE.
|
inline |
Get label.
Definition at line 84 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fLabel.
Referenced by QGlobalDataManager::Get(), and QGlobalDataManager::Set().
|
inline |
Get object name.
Definition at line 86 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fLabel, and QGlobalLabel::fName.
Referenced by GlobalHandle< Q >::CreateObject(), GlobalHandle< Q >::FillFromDB(), GlobalHandle< Q >::Get(), GlobalHandle< Q >::StoreOnDB(), and GlobalHandle< Q >::StoreOnFile().
|
inline |
Get object owner.
Definition at line 88 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fLabel, and QGlobalLabel::fOwner.
Referenced by GlobalHandle< Q >::CreateObject(), GlobalHandle< Q >::FillFromDB(), GlobalHandle< Q >::Get(), QGlobalDataManager::Get(), QGlobalDataManager::Set(), GlobalHandle< Q >::StoreOnDB(), and GlobalHandle< Q >::StoreOnFile().
|
inline |
Get run of validity.
Definition at line 100 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginRun, and GlobalHandle< Q >::fLabel.
|
inline |
Get run validity interval.
Definition at line 108 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginRun, QGlobalLabel::fEndRun, and GlobalHandle< Q >::fLabel.
|
inline |
Get version tag of the object, if any.
Definition at line 304 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fVersion.
Referenced by QGlobalDataManager::Get(), and QGlobalDataManager::Set().
|
inline |
Definition at line 163 of file QGlobalHandle.hh.
References QGlobalLabel::fExtraKeys, and GlobalHandle< Q >::fLabel.
|
inline |
check QObject validity
Definition at line 193 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fObject.
Referenced by QFileWriter::Do(), GlobalHandle< Q >::Get(), QSequence::SaveConfig(), QGlobalDataManager::Set(), and GlobalHandle< Q >::StoreOnFile().
|
inlineprivate |
operator= must not be used, use copy ctor
Definition at line 339 of file QGlobalHandle.hh.
|
inline |
set the QObject
Definition at line 170 of file QGlobalHandle.hh.
References GlobalHandle< Q >::CreateObject(), and GlobalHandle< Q >::fObject.
Referenced by GlobalHandle< Q >::FillFromFile(), GlobalHandle< Q >::GlobalHandle(), QSequence::SaveConfig(), and QGlobalDataManager::Set().
|
inline |
Set Channel.
Definition at line 114 of file QGlobalHandle.hh.
References QGlobalLabel::fChannel, and GlobalHandle< Q >::fLabel.
|
inline |
Set Channel2.
Definition at line 116 of file QGlobalHandle.hh.
References QGlobalLabel::fChannel2, and GlobalHandle< Q >::fLabel.
|
inline |
Set dataset of validity.
Definition at line 125 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginDataset, QGlobalLabel::fEndDataset, and GlobalHandle< Q >::fLabel.
|
inline |
Set Dataset Validity Interval.
Definition at line 123 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginDataset, QGlobalLabel::fEndDataset, and GlobalHandle< Q >::fLabel.
|
inline |
set object description (experimental)
Definition at line 199 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fDescription.
|
inline |
Set extra integer key to value.
Definition at line 135 of file QGlobalHandle.hh.
References Demangle(), DianaThrow, QGlobalLabel::fExtraKeys, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fObject, and QERR_GLOBAL_HANDLE.
|
inlineprivate |
set object owner
Definition at line 335 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fLabel, and QGlobalLabel::fOwner.
Referenced by QGlobalDataManager::Get(), and QGlobalDataManager::Set().
|
inline |
Set BeginRun = EndRun = run.
Definition at line 120 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginRun, QGlobalLabel::fEndRun, and GlobalHandle< Q >::fLabel.
|
inline |
Set Validity Interval.
Definition at line 118 of file QGlobalHandle.hh.
References QGlobalLabel::fBeginRun, QGlobalLabel::fEndRun, and GlobalHandle< Q >::fLabel.
|
inlineprivate |
set version tag of the object to be read (used by QGlobalDataManager)
Definition at line 342 of file QGlobalHandle.hh.
References GlobalHandle< Q >::fVersion.
Referenced by QGlobalDataManager::Get(), and QGlobalDataManager::Set().
|
inlinevirtual |
store object on DB, non const version
Definition at line 298 of file QGlobalHandle.hh.
References GlobalHandle< Q >::StoreOnDB().
|
inlinevirtual |
store object on DB
Definition at line 285 of file QGlobalHandle.hh.
References Demangle(), err, GlobalHandle< Q >::fObject, GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), QERR_NOT_IMPLEMENTED, and QError::SetDescription().
Referenced by QGlobalDataManager::Set(), and GlobalHandle< Q >::StoreOnDB().
|
inlinevirtual |
store object on file fname
Definition at line 237 of file QGlobalHandle.hh.
References err, GlobalHandle< Q >::fDescription, GlobalHandle< Q >::fLabel, GlobalHandle< Q >::fObject, QGlobalWriterDispatcher::GetInstance(), GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), QGlobalLabel::GetStringLabel(), QGlobalWriterDispatcher::GetWriter(), GlobalHandle< Q >::IsValid(), QERR_GLOBAL_HANDLE, QERR_SUCCESS, QGlobalWriter::Set(), and QError::SetDescription().
Referenced by QGlobalDataManager::Set().
|
friend |
Definition at line 360 of file QGlobalHandle.hh.
|
private |
Default owner of the QObject.
Definition at line 354 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::GetDefaultOwner(), and GlobalHandle< Q >::GlobalHandle().
|
private |
Object description.
Definition at line 358 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::GlobalHandle(), GlobalHandle< Q >::SetDescription(), and GlobalHandle< Q >::StoreOnFile().
|
private |
I/O error from the QGlobalDataManager.
Definition at line 356 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::Get(), QGlobalDataManager::Get(), GlobalHandle< Q >::GetError(), and GlobalHandle< Q >::GlobalHandle().
|
private |
unique identifier of the object
Definition at line 350 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::AddKey(), GlobalHandle< Q >::FillFromFile(), GlobalHandle< Q >::Get(), GlobalHandle< Q >::GetBeginDataset(), GlobalHandle< Q >::GetBeginRun(), GlobalHandle< Q >::GetChannel(), GlobalHandle< Q >::GetChannel2(), GlobalHandle< Q >::GetDataset(), GlobalHandle< Q >::GetEndDataset(), GlobalHandle< Q >::GetEndRun(), GlobalHandle< Q >::GetKey(), GlobalHandle< Q >::GetLabel(), GlobalHandle< Q >::GetName(), GlobalHandle< Q >::GetOwner(), GlobalHandle< Q >::GetRun(), GlobalHandle< Q >::GetValidityInterval(), GlobalHandle< Q >::GlobalHandle(), GlobalHandle< Q >::HaveKey(), GlobalHandle< Q >::SetChannel(), GlobalHandle< Q >::SetChannel2(), GlobalHandle< Q >::SetDataset(), GlobalHandle< Q >::SetDatasetInterval(), GlobalHandle< Q >::SetKey(), GlobalHandle< Q >::SetOwner(), GlobalHandle< Q >::SetRun(), GlobalHandle< Q >::SetRunInterval(), and GlobalHandle< Q >::StoreOnFile().
|
private |
Object created by this class.
Definition at line 346 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::CreateObject(), GlobalHandle< Q >::GlobalHandle(), and GlobalHandle< Q >::~GlobalHandle().
|
private |
Object.
Definition at line 344 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::CreateObject(), GlobalHandle< Q >::FillFromDB(), GlobalHandle< Q >::FillFromFile(), GlobalHandle< Q >::Get(), GlobalHandle< Q >::GetAddress(), GlobalHandle< Q >::GetKey(), GlobalHandle< Q >::GlobalHandle(), GlobalHandle< Q >::IsValid(), GlobalHandle< Q >::Set(), GlobalHandle< Q >::SetKey(), GlobalHandle< Q >::StoreOnDB(), and GlobalHandle< Q >::StoreOnFile().
|
private |
Version of the QObject to be read / written.
Definition at line 352 of file QGlobalHandle.hh.
Referenced by GlobalHandle< Q >::GetVersion(), GlobalHandle< Q >::GlobalHandle(), and GlobalHandle< Q >::SetVersion().