Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::StatElem Class Reference

Single Statistics element, see Statistics for details. More...

#include <OSGStatElem.h>

Inheritance diagram for osg::StatElem:

osg::StatIntElem osg::StatIntOnceElem osg::StatRealElem osg::StatStringElem osg::StatTimeElem List of all members.

Instance

*bool isOn (void) const
void setOn (bool on)
StatElemDescBasegetDesc (void) const
virtual void putToString (std::string &str, const char *format=NULL) const =0
virtual bool getFromString (const Char8 *&inVal)=0
virtual Real64 getValue (void) const =0
virtual void reset (void)=0

Public Member Functions

Destructor
*virtual ~StatElem (void)
Creation
*virtual StatElemclone (void) const =0

Static Public Member Functions

Class Get
*static const char * getClassname (void)

Protected Member Functions

 StatElem (StatElemDescBase *desc)

Private Member Functions

 StatElem (const StatElem &source)
StatElemoperator= (const StatElem &source)

Private Attributes

bool _on
StatElemDescBase_desc

Detailed Description

The StatElem is the abstract base class for all the data types that can be recorded statistically. See Statistics for an overview of the statistics structure.

It mainly provides the general interfaces for accessing the statistics data as a Real64 value via getValue, if possible, and in ASCII via the putToString and getFromString methods. Additionally every StatElem can be switched on or off, to prevent collecting statistics that is not needed, via the setOn methods. Finally, ever StatElem can give information about itself in the form of a osg::StatElemDesc*.

/ext

To add a new StatElem type the given interface has to be implemented. There are no restrictions as to which types are possible, as long as they can be converted to and from a string. See StatIntElem for a simple example.

/endext

Definition at line 57 of file OSGStatElem.h.


Constructor & Destructor Documentation

StatElem::~StatElem void   )  [virtual]
 

Definition at line 109 of file OSGStatElem.cpp.

00110 {
00111 }

StatElem::StatElem StatElemDescBase desc  )  [protected]
 

Definition at line 103 of file OSGStatElem.cpp.

00104   : _on(true),_desc(desc)
00105 {
00106   ;
00107 }

osg::StatElem::StatElem const StatElem source  )  [private]
 


Member Function Documentation

* static const char* osg::StatElem::getClassname void   )  [inline, static]
 

Reimplemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

Definition at line 66 of file OSGStatElem.h.

00066 { return "StatElem"; }

bool osg::StatElem::isOn void   )  const [inline]
 

Definition at line 41 of file OSGStatElem.inl.

References _on.

00042 { 
00043     return _on; 
00044 }

void osg::StatElem::setOn bool  on  )  [inline]
 

Definition at line 46 of file OSGStatElem.inl.

References _on.

00047 { 
00048     _on = on; 
00049 }

StatElemDescBase * osg::StatElem::getDesc void   )  const [inline]
 

Definition at line 51 of file OSGStatElem.inl.

References _desc.

Referenced by osg::StatTimeElem::clone(), osg::StatStringElem::clone(), osg::StatRealElem::clone(), osg::StatIntOnceElem::clone(), osg::StatIntElem::clone(), and osg::SimpleStatisticsForeground::draw().

00052 { 
00053     return _desc; 
00054 }

virtual void osg::StatElem::putToString std::string &  str,
const char *  format = NULL
const [pure virtual]
 

Implemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

Referenced by osg::SimpleStatisticsForeground::draw().

virtual bool osg::StatElem::getFromString const Char8 *&  inVal  )  [pure virtual]
 

Implemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

Referenced by osg::StatCollector::getFromString().

virtual Real64 osg::StatElem::getValue void   )  const [pure virtual]
 

Implemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

Referenced by osg::GraphicStatisticsForeground::drawAnalog(), osg::GraphicStatisticsForeground::drawBar(), osg::GraphicStatisticsForeground::drawChart(), osg::GraphicStatisticsForeground::drawLineChart(), osg::GraphicStatisticsForeground::drawText(), and osg::StatCollector::getValue().

virtual void osg::StatElem::reset void   )  [pure virtual]
 

Implemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

Referenced by osg::DrawActionBase::start(), osg::PriorityAction::startEvent(), osg::NewActionBase::startEvent(), and osg::DepthFirstStateAction::startEvent().

bool StatElem::operator< const StatElem other  )  const
 

Comparison. This does not compare the actual values of the StatElem, as that may not be possible for all types.

Definition at line 134 of file OSGStatElem.cpp.

00135 {
00136     return this < &other;
00137 }

* virtual StatElem* osg::StatElem::clone void   )  const [pure virtual]
 

Implemented in osg::StatIntElem, osg::StatIntOnceElem, osg::StatRealElem, osg::StatStringElem, and osg::StatTimeElem.

StatElem & StatElem::operator= const StatElem source  )  [private]
 

Definition at line 115 of file OSGStatElem.cpp.

References _desc, and _on.

00116 {
00117     if (this == &source)
00118         return *this;
00119         
00120     // copy 
00121 
00122     _on = source._on;
00123     _desc = source._desc;
00124     
00125     return *this;
00126 }


Member Data Documentation

bool osg::StatElem::_on [private]
 

Definition at line 117 of file OSGStatElem.h.

Referenced by isOn(), operator=(), and setOn().

StatElemDescBase* osg::StatElem::_desc [private]
 

Definition at line 119 of file OSGStatElem.h.

Referenced by getDesc(), and operator=().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:22:49 2005 for OpenSG by  doxygen 1.4.3