![]() |
Diana Software
|
base class for objects handled by QEvent and QGlobalDataManager. More...
Public Types | |
| enum | { kIsValid = BIT(15) , kWrite = BIT(0) , kIsRequired = BIT(1) , kIsJustAdded = BIT(2) } |
| TObject bits. More... | |
Public Member Functions | |
| QObject () | |
| default constructor More... | |
| virtual | ~QObject () |
| destructor More... | |
| QObject & | operator= (const QObject &rhs) |
| operator= More... | |
| void | Validate () |
| make object valid More... | |
| void | InValidate () |
| make object non valid More... | |
| bool | IsValid () const |
| check wheter object is valid More... | |
| void | SetWrite (bool write=true) |
| write or not this object More... | |
| bool | GetWrite () const |
| check wheter write or not this object More... | |
| bool | IsRequired () const |
| check wheter this object is required by some module More... | |
| void | SetIsRequired (bool required=true) |
| set that this object is required More... | |
| bool | IsJustAdded () const |
| check wheter this object has been just added by some module More... | |
| void | SetIsJustAdded (bool added=true) |
| set that this object has been just added More... | |
| virtual void | Clear ()=0 |
| reset members to default values More... | |
| void | Reset () |
| set object to non valid and calls Clear() More... | |
| virtual bool | Fill (QObject *evData) const =0 |
| calls operator= of inheriting classes. Validity flag and bits are not copied. This function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp. If evData type mismatches returns false, true otherwise. More... | |
| void | FullyFill (QObject *evData) const |
| calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits More... | |
| virtual QObject * | Duplicate () const =0 |
| create object of same type, this function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp More... | |
| virtual void | Dump (std::ostream &o) const |
| print content to stream (intended for screen print or log files) More... | |
| virtual void | Print () const |
| print content on screen More... | |
| virtual QError | WriteOnStream (std::ostream &o) const |
| print content to stream (intended for storage in text files) More... | |
| virtual QError | ReadFromStream (std::istream &o) |
| fill content from stream (intended for storage in text files) More... | |
| void | CopyBits (QObject *obj) const |
| copy validity and temporary bits to another QObject More... | |
| virtual void | Draw (Option_t *option="") |
Static Public Member Functions | |
| static QObject * | New (const char *object) |
Private Member Functions | |
| void | QObjectSetBit (int bit, bool value) |
| set temporary bit More... | |
| bool | QObjectTestBit (int bit) const |
| test temporary bit More... | |
| ClassDef (QObject, 4) | |
Private Attributes | |
| int | fTemporaryBits |
| temporary bits are used for runtime diana settings More... | |
base class for objects handled by QEvent and QGlobalDataManager.
Every object that is going to be handled by QEvent or QGlobalDataManager must inherit from QObject. This class only contains the validity flag (that says if the object has been assigned a value) and the write flag (that sets wheter the QObject added to a QEvent should be written in the output files or not). Base types that inherit from this class are QInt, QDouble, QFloat (templates implementations of QBaseType), QBool and QString. To store a root TObject use QTObject. Specicic QObject(s) can be found in pkg/dianadata or in the QObjects groups of this documentation.
Inheriting classes must declare the macro QObjectDef in the .hh file, that contains the declaration of the Fill() and Duplicate() functions. The .cc file must contain the declaration of the macro QObjectImp, that implements the two functions. The .cc existence is not mandatory (a QObject can be a simple data container, so the .cc is useless, QBaselineData for example has no cc), Makefiles will automatically generate a .cc with the needed declaration of QObjectImp.
Inheriting classes must implement the Clear method, and optionally can implement the methods Dump (that is called to print the object, e.g. cout<<object), WriteOnStream and ReadOnStream (to perform I/O with text files). If the two latter methods are not implemented, the default I/O, implemented in QObjectInspector, is used.
Definition at line 76 of file QObject.hh.
| anonymous enum |
TObject bits.
Definition at line 86 of file QObject.hh.
| QObject::QObject | ( | ) |
default constructor
Definition at line 23 of file QObject.cc.
|
inlinevirtual |
destructor
Definition at line 102 of file QObject.hh.
|
private |
|
pure virtual |
reset members to default values
Implemented in QVectorConstView, QVectorView, QVectorI, QVectorCConstView, QVectorCView, QVectorC, QVector, QMatrixC, QMatrix, QIntervalSet, QInterval, QComplex, QTime, QString, QStdVector< T >, QEmptyObject, QBool, QBaseType< T >, QBaseType< ULong64_t >, QBaseType< T >, QBaseType< ULong64_t >, QBaseType< T >, QBaseType< ULong64_t >, QBaseType< T >, QBaseType< ULong64_t >, QBaseType< T >, and QBaseType< ULong64_t >.
Referenced by QObjectInspector::FillFromStream(), and Reset().
| void QObject::CopyBits | ( | QObject * | obj | ) | const |
copy validity and temporary bits to another QObject
Definition at line 84 of file QObject.cc.
|
inlinevirtual |
Reimplemented in QVector.
Definition at line 173 of file QObject.hh.
|
virtual |
print content to stream (intended for screen print or log files)
Reimplemented in QString, QBool, QBaseType< T >, QBaseType< ULong64_t >, QVector, QIntervalSet, QTime, and QStdVector< T >.
Definition at line 53 of file QObject.cc.
References QObjectInspector::DumpOnStream(), err, and QERR_SUCCESS.
Referenced by QEvent::Dump(), QGlobalDataManager::Dump(), and Print().
|
pure virtual |
create object of same type, this function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp
Implemented in QStdVector< T >, QBaseType< T >, and QBaseType< ULong64_t >.
Referenced by QEvent::operator=().
|
pure virtual |
calls operator= of inheriting classes. Validity flag and bits are not copied. This function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp. If evData type mismatches returns false, true otherwise.
| void QObject::FullyFill | ( | QObject * | evData | ) | const |
calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits
Definition at line 39 of file QObject.cc.
References Fill().
Referenced by QEvent::operator=().
|
inline |
check wheter write or not this object
Definition at line 120 of file QObject.hh.
References kWrite, and QObjectTestBit().
Referenced by QEventAssembler::GetWriteLabels().
|
inline |
make object non valid
Definition at line 111 of file QObject.hh.
References kIsValid.
Referenced by Reset().
|
inline |
check wheter this object has been just added by some module
Definition at line 129 of file QObject.hh.
References kIsJustAdded, and QObjectTestBit().
|
inline |
check wheter this object is required by some module
Definition at line 123 of file QObject.hh.
References kIsRequired, and QObjectTestBit().
Referenced by QEvent::Dump(), and QEventAssembler::GetRequiredLabels().
|
inline |
check wheter object is valid
Definition at line 114 of file QObject.hh.
References kIsValid.
Referenced by QEvent::Dump(), QGlobalDataManager::Dump(), QBool::Dump(), QBool::operator bool(), QEvent::operator=(), QBool::operator==(), and ScanEvents().
|
static |
Definition at line 14 of file QObject.cc.
Referenced by LASCIIGlobalReader::GetQObject().
operator=
Definition at line 32 of file QObject.cc.
Referenced by QPulse::operator=(), QVectorI::operator=(), and QVectorI::QVectorI().
|
inlinevirtual |
|
private |
set temporary bit
Definition at line 75 of file QObject.cc.
Referenced by SetIsJustAdded(), SetIsRequired(), and SetWrite().
|
private |
test temporary bit
Definition at line 92 of file QObject.cc.
Referenced by GetWrite(), IsJustAdded(), and IsRequired().
|
virtual |
fill content from stream (intended for storage in text files)
Reimplemented in QStdVector< T >.
Definition at line 68 of file QObject.cc.
References QObjectInspector::FillFromStream().
|
inline |
set object to non valid and calls Clear()
Definition at line 138 of file QObject.hh.
References Clear(), and InValidate().
|
inline |
set that this object has been just added
Definition at line 132 of file QObject.hh.
References kIsJustAdded, and QObjectSetBit().
|
inline |
set that this object is required
Definition at line 126 of file QObject.hh.
References kIsRequired, and QObjectSetBit().
Referenced by QEventAssembler::SetRequiredLabels().
|
inline |
write or not this object
Definition at line 117 of file QObject.hh.
References kWrite, and QObjectSetBit().
|
inline |
make object valid
Definition at line 108 of file QObject.hh.
References kIsValid.
Referenced by QBool::operator=(), QString::operator=(), QStdVector< T >::operator=(), and QBaseType< T >::operator=().
|
virtual |
print content to stream (intended for storage in text files)
Reimplemented in QStdVector< T >.
Definition at line 62 of file QObject.cc.
References QObjectInspector::DumpOnStream().
|
private |
temporary bits are used for runtime diana settings
Definition at line 181 of file QObject.hh.