![]() |
Diana Software
|
diana event More...
Public Types | |
| typedef std::map< QEventLabel, QObject ** > | QObjectMap |
Public Member Functions | |
| QEvent () | |
| constructor More... | |
| QEvent (const QEvent &ev) | |
| copy constructor More... | |
| ~QEvent () | |
| destructor More... | |
| unsigned int | GetReadNumber () const |
| return the event number as read by the current reader. More... | |
| template<typename Q > | |
| void | Get (const char *owner, ReadHandle< Q > &handle) const |
| Get a QObject Handle in read mode. More... | |
| template<typename Q > | |
| void | Get (ReadHandle< Q > &handle) const |
| Get a QObject Handle in read mode, owned by the current module. More... | |
| template<typename Q > | |
| const Q & | Get (const char *owner, const char *name) const |
| Get a QObject in read mode. More... | |
| template<typename Q > | |
| const Q & | Get (const char *name) const |
| Get a QObject in read mode, owned by the current module. More... | |
| template<typename Q > | |
| const Q & | GetByLabel (const QEventLabel &label) const |
| Get a QObject in read mode by label. More... | |
| template<typename Q > | |
| void | Get (WriteHandle< Q > &handle) |
| Get a QObject Handle in write mode. More... | |
| template<typename Q > | |
| Q & | Get (const char *name) |
| Get a QObject in write mode. More... | |
| template<typename Q > | |
| void | Add (WriteHandle< Q > &handle) |
| Add a QObject to the event. More... | |
| template<typename Q > | |
| Q & | Add (const std::string &name) |
| Add a QObject to the event. More... | |
| template<typename Q > | |
| void | Require (const std::string &owner, const std::string &name) const |
| notify the QEvent that we need a QObject, if not found an exception is thrown More... | |
| template<typename Q > | |
| void | RequireByLabel (const QEventLabel &label) const |
| notify the QEvent that we need a QObject, if not found an exception is thrown More... | |
| void | SetAlias (const std::string &name, const std::string &pathInObject, const std::string &alias) |
| set alias for objects or variables in objects owned by currentmodule. More... | |
| void | Dump (std::ostream &o) const |
| Print the event and its member. More... | |
| const QAliases & | GetAliases () const |
| get aliases (const version) More... | |
| const std::string * | GetOwner () const |
| get the name of the module that is currently acting on the event More... | |
| template<typename Q > | |
| bool | Contains (const char *owner, const char *name) const |
| Check to see if the event contains a particular object. More... | |
| template<typename Q > | |
| bool | Contains (const char *label) const |
| Check to see if the event contains a particular object. More... | |
Protected Member Functions | |
| template<typename Q > | |
| void | Get (const char *owner, WriteHandle< Q > &handle) |
| Get a QObject handle in write mode. More... | |
| template<typename Q > | |
| void | Add (const char *owner, WriteHandle< Q > &handle) |
| Add a QObject to the event. This method has to be called before the event loop. More... | |
| template<typename Q > | |
| Q & | Add (const char *owner, const char *name) |
| Add a QObject to the event. This method has to be called before the event loop. More... | |
| void | Clear () |
| reset members to default values More... | |
| void | Consolidate () |
| keep only Required and JustAdded QObjects More... | |
| void | SetOwner (const std::string *owner) const |
| set the name of the module that is currently acting on the event More... | |
| QAliases & | GetAliases () |
| get aliases More... | |
| std::vector< QEventLabel > | GetLabels () const |
| Get all object labels. More... | |
| void | SetReadNumber (const unsigned int readNumber) |
| set the event number as read by the current reader. More... | |
| void | SetOverWrite (const bool ow=true) |
| set whether an object can be overwritten More... | |
| const QEvent & | operator= (const QEvent &ev) |
| operator= new QObject's are created if needed and are owned by this. This this method is protected, use the copy ctor instead, or consider QEventAssembler. More... | |
| QObject ** | GetObject (const char *owner, const char *name) const |
| QObject ** | GetObjectByLabel (const QEventLabel &label) const |
Private Member Functions | |
| void | GetLabel (const char *owner, const char *name, QEventLabel &label) const |
| void | Add (const char *owner, const char *name, QObject **) |
Private Attributes | |
| QObjectMap | fObjectMap |
| std::map< std::string, std::string > | fDefaultMap |
| const std::string mutable * | fModuleName |
| unsigned int | fReadNumber |
| event number More... | |
| bool | fOverWrite |
| QAliases | fAliases |
Friends | |
| class | QEventAssembler |
| class | QBaseModule |
diana event
QEvent is the I/O class for event by event quantities. It is a dynamic container of QObject s, referenced by a label that identifies the object owner and name. The label, implemented by the class QEventLabel, behaves like a string, whose value is "owner@name". Several Get interfaces are provided (both in read and write mode), and the access is mediated by the classes ReadHandle and WriteHandle. Direct access to QObject's is also possible (see the documentation of each method below). QObject's must be added to the event in the Init() of the modules using the Add method. QObject's by default are saved in the output file, but this feature can be disabled after an Add call (see description of single methods).
Public interfaces do not allow complete handling of this class, like using operator=, add an object specifying also the owner, and list all QObject's in the QEvent. The visitor class QEventAssembler provides full handling, and must be used to create a new QEvent. QReader (s), for example, interact with a QEventAssembler and not with a QEvent.
The QEventInspector is another visitor with less power of QEventAssembler that can retreive the list of all QObject (s). This class is used by the QWriter (s).
| typedef std::map<QEventLabel,QObject**> QEvent::QObjectMap |
| Q_BEGIN_NAMESPACE QEvent::QEvent | ( | ) |
constructor
Definition at line 8 of file QEvent.cc.
References fDefaultMap, fModuleName, fObjectMap, fOverWrite, and fReadNumber.
| QEvent::QEvent | ( | const QEvent & | ev | ) |
copy constructor
Definition at line 33 of file QEvent.cc.
References fDefaultMap, fModuleName, fObjectMap, fOverWrite, fReadNumber, and operator=().
| QEvent::~QEvent | ( | ) |
destructor
Definition at line 17 of file QEvent.cc.
References fDefaultMap, fModuleName, fObjectMap, fOverWrite, and fReadNumber.
|
inlineprotected |
|
private |
Definition at line 195 of file QEvent.cc.
References fDefaultMap, fObjectMap, GetObject(), QEventLabel::GetStringLabel(), and QERR_EVENT_GENERIC.
|
inlineprotected |
Add a QObject to the event. This method has to be called before the event loop.
Definition at line 321 of file QEvent.hh.
References Add(), WriteHandle< T >::CreateObject(), fOverWrite, WriteHandle< T >::GetAddress(), GetObject(), QHandle< T >::GetObjectName(), and QHandle< T >::Set().
|
inline |
Add a QObject to the event.
This method has to be called before the event loop, e.g. in the QModule::Init() method of a module. QObject's are by default saved in the output file (if any). This feature can be disabled using the QObject::SetWrite() method.
| name | Name of the QObject.
ev.Add<QMyQObject>("ObjectName");
or
ev.Add<QMyQObject>("ObjectName").SetWrite(false);
|
Definition at line 222 of file QEvent.hh.
References Add(), and WriteHandle< T >::Get().
|
inline |
Add a QObject to the event.
This method has to be called before the event loop, e.g. in the QModule::Init() method of a module. QObject's are by default saved in the output file (if any). This feature can be disabled using the QObject::SetWrite() method.
| handle | WriteHandle<> of the QObject class to be written. Example:
WriteHandle<QMyObject> wHandle("MyObject");
ev.Add(wHandle);
// use this if the variable is temporary and should not be saved in the output file
wHandle.Get().SetWrite(false);
|
Definition at line 193 of file QEvent.hh.
References fModuleName, WriteHandle< T >::Get(), QHandle< T >::GetObjectName(), and QERR_EVENT_GENERIC.
Referenced by QEventAssembler::Add(), Add(), QFilter::Begin(), QDriver::Begin(), QModule::Begin(), MExpandEventToBaseTypes::Init(), MQVectorToQPulse::Init(), MApplyCalibration::Init(), MRunDataLoader::Init(), MVariableOperation::Init(), MLockinDenoising::Init(), MCOFBiComponent::Init(), MOptimumFilter::Init(), MAdvancedPeakFinder::Init(), MPeakDetector::Init(), MPulseIntegral::Init(), MPulseTimeConstants::Init(), MTestModule::Init(), MTestNeighbours::Init(), MFastCoincidence::Init(), MSideAmplitude::Init(), MSideCoincidence::Init(), MSourceRunTime::Init(), MTutorialPulseShape::Init(), MExtractVariableFromObject::Init(), MCustomWaveform::Init(), MNeighboursPacker::Init(), MDownSampling::Init(), MTestRawEvent::Init(), and MQinoDataReader::Init().
|
protected |
reset members to default values
Definition at line 74 of file QEvent.cc.
References fObjectMap.
Referenced by QEventAssembler::Clear(), operator=(), and QEventAssembler::QEventAssembler().
|
protected |
keep only Required and JustAdded QObjects
Definition at line 84 of file QEvent.cc.
References fObjectMap.
Referenced by QEventAssembler::Consolidate().
|
inline |
Check to see if the event contains a particular object.
Definition at line 290 of file QEvent.hh.
References fObjectMap.
|
inline |
Check to see if the event contains a particular object.
Definition at line 279 of file QEvent.hh.
References fObjectMap.
Referenced by QEventAssembler::Contains(), and QFileWriter::Init().
| void QEvent::Dump | ( | std::ostream & | o | ) | const |
Print the event and its member.
| o | output stream |
Definition at line 98 of file QEvent.cc.
References QObject::Dump(), fModuleName, fObjectMap, fReadNumber, QEventLabel::GetStringLabel(), QObject::IsRequired(), QObject::IsValid(), and QStringHandler::Resize().
Referenced by QSequence::PrintEvents().
|
inline |
|
inline |
|
inline |
Get a QObject in read mode.
| owner | Name of the module that owns the QObject. If owner="" the default owner for that QObject is used. |
| name | Name of the QObject to be read. Example:
const QMyQObject& obj = ev.Get<QMyQObject>("ModuleNameWithoutM","ObjectName");
|
Definition at line 106 of file QEvent.hh.
References ReadHandle< T >::Get(), and Get().
|
inline |
Get a QObject Handle in read mode.
| owner | Name of the module that owns the QObject. if owner="" the default owner for that QObject is used. |
| handle | ReadHandle<> of the QObject class to be read. Example:
ReadHandle<QMyQObject> handle("ObjectName");
ev.Get("ModuleNameWithoutM",handle);
const QMyQObject& obj = handle.Get();
|
Definition at line 74 of file QEvent.hh.
References GetObject(), QHandle< T >::GetObjectName(), and QHandle< T >::Set().
Referenced by QFileWriter::BuildFileName(), MExpandEventToBaseTypes::Do(), MQVectorToQPulse::Do(), MApplyCalibration::Do(), MRunDataLoader::Do(), MVariableOperation::Do(), MCOFBiComponent::Do(), MOptimumFilter::Do(), MAdvancedPeakFinder::Do(), MBaselineModule::Do(), MPeakDetector::Do(), MPulseBasicParameters::Do(), MPulseIntegral::Do(), MPulseTimeConstants::Do(), MPulserFlagByRegularTiming::Do(), MAveragePulses::Do(), MTestFetchContinuousIO::Do(), MTestLight::Do(), MTestModule::Do(), MAlphaDelayedCoincidence::Do(), MCheckTimeOrdering::Do(), MFastCoincidence::Do(), MJitterByCoincidence::Do(), MJitterByDelay::Do(), MSourceRunTime::Do(), MTutorialAveragePulse::Do(), MTutorialPulseShape::Do(), MExtractVariableFromObject::Do(), MDecorrelator::Do(), MLockinDenoising::Do(), MNoiseCrossFrequencyCovariance::Do(), MNoiseCrossPowerSpectrum::Do(), MNoiseFrequencyCoherence::Do(), MTestNeighbours::Do(), MTestNeighboursContinuousIO::Do(), MTestUnroll::Do(), MCoincidence::Do(), MSideAmplitude::Do(), MSideCoincidence::Do(), MCoincidenceSimple::Do(), MCustomWaveform::Do(), MGuiDriver::Do(), MDownSampling::Do(), MTestDriver::Do(), MNeighboursPacker::Do(), MTestRawEvent::Do(), MQinoDataReader::Do(), QFileWriter::Do(), QRootFileWriterBase::Dump(), QCreateSidePulseByPulseSplitting::FillList(), QTestReaderEventGenerator::FillList(), QUnrollSidePulses::FillList(), MFilterValidity::Filter(), MRejectNotValid::Filter(), MTwoVariablesEnergyFilter::Filter(), MEarlierEventsFilter::Filter(), MOverlappedWindowFilter::Filter(), MRawDataFilter::Filter(), MTimeCutFilter::Filter(), MSelectRunType::Filter(), MBadPulse::Filter(), MGoodWaveform::Filter(), MSelectPulserByDelay::Filter(), MFilterTest::Filter(), QFilter::FilterAlgorithm(), Get(), QEventAssembler::Get(), QFileWriter::GetCorrespondingReaderFileName(), QAllSideNeighbour::GetNeighbourInfo(), QSameChannelNeighbour::GetNeighbourInfo(), QSameTimeNeighbour::GetNeighbourInfo(), QSideNeighbour::GetNeighbourInfo(), QSideOrSameTimeTrigger::GetNeighbourInfo(), QTimeNeighbour::GetNeighbourInfo(), MCoincidence::GetTime(), MFastCoincidence::GetTime(), MSideCoincidence::GetTime(), MVariableOperation::GetValue(), QFileWriter::IsToOpen(), QFilter::Process(), QDriver::Process(), QModule::Process(), and RequireByLabel().
|
inlineprotected |
Get a QObject handle in write mode.
Definition at line 309 of file QEvent.hh.
References GetObject(), QHandle< T >::GetObjectName(), and QHandle< T >::Set().
|
inline |
Get a QObject Handle in read mode, owned by the current module.
| name | Handle of the QObject to be read, owned by the caller module. Example:
ReadHandle<QMyQObject> handle("ObjectName");
ev.Get(handle);
const QMyQObject& obj = handle.Get();
|
Definition at line 89 of file QEvent.hh.
References fModuleName, GetObject(), QHandle< T >::GetObjectName(), and QHandle< T >::Set().
|
inline |
Get a QObject Handle in write mode.
| handle | WriteHandle<> of the QObject class to be written. Example:
WriteHandle<QMyQObject> handle("ObjectName");
ev.Get(handle);
QMyQObject& obj = handle.Get();
|
Definition at line 153 of file QEvent.hh.
References fModuleName, Get(), QHandle< T >::GetObjectName(), and QERR_EVENT_GENERIC.
|
inlineprotected |
|
inline |
get aliases (const version)
Definition at line 274 of file QEvent.hh.
References fAliases.
Referenced by QEventAssembler::GetAliases(), and SetAlias().
|
inline |
Get a QObject in read mode by label.
| label | QEventLabel of the object. Example:
QEventLabel label("Owner@ObjectName");
const QMyObject& obj = ev.Get<QMyObject>(label);
|
Definition at line 135 of file QEvent.hh.
References ReadHandle< T >::Get(), QEventLabel::GetName(), GetObjectByLabel(), QEventLabel::GetOwner(), and QHandle< T >::Set().
Referenced by MExpandEventToBaseTypes::Do(), MQVectorToQPulse::Do(), MApplyCalibration::Do(), MCOFBiComponent::Do(), MOptimumFilter::Do(), MAdvancedPeakFinder::Do(), MBaselineModule::Do(), MPeakDetector::Do(), MPulseBasicParameters::Do(), MPulseIntegral::Do(), MPulseTimeConstants::Do(), MAveragePulses::Do(), MTestModule::Do(), MAlphaDelayedCoincidence::Do(), MFastCoincidence::Do(), MLockinDenoising::Do(), MNoiseCrossFrequencyCovariance::Do(), MNoiseCrossPowerSpectrum::Do(), MNoiseFrequencyCoherence::Do(), MCoincidence::Do(), MSideCoincidence::Do(), QCreateSidePulseByPulseSplitting::FillList(), MFilterResult::Filter(), MFilterResultAND::Filter(), MTwoVariablesEnergyFilter::Filter(), MOverlappedWindowFilter::Filter(), MTutorialAmplitudeFilter::Filter(), MVariableOperation::GetValue(), and QTimeNeighbour::GetWantsNeighbours().
|
private |
Definition at line 184 of file QEvent.cc.
References fDefaultMap, QEventLabel::name, and QEventLabel::owner.
Referenced by GetObject().
|
protected |
Get all object labels.
Definition at line 156 of file QEvent.cc.
References fObjectMap.
Referenced by QEventAssembler::GetLabels(), QEventAssembler::GetRequiredLabels(), QEventAssembler::GetWriteLabels(), and QEventAssembler::SetRequiredLabels().
|
protected |
Definition at line 167 of file QEvent.cc.
References GetLabel(), and GetObjectByLabel().
Referenced by Add(), QEventAssembler::Get(), and Get().
|
protected |
Definition at line 175 of file QEvent.cc.
References fObjectMap.
Referenced by GetByLabel(), GetObject(), and RequireByLabel().
|
inline |
get the name of the module that is currently acting on the event
Definition at line 277 of file QEvent.hh.
References fModuleName.
Referenced by QSequence::PrintEvents(), and SetAlias().
|
inline |
return the event number as read by the current reader.
Definition at line 60 of file QEvent.hh.
References fReadNumber.
Referenced by MTestModule::Do(), MTestNeighbours::Do(), MCoincidence::Do(), MCoincidenceSimple::Do(), MFlagCoincidence::Do(), MTimeEnergy::Do(), MTimeSort::Do(), QReader::DoBase(), and QDriver::Process().
operator= new QObject's are created if needed and are owned by this. This this method is protected, use the copy ctor instead, or consider QEventAssembler.
| ev | other QEvent |
Definition at line 43 of file QEvent.cc.
References Clear(), QObject::Duplicate(), fDefaultMap, fModuleName, fObjectMap, fOverWrite, fReadNumber, QObject::FullyFill(), and QObject::IsValid().
Referenced by QEvent().
|
inline |
notify the QEvent that we need a QObject, if not found an exception is thrown
Definition at line 232 of file QEvent.hh.
Referenced by MSelectPulserByDelay::GetCuts(), QUnrollSidePulses::Init(), MApplyCalibration::Init(), MRunDataLoader::Init(), MVariableOperation::Init(), MLockinDenoising::Init(), MNoiseCrossFrequencyCovariance::Init(), MNoiseFrequencyCoherence::Init(), MCOFBiComponent::Init(), MOptimumFilter::Init(), MAdvancedPeakFinder::Init(), MPulseIntegral::Init(), MPulseTimeConstants::Init(), MTestNeighbours::Init(), MCheckTimeOrdering::Init(), MFastCoincidence::Init(), MJitterByCoincidence::Init(), MJitterByDelay::Init(), MSideAmplitude::Init(), MSideCoincidence::Init(), MSourceRunTime::Init(), MTutorialPulseShape::Init(), MExtractVariableFromObject::Init(), MCustomWaveform::Init(), MDownSampling::Init(), QFileWriter::Init(), and MVariableOperation::SetReq().
|
inline |
notify the QEvent that we need a QObject, if not found an exception is thrown
| label | QEventLabel of the needed QObject |
Definition at line 242 of file QEvent.hh.
References QHandle< T >::Exists(), Get(), GetObjectByLabel(), QHandle< T >::GetObjectType(), QEventLabel::GetStringLabel(), QEventLabel::name, QEventLabel::owner, and QERR_EVENT_GENERIC.
Referenced by MFilterResultAND::GetCuts(), MFilterValidity::GetCuts(), MFilterSideAmplitude::GetCuts(), MTutorialAmplitudeFilter::GetCuts(), QCreateSidePulseByPulseSplitting::Init(), MExpandEventToBaseTypes::Init(), MQVectorToQPulse::Init(), MApplyCalibration::Init(), MLockinDenoising::Init(), MNoiseCrossFrequencyCovariance::Init(), MNoiseFrequencyCoherence::Init(), MCOFBiComponent::Init(), MOptimumFilter::Init(), MAdvancedPeakFinder::Init(), MPeakDetector::Init(), MPulseIntegral::Init(), MPulseTimeConstants::Init(), MTestNeighbours::Init(), MFastCoincidence::Init(), MJitterByCoincidence::Init(), MSideCoincidence::Init(), MDownSampling::Init(), MQPulseManager::Init(), and MVariableOperation::SetReq().
|
inline |
set alias for objects or variables in objects owned by currentmodule.
| name | QObject name |
| pathInObject | variable in object that needs alias. |
| alias | alias for the QObject |
Definition at line 261 of file QEvent.hh.
References QAliases::Add(), GetAliases(), and GetOwner().
Referenced by QFilter::Begin(), and MExtractVariableFromObject::Init().
|
inlineprotected |
set whether an object can be overwritten
Definition at line 366 of file QEvent.hh.
References fOverWrite.
Referenced by QEventAssembler::SetOverWrite().
|
inlineprotected |
set the name of the module that is currently acting on the event
Definition at line 354 of file QEvent.hh.
References fModuleName.
Referenced by QEventAssembler::SetOwner().
|
inlineprotected |
set the event number as read by the current reader.
Definition at line 363 of file QEvent.hh.
References fReadNumber.
Referenced by QEventAssembler::SetReadNumber().
|
friend |
|
friend |
|
private |
Definition at line 393 of file QEvent.hh.
Referenced by GetAliases().
|
private |
Definition at line 384 of file QEvent.hh.
Referenced by Add(), GetLabel(), operator=(), QEvent(), and ~QEvent().
|
private |
Definition at line 386 of file QEvent.hh.
Referenced by Add(), Dump(), Get(), GetOwner(), operator=(), QEvent(), SetOwner(), and ~QEvent().
|
private |
Definition at line 383 of file QEvent.hh.
Referenced by Add(), Clear(), Consolidate(), Contains(), Dump(), GetLabels(), GetObjectByLabel(), operator=(), QEvent(), and ~QEvent().
|
private |
Definition at line 391 of file QEvent.hh.
Referenced by Add(), operator=(), QEvent(), SetOverWrite(), and ~QEvent().
|
private |
event number
Definition at line 389 of file QEvent.hh.
Referenced by Dump(), GetReadNumber(), operator=(), QEvent(), SetReadNumber(), and ~QEvent().