#include <OSGStatTimeStampElem.h>

Public Member Functions | |
instance | |
| virtual void | reset (void) |
| const TimeStamp & | start (void) |
| const TimeStamp & | stop (void) |
| const TimeStamp & | getTime (void) const |
| virtual void | putToString (std::string &str, const char *format=NULL) const |
| virtual bool | getFromString (const Char8 *&inVal) |
| virtual Real64 | getValue (void) const |
comparison | |
| bool | operator< (const StatTimeStampElem &other) const |
Creation | |
| virtual StatElem * | clone (void) const |
Operators | |
| virtual StatElem & | operator+= (const StatElem &other) |
Instance | |
| bool | isOn (void) const |
| void | setOn (bool on) |
| StatElemDescBase * | getDesc (void) const |
Comparison | |
| bool | operator< (const StatElem &other) const |
Static Public Member Functions | |
Class Get | |
| static const char * | getClassname (void) |
your_category | |
| static StatElem * | create (StatElemDescBase *desc) |
Protected Member Functions | |
Constructors | |
| StatTimeStampElem (StatElemDescBase *desc) | |
| virtual | ~StatTimeStampElem (void) |
Private Types | |
| typedef StatElem | Inherited |
Private Member Functions | |
| StatTimeStampElem (const StatTimeStampElem &source) | |
| StatTimeStampElem & | operator= (const StatTimeStampElem &source) |
Private Attributes | |
| TimeStamp | _time |
Definition at line 60 of file OSGStatTimeStampElem.h.
typedef StatElem osg::StatTimeStampElem::Inherited [private] |
Definition at line 137 of file OSGStatTimeStampElem.h.
| StatTimeStampElem::StatTimeStampElem | ( | StatElemDescBase * | desc | ) | [protected] |
| StatTimeStampElem::~StatTimeStampElem | ( | void | ) | [protected, virtual] |
| osg::StatTimeStampElem::StatTimeStampElem | ( | const StatTimeStampElem & | source | ) | [private] |
| static const char* osg::StatTimeStampElem::getClassname | ( | void | ) | [inline, static] |
| StatElem * StatTimeStampElem::create | ( | StatElemDescBase * | desc | ) | [static] |
Definition at line 76 of file OSGStatTimeStampElem.cpp.
References StatTimeStampElem().
00077 { 00078 return new StatTimeStampElem(desc); 00079 }
| void StatTimeStampElem::reset | ( | void | ) | [virtual] |
| const TimeStamp & osg::StatTimeStampElem::start | ( | void | ) | [inline] |
Definition at line 41 of file OSGStatTimeStampElem.inl.
References _time, and osg::getTimeStamp().
00042 { 00043 return (_time = getTimeStamp()); 00044 }
| const TimeStamp & osg::StatTimeStampElem::stop | ( | void | ) | [inline] |
Definition at line 46 of file OSGStatTimeStampElem.inl.
References _time, and osg::getTimeStamp().
00047 { 00048 return (_time = (getTimeStamp() - _time)); 00049 }
| const TimeStamp & osg::StatTimeStampElem::getTime | ( | void | ) | const [inline] |
Definition at line 51 of file OSGStatTimeStampElem.inl.
References _time.
Referenced by getValue().
00052 { 00053 return _time; 00054 }
| void StatTimeStampElem::putToString | ( | std::string & | str, | |
| const char * | format = NULL | |||
| ) | const [virtual] |
Implements osg::StatElem.
Definition at line 88 of file OSGStatTimeStampElem.cpp.
References _time, and osg::getTimeStampMsecs().
00089 { 00090 double time = getTimeStampMsecs(_time) / 1000.; 00091 00092 if(!format) 00093 { 00094 FieldDataTraits<TimeStamp>::putToString(_time, str); 00095 } 00096 else 00097 { 00098 const char *proc = strchr(format,'%'); 00099 char *temp = new char [strlen(format) + 60]; 00100 00101 if(proc) 00102 { 00103 if(! strncmp(proc, "%ms", 3)) 00104 { 00105 std::string fcopy(format); 00106 fcopy.insert((proc - format) + 1,".2f "); 00107 sprintf(temp, fcopy.c_str(), time*1000.); 00108 } 00109 else if(! strncmp(proc, "%r", 2)) 00110 { 00111 std::string fcopy(format); 00112 fcopy.erase((proc - format) + 1, 1); 00113 sprintf(temp, fcopy.c_str(), 1./time); 00114 } 00115 else 00116 { 00117 sprintf(temp, format, time); 00118 } 00119 00120 } 00121 else 00122 { 00123 sprintf(temp, format, time); 00124 } 00125 00126 str = temp; 00127 delete [] temp; 00128 } 00129 }
| bool StatTimeStampElem::getFromString | ( | const Char8 *& | inVal | ) | [virtual] |
Implements osg::StatElem.
Definition at line 131 of file OSGStatTimeStampElem.cpp.
References _time.
00132 { 00133 return FieldDataTraits<TimeStamp>::getFromString(_time, inVal); 00134 }
| Real64 StatTimeStampElem::getValue | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 136 of file OSGStatTimeStampElem.cpp.
References getTime().
| bool StatTimeStampElem::operator< | ( | const StatTimeStampElem & | other | ) | const |
| StatElem * StatTimeStampElem::clone | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 167 of file OSGStatTimeStampElem.cpp.
References osg::StatElem::getDesc(), and StatTimeStampElem().
00168 { 00169 StatTimeStampElem *e = new StatTimeStampElem(getDesc()); 00170 00171 *e = *this; 00172 00173 return e; 00174 }
Implements osg::StatElem.
Definition at line 178 of file OSGStatTimeStampElem.cpp.
References _time.
00179 { 00180 const StatTimeStampElem *o = dynamic_cast<const StatTimeStampElem *>(&other); 00181 00182 _time += o->_time; 00183 00184 return *this; 00185 }
| StatTimeStampElem & StatTimeStampElem::operator= | ( | const StatTimeStampElem & | source | ) | [private] |
Definition at line 148 of file OSGStatTimeStampElem.cpp.
References _time.
00149 { 00150 if (this == &source) 00151 return *this; 00152 00153 _time = source._time; 00154 00155 return *this; 00156 }
| bool osg::StatElem::isOn | ( | void | ) | const [inline, inherited] |
Definition at line 41 of file OSGStatElem.inl.
References osg::StatElem::_on.
00042 { 00043 return _on; 00044 }
| void osg::StatElem::setOn | ( | bool | on | ) | [inline, inherited] |
Definition at line 46 of file OSGStatElem.inl.
References osg::StatElem::_on.
00047 { 00048 _on = on; 00049 }
| StatElemDescBase * osg::StatElem::getDesc | ( | void | ) | const [inline, inherited] |
Definition at line 51 of file OSGStatElem.inl.
References osg::StatElem::_desc.
Referenced by clone(), osg::StatTimeElem::clone(), osg::StatStringElem::clone(), osg::StatRealElem::clone(), osg::StatIntOnceElem::clone(), osg::StatIntElem::clone(), and osg::SimpleStatisticsForeground::draw().
00052 { 00053 return _desc; 00054 }
| bool StatElem::operator< | ( | const StatElem & | other | ) | const [inherited] |
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.
TimeStamp osg::StatTimeStampElem::_time [private] |
Definition at line 139 of file OSGStatTimeStampElem.h.
Referenced by getFromString(), getTime(), operator+=(), operator<(), operator=(), putToString(), start(), and stop().
1.5.5