openscenegraph
osg::Stats Class Reference

#include <Stats>

Inheritance diagram for osg::Stats:
osg::Referenced

Public Types

typedef std::map< std::string, double > AttributeMap
typedef std::vector< AttributeMapAttributeMapList
typedef std::map< std::string, bool > CollectMap

Public Member Functions

 Stats (const std::string &name)
 Stats (const std::string &name, unsigned int numberOfFrames)
void setName (const std::string &name)
const std::string & getName () const
void allocate (unsigned int numberOfFrames)
unsigned int getEarliestFrameNumber () const
unsigned int getLatestFrameNumber () const
bool setAttribute (unsigned int frameNumber, const std::string &attributeName, double value)
bool getAttribute (unsigned int frameNumber, const std::string &attributeName, double &value) const
bool getAveragedAttribute (const std::string &attributeName, double &value, bool averageInInverseSpace=false) const
bool getAveragedAttribute (unsigned int startFrameNumber, unsigned int endFrameNumber, const std::string &attributeName, double &value, bool averageInInverseSpace=false) const
AttributeMapgetAttributeMap (unsigned int frameNumber)
const AttributeMapgetAttributeMap (unsigned int frameNumber) const
void collectStats (const std::string &str, bool flag)
bool collectStats (const std::string &str) const
void report (std::ostream &out, const char *indent=0) const
void report (std::ostream &out, unsigned int frameNumber, const char *indent=0) const
Public Member Functions inherited from osg::Referenced
 Referenced ()
 Referenced (bool threadSafeRefUnref)
 Referenced (const Referenced &)
Referencedoperator= (const Referenced &)
virtual void setThreadSafeRefUnref (bool)
bool getThreadSafeRefUnref () const
OpenThreads::MutexgetRefMutex () const
int ref () const
int unref () const
int unref_nodelete () const
int referenceCount () const
ObserverSetgetObserverSet () const
ObserverSetgetOrCreateObserverSet () const
void addObserver (Observer *observer) const
void removeObserver (Observer *observer) const

Protected Member Functions

virtual ~Stats ()
bool getAttributeNoMutex (unsigned int frameNumber, const std::string &attributeName, double &value) const
AttributeMapgetAttributeMapNoMutex (unsigned int frameNumber)
const AttributeMapgetAttributeMapNoMutex (unsigned int frameNumber) const
int getIndex (unsigned int frameNumber) const
Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
void deleteUsingDeleteHandler () const

Protected Attributes

std::string _name
OpenThreads::Mutex _mutex
unsigned int _baseFrameNumber
unsigned int _latestFrameNumber
AttributeMapList _attributeMapList
AttributeMap _invalidAttributeMap
CollectMap _collectMap
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
OpenThreads::Atomic _refCount

Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
static void setDeleteHandler (DeleteHandler *handler)
static DeleteHandlergetDeleteHandler ()

Member Typedef Documentation

◆ AttributeMap

typedef std::map<std::string, double> osg::Stats::AttributeMap

◆ AttributeMapList

◆ CollectMap

typedef std::map<std::string, bool> osg::Stats::CollectMap

Constructor & Destructor Documentation

◆ Stats() [1/2]

osg::Stats::Stats ( const std::string & name)

◆ Stats() [2/2]

osg::Stats::Stats ( const std::string & name,
unsigned int numberOfFrames )

◆ ~Stats()

virtual osg::Stats::~Stats ( )
inlineprotectedvirtual

Member Function Documentation

◆ allocate()

void osg::Stats::allocate ( unsigned int numberOfFrames)

◆ collectStats() [1/2]

bool osg::Stats::collectStats ( const std::string & str) const
inline

References _collectMap, and _mutex.

◆ collectStats() [2/2]

void osg::Stats::collectStats ( const std::string & str,
bool flag )
inline

References _collectMap.

◆ getAttribute()

bool osg::Stats::getAttribute ( unsigned int frameNumber,
const std::string & attributeName,
double & value ) const
inline

References _mutex, and getAttributeNoMutex().

◆ getAttributeMap() [1/2]

AttributeMap & osg::Stats::getAttributeMap ( unsigned int frameNumber)
inline

References _mutex, and getAttributeMapNoMutex().

◆ getAttributeMap() [2/2]

const AttributeMap & osg::Stats::getAttributeMap ( unsigned int frameNumber) const
inline

References _mutex, and getAttributeMapNoMutex().

◆ getAttributeMapNoMutex() [1/2]

AttributeMap & osg::Stats::getAttributeMapNoMutex ( unsigned int frameNumber)
protected

Referenced by getAttributeMap(), and getAttributeMap().

◆ getAttributeMapNoMutex() [2/2]

const AttributeMap & osg::Stats::getAttributeMapNoMutex ( unsigned int frameNumber) const
protected

◆ getAttributeNoMutex()

bool osg::Stats::getAttributeNoMutex ( unsigned int frameNumber,
const std::string & attributeName,
double & value ) const
protected

Referenced by getAttribute().

◆ getAveragedAttribute() [1/2]

bool osg::Stats::getAveragedAttribute ( const std::string & attributeName,
double & value,
bool averageInInverseSpace = false ) const

◆ getAveragedAttribute() [2/2]

bool osg::Stats::getAveragedAttribute ( unsigned int startFrameNumber,
unsigned int endFrameNumber,
const std::string & attributeName,
double & value,
bool averageInInverseSpace = false ) const

◆ getEarliestFrameNumber()

unsigned int osg::Stats::getEarliestFrameNumber ( ) const
inline

References _attributeMapList, and _latestFrameNumber.

Referenced by getIndex().

◆ getIndex()

int osg::Stats::getIndex ( unsigned int frameNumber) const
inlineprotected

◆ getLatestFrameNumber()

unsigned int osg::Stats::getLatestFrameNumber ( ) const
inline

References _latestFrameNumber.

◆ getName()

const std::string & osg::Stats::getName ( ) const
inline

References _name.

◆ report() [1/2]

void osg::Stats::report ( std::ostream & out,
const char * indent = 0 ) const

◆ report() [2/2]

void osg::Stats::report ( std::ostream & out,
unsigned int frameNumber,
const char * indent = 0 ) const

◆ setAttribute()

bool osg::Stats::setAttribute ( unsigned int frameNumber,
const std::string & attributeName,
double value )

◆ setName()

void osg::Stats::setName ( const std::string & name)
inline

References _name.

Member Data Documentation

◆ _attributeMapList

AttributeMapList osg::Stats::_attributeMapList
protected

Referenced by getEarliestFrameNumber(), and getIndex().

◆ _baseFrameNumber

unsigned int osg::Stats::_baseFrameNumber
protected

Referenced by getIndex().

◆ _collectMap

CollectMap osg::Stats::_collectMap
protected

Referenced by collectStats(), and collectStats().

◆ _invalidAttributeMap

AttributeMap osg::Stats::_invalidAttributeMap
protected

◆ _latestFrameNumber

unsigned int osg::Stats::_latestFrameNumber
protected

◆ _mutex

OpenThreads::Mutex osg::Stats::_mutex
mutableprotected

◆ _name

std::string osg::Stats::_name
protected

Referenced by getName(), and setName().


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