Diana Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
QTime Class Reference

Diana time. More...

Inheritance diagram for QTime:
QObject

Public Member Functions

 QTime ()
 default constructor More...
 
 QTime (time_t time)
 constructor from a time_t => only unixtime is set More...
 
virtual ~QTime ()
 default destructor More...
 
void SetFromStartRunNs (unsigned long long time)
 set time from start of run in ns More...
 
void SetStartRunUnix (unsigned int time)
 set time of start of run in seconds from 1/1/1970 More...
 
void SetStartRunUnix (int year, int month, int day, int hour, int min, int sec)
 
unsigned long long GetFromStartRunNs () const
 retrieve time from start of run in ns More...
 
time_t GetStartRunUnix () const
 retrieve time of start of run in seconds from 1/1/1970 More...
 
time_t GetTimeSec () const
 retrieve time of event in seconds from 1/1/1970 More...
 
unsigned int GetTimeNSec () const
 retrieve time of event in nanoseconds from the last second More...
 
std::string GetTimeAsString () const
 retrieve time of event in string format More...
 
bool operator== (const QTime &other) const
 operator== More...
 
bool operator< (const QTime &other) const
 operator< More...
 
void Clear ()
 clear values More...
 
void Dump (std::ostream &o) const
 dump object More...
 
- Public Member Functions inherited from QObject
 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...
 
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 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="")
 

Private Member Functions

 QObjectDef (QTime, 2)
 

Private Attributes

unsigned long long fFromStartRunNs
 
unsigned int fStartRunUnix
 

Additional Inherited Members

- Public Types inherited from QObject
enum  { kIsValid = BIT(15) , kWrite = BIT(0) , kIsRequired = BIT(1) , kIsJustAdded = BIT(2) }
 TObject bits. More...
 
- Static Public Member Functions inherited from QObject
static QObjectNew (const char *object)
 

Detailed Description

Diana time.

Definition at line 17 of file QTime.hh.

Constructor & Destructor Documentation

◆ QTime() [1/2]

Q_BEGIN_NAMESPACE QTime::QTime ( )

default constructor

Definition at line 16 of file QTime.cc.

◆ QTime() [2/2]

QTime::QTime ( time_t  time)
inline

constructor from a time_t => only unixtime is set

Definition at line 23 of file QTime.hh.

References fFromStartRunNs, and fStartRunUnix.

◆ ~QTime()

QTime::~QTime ( )
virtual

default destructor

Definition at line 20 of file QTime.cc.

Member Function Documentation

◆ Clear()

void QTime::Clear ( )
virtual

clear values

Implements QObject.

Definition at line 24 of file QTime.cc.

References fFromStartRunNs, and fStartRunUnix.

◆ Dump()

void QTime::Dump ( std::ostream &  o) const
virtual

dump object

Reimplemented from QObject.

Definition at line 45 of file QTime.cc.

References GetFromStartRunNs(), and GetStartRunUnix().

◆ GetFromStartRunNs()

unsigned long long QTime::GetFromStartRunNs ( ) const
inline

retrieve time from start of run in ns

Definition at line 38 of file QTime.hh.

References fFromStartRunNs.

Referenced by MFlagCoincidence::Do(), MTimeSort::Do(), Dump(), and QASCII::WriteQTime().

◆ GetStartRunUnix()

time_t QTime::GetStartRunUnix ( ) const
inline

retrieve time of start of run in seconds from 1/1/1970

Definition at line 41 of file QTime.hh.

References fStartRunUnix.

Referenced by MTimeSort::Do(), Dump(), LHDRGlobalReader::Parse(), and QASCII::WriteQTime().

◆ GetTimeAsString()

std::string QTime::GetTimeAsString ( ) const
inline

retrieve time of event in string format

Definition at line 50 of file QTime.hh.

References GetTimeSec().

◆ GetTimeNSec()

unsigned int QTime::GetTimeNSec ( ) const
inline

retrieve time of event in nanoseconds from the last second

Definition at line 47 of file QTime.hh.

References fFromStartRunNs.

◆ GetTimeSec()

time_t QTime::GetTimeSec ( ) const
inline

retrieve time of event in seconds from 1/1/1970

Definition at line 44 of file QTime.hh.

References fFromStartRunNs, and fStartRunUnix.

Referenced by GetTimeAsString().

◆ operator<()

bool QTime::operator< ( const QTime other) const

operator<

Definition at line 59 of file QTime.cc.

References fFromStartRunNs, and fStartRunUnix.

◆ operator==()

bool QTime::operator== ( const QTime other) const

operator==

Definition at line 53 of file QTime.cc.

References fFromStartRunNs, and fStartRunUnix.

◆ QObjectDef()

QTime::QObjectDef ( QTime  ,
 
)
private

◆ SetFromStartRunNs()

void QTime::SetFromStartRunNs ( unsigned long long  time)
inline

set time from start of run in ns

Definition at line 29 of file QTime.hh.

References fFromStartRunNs.

Referenced by QASCII::ReadQTime().

◆ SetStartRunUnix() [1/2]

void QTime::SetStartRunUnix ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)

this method accepts year, day, month,hour min,sec format

Definition at line 30 of file QTime.cc.

References fStartRunUnix, and min().

◆ SetStartRunUnix() [2/2]

void QTime::SetStartRunUnix ( unsigned int  time)
inline

set time of start of run in seconds from 1/1/1970

Definition at line 32 of file QTime.hh.

References fStartRunUnix.

Referenced by LHDRGlobalReader::Parse(), and QASCII::ReadQTime().

Member Data Documentation

◆ fFromStartRunNs

unsigned long long QTime::fFromStartRunNs
private

◆ fStartRunUnix

unsigned int QTime::fStartRunUnix
private

Definition at line 67 of file QTime.hh.

Referenced by Clear(), GetStartRunUnix(), GetTimeSec(), operator<(), operator==(), QTime(), and SetStartRunUnix().


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