#include <OSGStatIntElem.h>

Public Member Functions | |
instance | |
| void | set (Int32 value) |
| Int32 | get (void) const |
| void | add (Int32 v) |
| void | sub (Int32 v) |
| virtual void | reset (void) |
| void | inc (void) |
| void | dec (void) |
| 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 StatIntElem &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 | |
| StatIntElem (StatElemDescBase *desc) | |
| virtual | ~StatIntElem (void) |
Private Types | |
| typedef StatElem | Inherited |
Private Member Functions | |
| StatIntElem (const StatIntElem &source) | |
| StatIntElem & | operator= (const StatIntElem &source) |
Private Attributes | |
| Int32 | _value |
Definition at line 57 of file OSGStatIntElem.h.
typedef StatElem osg::StatIntElem::Inherited [private] |
Definition at line 140 of file OSGStatIntElem.h.
| StatIntElem::StatIntElem | ( | StatElemDescBase * | desc | ) | [protected] |
| StatIntElem::~StatIntElem | ( | void | ) | [protected, virtual] |
| osg::StatIntElem::StatIntElem | ( | const StatIntElem & | source | ) | [private] |
| static const char* osg::StatIntElem::getClassname | ( | void | ) | [inline, static] |
| StatElem * StatIntElem::create | ( | StatElemDescBase * | desc | ) | [static] |
Definition at line 76 of file OSGStatIntElem.cpp.
References StatIntElem().
00077 { 00078 return new StatIntElem(desc); 00079 }
| void osg::StatIntElem::set | ( | Int32 | value | ) | [inline] |
| Int32 osg::StatIntElem::get | ( | void | ) | const [inline] |
Definition at line 46 of file OSGStatIntElem.inl.
References _value.
Referenced by operator<(), and operator=().
00047 { 00048 return _value; 00049 }
| void osg::StatIntElem::add | ( | Int32 | v | ) | [inline] |
Definition at line 51 of file OSGStatIntElem.inl.
References _value.
Referenced by osg::Slices::drawPrimitives(), and osg::Geometry::drawPrimitives().
00052 { 00053 _value += v; 00054 }
| void osg::StatIntElem::sub | ( | Int32 | v | ) | [inline] |
Definition at line 56 of file OSGStatIntElem.inl.
References _value.
00057 { 00058 _value -= v; 00059 }
| void StatIntElem::reset | ( | void | ) | [virtual] |
Implements osg::StatElem.
Definition at line 113 of file OSGStatIntElem.cpp.
References _value.
00114 { 00115 _value = 0; 00116 }
| void osg::StatIntElem::inc | ( | void | ) | [inline] |
Definition at line 61 of file OSGStatIntElem.inl.
References _value.
00062 { 00063 _value++; 00064 }
| void osg::StatIntElem::dec | ( | void | ) | [inline] |
Definition at line 66 of file OSGStatIntElem.inl.
References _value.
00067 { 00068 _value--; 00069 }
| void StatIntElem::putToString | ( | std::string & | str, | |
| const char * | format = NULL | |||
| ) | const [virtual] |
Implements osg::StatElem.
Definition at line 87 of file OSGStatIntElem.cpp.
References _value.
00088 { 00089 if(!format) 00090 { 00091 FieldDataTraits<Int32>::putToString(_value, str); 00092 } 00093 else 00094 { 00095 char *temp = new char [strlen(format) + 40]; 00096 sprintf(temp, format, _value); 00097 str = temp; 00098 delete [] temp; 00099 } 00100 }
| bool StatIntElem::getFromString | ( | const Char8 *& | inVal | ) | [virtual] |
Implements osg::StatElem.
Definition at line 102 of file OSGStatIntElem.cpp.
References _value.
00103 { 00104 return FieldDataTraits<Int32>::getFromString(_value, inVal); 00105 }
| Real64 StatIntElem::getValue | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 107 of file OSGStatIntElem.cpp.
00108 { 00109 return static_cast<Real64>(get()); 00110 }
| bool StatIntElem::operator< | ( | const StatIntElem & | other | ) | const |
Definition at line 132 of file OSGStatIntElem.cpp.
References get().
00133 { 00134 return this->get() < other.get(); 00135 }
| StatElem * StatIntElem::clone | ( | void | ) | const [virtual] |
Implements osg::StatElem.
Definition at line 139 of file OSGStatIntElem.cpp.
References osg::StatElem::getDesc(), and StatIntElem().
00140 { 00141 StatIntElem *e = new StatIntElem(getDesc()); 00142 00143 *e = *this; 00144 00145 return e; 00146 }
Implements osg::StatElem.
Definition at line 150 of file OSGStatIntElem.cpp.
References _value.
00151 { 00152 const StatIntElem *o = dynamic_cast<const StatIntElem *>(&other); 00153 00154 _value += o->_value; 00155 00156 return *this; 00157 }
| StatIntElem & StatIntElem::operator= | ( | const StatIntElem & | source | ) | [private] |
Definition at line 120 of file OSGStatIntElem.cpp.
References get().
00121 { 00122 if (this == &source) 00123 return *this; 00124 00125 set(source.get()); 00126 00127 return *this; 00128 }
| 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(), osg::StatIntOnceElem::clone(), 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::StatIntElem::_value [private] |
Definition at line 142 of file OSGStatIntElem.h.
Referenced by add(), dec(), get(), getFromString(), inc(), operator+=(), putToString(), reset(), set(), and sub().
1.5.5