OpenSceneGraph  3.5.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osg::Stats Class Reference
Inheritance diagram for osg::Stats:
Inheritance graph
[legend]

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 threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::Mutex * getRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

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::Mutex * getGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 Set whether reference counting should use a mutex for thread safe reference counting. More...
 
static bool getThreadSafeReferenceCounting ()
 Get whether reference counting is active. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

Member Function Documentation

void osg::Stats::allocate ( unsigned int  numberOfFrames)
void osg::Stats::collectStats ( const std::string &  str,
bool  flag 
)
inline
bool osg::Stats::collectStats ( const std::string &  str) const
inline
bool osg::Stats::getAttribute ( unsigned int  frameNumber,
const std::string &  attributeName,
double &  value 
) const
inline
AttributeMap& osg::Stats::getAttributeMap ( unsigned int  frameNumber)
inline
const AttributeMap& osg::Stats::getAttributeMap ( unsigned int  frameNumber) const
inline
AttributeMap& osg::Stats::getAttributeMapNoMutex ( unsigned int  frameNumber)
protected
const AttributeMap& osg::Stats::getAttributeMapNoMutex ( unsigned int  frameNumber) const
protected
bool osg::Stats::getAttributeNoMutex ( unsigned int  frameNumber,
const std::string &  attributeName,
double &  value 
) const
protected
bool osg::Stats::getAveragedAttribute ( const std::string &  attributeName,
double &  value,
bool  averageInInverseSpace = false 
) const
bool osg::Stats::getAveragedAttribute ( unsigned int  startFrameNumber,
unsigned int  endFrameNumber,
const std::string &  attributeName,
double &  value,
bool  averageInInverseSpace = false 
) const
unsigned int osg::Stats::getEarliestFrameNumber ( ) const
inline
int osg::Stats::getIndex ( unsigned int  frameNumber) const
inlineprotected
unsigned int osg::Stats::getLatestFrameNumber ( ) const
inline
const std::string& osg::Stats::getName ( ) const
inline
void osg::Stats::report ( std::ostream &  out,
const char *  indent = 0 
) const
void osg::Stats::report ( std::ostream &  out,
unsigned int  frameNumber,
const char *  indent = 0 
) const
bool osg::Stats::setAttribute ( unsigned int  frameNumber,
const std::string &  attributeName,
double  value 
)
void osg::Stats::setName ( const std::string &  name)
inline

Member Data Documentation

AttributeMapList osg::Stats::_attributeMapList
protected
unsigned int osg::Stats::_baseFrameNumber
protected
CollectMap osg::Stats::_collectMap
protected
AttributeMap osg::Stats::_invalidAttributeMap
protected
unsigned int osg::Stats::_latestFrameNumber
protected
OpenThreads::Mutex osg::Stats::_mutex
mutableprotected
std::string osg::Stats::_name
protected

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

osg logo
Generated at Wed Nov 11 2015 22:14:43 for the OpenSceneGraph by doxygen 1.8.10.