#include <OSGStatIntOnceElem.h>

Public Types | |
| typedef std::set< UInt32 > | IdHash |
Public Member Functions | |
instance | |
| virtual void | reset (void) |
| void | add (UInt32 contributorId, Int32 v) |
| void | sub (UInt32 contributorId, Int32 v) |
| void | inc (UInt32 contributorId) |
| void | dec (UInt32 contributorId) |
| Int32 | get (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 StatIntOnceElem &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 | |
| StatIntOnceElem (StatElemDescBase *desc) | |
| virtual | ~StatIntOnceElem (void) |
Private Types | |
| typedef StatElem | Inherited |
Private Member Functions | |
| StatIntOnceElem (const StatIntOnceElem &source) | |
| StatIntOnceElem & | operator= (const StatIntOnceElem &source) |
Private Attributes | |
| Int32 | _value |
| IdHash | _ids |
Definition at line 72 of file OSGStatIntOnceElem.h.
| typedef std::set< UInt32 > osg::StatIntOnceElem::IdHash |
Definition at line 81 of file OSGStatIntOnceElem.h.
typedef StatElem osg::StatIntOnceElem::Inherited [private] |
Definition at line 159 of file OSGStatIntOnceElem.h.
| StatIntOnceElem::StatIntOnceElem | ( | StatElemDescBase * | desc | ) | [protected] |
| StatIntOnceElem::~StatIntOnceElem | ( | void | ) | [protected, virtual] |
| osg::StatIntOnceElem::StatIntOnceElem | ( | const StatIntOnceElem & | source | ) | [private] |
| static const char* osg::StatIntOnceElem::getClassname | ( | void | ) | [inline, static] |
| StatElem * StatIntOnceElem::create | ( | StatElemDescBase * | desc | ) | [static] |
Definition at line 79 of file OSGStatIntOnceElem.cpp.
References StatIntOnceElem().
00080 { 00081 return new StatIntOnceElem(desc); 00082 }
| void StatIntOnceElem::reset | ( | void | ) | [virtual] |
| void osg::StatIntOnceElem::inc | ( | UInt32 | contributorId | ) | [inline] |
| void osg::StatIntOnceElem::dec | ( | UInt32 | contributorId | ) | [inline] |
| Int32 osg::StatIntOnceElem::get | ( | void | ) | const [inline] |
Definition at line 78 of file OSGStatIntOnceElem.inl.
References _value.
Referenced by operator<().
00079 { 00080 return _value; 00081 }
| void StatIntOnceElem::putToString | ( | std::string & | str, | |
| const char * | format = NULL | |||
| ) | const [virtual] |
Implements osg::StatElem.
Definition at line 91 of file OSGStatIntOnceElem.cpp.
References _value.
00092 { 00093 if(!format) 00094 { 00095 FieldDataTraits<Int32>::putToString(_value, str); 00096 } 00097 else 00098 { 00099 char *temp = new char [strlen(format) + 40]; 00100 sprintf(temp, format, _value); 00101 str = temp; 00102 delete [] temp; 00103 } 00104 }
| bool StatIntOnceElem::getFromString | ( | const Char8 *& | inVal | ) | [virtual] |
Implements osg::StatElem.
Definition at line 106 of file OSGStatIntOnceElem.cpp.
References _value.
00107 { 00108 return FieldDataTraits<Int32>::getFromString(_value, inVal); 00109 }
| Real64 StatIntOnceElem::getValue | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 111 of file OSGStatIntOnceElem.cpp.
00112 { 00113 return static_cast<Real64>(get()); 00114 }
| bool StatIntOnceElem::operator< | ( | const StatIntOnceElem & | other | ) | const |
Definition at line 137 of file OSGStatIntOnceElem.cpp.
References get().
00138 { 00139 return this->get() < other.get(); 00140 }
| StatElem * StatIntOnceElem::clone | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 144 of file OSGStatIntOnceElem.cpp.
References osg::StatElem::getDesc(), and StatIntOnceElem().
00145 { 00146 StatIntOnceElem *e = new StatIntOnceElem(getDesc()); 00147 00148 *e = *this; 00149 00150 return e; 00151 }
Implements osg::StatElem.
Definition at line 155 of file OSGStatIntOnceElem.cpp.
00156 { 00157 const StatIntOnceElem *o = dynamic_cast<const StatIntOnceElem *>(&other); 00158 00159 _value += o->_value; 00160 00161 IdHash::const_iterator it = o->_ids.begin(); 00162 00163 while (it != o->_ids.end()) 00164 { 00165 _ids.insert(*it); 00166 ++it; 00167 } 00168 00169 return *this; 00170 }
| StatIntOnceElem & StatIntOnceElem::operator= | ( | const StatIntOnceElem & | source | ) | [private] |
| 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 osg::StatTimeStampElem::clone(), osg::StatTimeElem::clone(), osg::StatStringElem::clone(), osg::StatRealElem::clone(), 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.
Int32 osg::StatIntOnceElem::_value [private] |
Definition at line 161 of file OSGStatIntOnceElem.h.
Referenced by add(), dec(), get(), getFromString(), inc(), operator+=(), operator=(), putToString(), reset(), and sub().
IdHash osg::StatIntOnceElem::_ids [private] |
Definition at line 163 of file OSGStatIntOnceElem.h.
Referenced by add(), dec(), inc(), operator+=(), operator=(), reset(), and sub().
1.5.5