Diana Software
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
QObject Class Referenceabstract

base class for objects handled by QEvent and QGlobalDataManager. More...

Inheritance diagram for QObject:
QBaseType< ULong64_t > QBaseType< T > QBool QComplex QEmptyObject QInterval QIntervalSet QMatrix QMatrixC QStdVector< T > QString QTime QVector QVectorC QVectorCConstView QVectorCView QVectorConstView QVectorI QVectorView

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...
 
QObjectoperator= (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 QObjectDuplicate () 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 QObjectNew (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...
 

Detailed Description

base class for objects handled by QEvent and QGlobalDataManager.

Author
Marco Vignati

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

TObject bits.

Enumerator
kIsValid 

object has been assigned a value

kWrite 

write this object onto output files, this and the bits below should go in the handle? no because of efficiency. They are stored in the fTemporaryBits member

kIsRequired 

this object has been requested by somebody

kIsJustAdded 

this object has been just added to the event

Definition at line 86 of file QObject.hh.

Constructor & Destructor Documentation

◆ QObject()

QObject::QObject ( )

default constructor

Definition at line 23 of file QObject.cc.

◆ ~QObject()

virtual QObject::~QObject ( )
inlinevirtual

destructor

Definition at line 102 of file QObject.hh.

Member Function Documentation

◆ ClassDef()

QObject::ClassDef ( QObject  ,
 
)
private

◆ Clear()

virtual void QObject::Clear ( )
pure virtual

◆ CopyBits()

void QObject::CopyBits ( QObject obj) const

copy validity and temporary bits to another QObject

Definition at line 84 of file QObject.cc.

◆ Draw()

virtual void QObject::Draw ( Option_t *  option = "")
inlinevirtual

Reimplemented in QVector.

Definition at line 173 of file QObject.hh.

◆ Dump()

void QObject::Dump ( std::ostream &  o) const
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().

◆ Duplicate()

virtual QObject* QObject::Duplicate ( ) const
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=().

◆ Fill()

virtual bool QObject::Fill ( QObject evData) const
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.

◆ FullyFill()

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

◆ GetWrite()

bool QObject::GetWrite ( ) const
inline

check wheter write or not this object

Definition at line 120 of file QObject.hh.

References kWrite, and QObjectTestBit().

Referenced by QEventAssembler::GetWriteLabels().

◆ InValidate()

void QObject::InValidate ( )
inline

make object non valid

Definition at line 111 of file QObject.hh.

References kIsValid.

Referenced by Reset().

◆ IsJustAdded()

bool QObject::IsJustAdded ( ) const
inline

check wheter this object has been just added by some module

Definition at line 129 of file QObject.hh.

References kIsJustAdded, and QObjectTestBit().

◆ IsRequired()

bool QObject::IsRequired ( ) const
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().

◆ IsValid()

bool QObject::IsValid ( ) const
inline

check wheter object is valid

Examples
ScanEvents.C.

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

◆ New()

Q_BEGIN_NAMESPACE QObject * QObject::New ( const char *  object)
static

Definition at line 14 of file QObject.cc.

Referenced by LASCIIGlobalReader::GetQObject().

◆ operator=()

QObject & QObject::operator= ( const QObject rhs)

operator=

Definition at line 32 of file QObject.cc.

Referenced by QPulse::operator=(), QVectorI::operator=(), and QVectorI::QVectorI().

◆ Print()

virtual void QObject::Print ( ) const
inlinevirtual

print content on screen

Definition at line 163 of file QObject.hh.

References Dump().

◆ QObjectSetBit()

void QObject::QObjectSetBit ( int  bit,
bool  value 
)
private

set temporary bit

Definition at line 75 of file QObject.cc.

Referenced by SetIsJustAdded(), SetIsRequired(), and SetWrite().

◆ QObjectTestBit()

bool QObject::QObjectTestBit ( int  bit) const
private

test temporary bit

Definition at line 92 of file QObject.cc.

Referenced by GetWrite(), IsJustAdded(), and IsRequired().

◆ ReadFromStream()

QError QObject::ReadFromStream ( std::istream &  o)
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().

◆ Reset()

void QObject::Reset ( )
inline

set object to non valid and calls Clear()

Definition at line 138 of file QObject.hh.

References Clear(), and InValidate().

◆ SetIsJustAdded()

void QObject::SetIsJustAdded ( bool  added = true)
inline

set that this object has been just added

Definition at line 132 of file QObject.hh.

References kIsJustAdded, and QObjectSetBit().

◆ SetIsRequired()

void QObject::SetIsRequired ( bool  required = true)
inline

set that this object is required

Definition at line 126 of file QObject.hh.

References kIsRequired, and QObjectSetBit().

Referenced by QEventAssembler::SetRequiredLabels().

◆ SetWrite()

void QObject::SetWrite ( bool  write = true)
inline

write or not this object

Definition at line 117 of file QObject.hh.

References kWrite, and QObjectSetBit().

◆ Validate()

void QObject::Validate ( )
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=().

◆ WriteOnStream()

QError QObject::WriteOnStream ( std::ostream &  o) const
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().

Member Data Documentation

◆ fTemporaryBits

int QObject::fTemporaryBits
private

temporary bits are used for runtime diana settings

Definition at line 181 of file QObject.hh.


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