Diana Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QInterval Class Reference

Interval of real numbers. More...

Inheritance diagram for QInterval:
QObject

Public Member Functions

 QInterval (const double min, const double max)
 Constructor. More...
 
 QInterval ()
 constructor More...
 
virtual ~QInterval ()
 Destructor. More...
 
void Clear ()
 Clear. More...
 
bool operator< (const QInterval &interval) const
 Less than operator like std::pair. More...
 
bool operator== (const QInterval &other) const
 operator== More...
 
bool Contains (const double value) const
 Return whether the interval contains a value. More...
 
bool Contains (const QInterval &interval) const
 Return whether the interval contains another interval. More...
 
double GetMax () const
 Get maximum of interval. More...
 
double GetMin () const
 Get minimum of interval. More...
 
bool Intersects (const QInterval &interval) const
 Return whether the interval intersects another interval. More...
 
double Length () const
 Get length of interval. More...
 
void SetMax (const double max)
 Set maximum of the interval. More...
 
void SetMin (const double min)
 Set minimum of the interval. 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 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="")
 

Protected Member Functions

 QObjectDef (QInterval, 1)
 

Protected Attributes

double fMax
 Maximum of interval. More...
 
double fMin
 Minimum of interval. More...
 

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

Interval of real numbers.

Author
Adam Bryant (adam_.nosp@m.brya.nosp@m.nt@be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u)

Definition at line 17 of file QInterval.hh.

Constructor & Destructor Documentation

◆ QInterval() [1/2]

Q_BEGIN_NAMESPACE QInterval::QInterval ( const double  min,
const double  max 
)

Constructor.

Definition at line 7 of file QInterval.cc.

References fMax, fMin, max, and min().

◆ QInterval() [2/2]

QInterval::QInterval ( )

constructor

Definition at line 19 of file QInterval.cc.

References fMax, fMin, and Q_DOUBLE_DEFAULT.

◆ ~QInterval()

QInterval::~QInterval ( )
virtual

Destructor.

Definition at line 26 of file QInterval.cc.

Member Function Documentation

◆ Clear()

void QInterval::Clear ( )
inlinevirtual

Clear.

Implements QObject.

Definition at line 29 of file QInterval.hh.

References Q_DOUBLE_DEFAULT, SetMax(), and SetMin().

Referenced by QEnergyRangesHandle::FillFromDB().

◆ Contains() [1/2]

bool QInterval::Contains ( const double  value) const
inline

Return whether the interval contains a value.

Definition at line 45 of file QInterval.hh.

References GetMax(), and GetMin().

Referenced by Intersects().

◆ Contains() [2/2]

bool QInterval::Contains ( const QInterval interval) const
inline

Return whether the interval contains another interval.

Definition at line 49 of file QInterval.hh.

References GetMax(), and GetMin().

◆ GetMax()

double QInterval::GetMax ( ) const
inline

Get maximum of interval.

Definition at line 54 of file QInterval.hh.

References fMax.

Referenced by Contains(), QIntervalSet::Insert(), Intersects(), Length(), operator<(), and QEnergyRangesHandle::StoreOnDB().

◆ GetMin()

double QInterval::GetMin ( ) const
inline

Get minimum of interval.

Definition at line 57 of file QInterval.hh.

References fMin.

Referenced by Contains(), QIntervalSet::Insert(), Intersects(), Length(), operator<(), and QEnergyRangesHandle::StoreOnDB().

◆ Intersects()

bool QInterval::Intersects ( const QInterval interval) const
inline

Return whether the interval intersects another interval.

Definition at line 60 of file QInterval.hh.

References Contains(), GetMax(), and GetMin().

◆ Length()

double QInterval::Length ( ) const
inline

Get length of interval.

Definition at line 65 of file QInterval.hh.

References GetMax(), and GetMin().

◆ operator<()

bool QInterval::operator< ( const QInterval interval) const
inline

Less than operator like std::pair.

Definition at line 35 of file QInterval.hh.

References GetMax(), and GetMin().

◆ operator==()

bool QInterval::operator== ( const QInterval other) const
inline

operator==

Definition at line 42 of file QInterval.hh.

References fMax, and fMin.

◆ QObjectDef()

QInterval::QObjectDef ( QInterval  ,
 
)
protected

◆ SetMax()

void QInterval::SetMax ( const double  max)
inline

Set maximum of the interval.

Definition at line 68 of file QInterval.hh.

References fMax, and max.

Referenced by Clear(), QEnergyRangesHandle::FillFromDB(), MPulseTimeConstants::Init(), and QIntervalSet::Insert().

◆ SetMin()

void QInterval::SetMin ( const double  min)
inline

Set minimum of the interval.

Definition at line 71 of file QInterval.hh.

References fMin, and min().

Referenced by Clear(), QEnergyRangesHandle::FillFromDB(), MPulseTimeConstants::Init(), and QIntervalSet::Insert().

Member Data Documentation

◆ fMax

double QInterval::fMax
protected

Maximum of interval.

Definition at line 75 of file QInterval.hh.

Referenced by GetMax(), operator==(), QInterval(), and SetMax().

◆ fMin

double QInterval::fMin
protected

Minimum of interval.

Definition at line 78 of file QInterval.hh.

Referenced by GetMin(), operator==(), QInterval(), and SetMin().


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