Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::StatsCounter Class Reference

General-purpose statistics counter. More...

#include <mitsuba/core/statistics.h>

Public Member Functions

 StatsCounter (const std::string &category, const std::string &name, EStatsType type=ENumberValue, uint64_t initial=0L, uint64_t base=0L)
 Create a new statistics counter. More...
 
 ~StatsCounter ()
 Free all storage used by the counter. More...
 
uint64_t operator++ ()
 Increment the counter value by one. More...
 
void operator+= (size_t amount)
 Increment the counter by the specified amount. More...
 
void incrementBase (size_t amount=1)
 Increment the base counter by the specified amount (only for use with EPercentage/EAverage) More...
 
void recordMinimum (size_t value)
 When this is a minimum "counter", this function records an observation of the quantity whose minimum is to be determined. More...
 
void recordMaximum (size_t value)
 When this is a maximum "counter", this function records an observation of the quantity whose maximum is to be determined. More...
 
const std::string & getName () const
 Return the name of this counter. More...
 
const std::string & getCategory () const
 Return the category of this counter. More...
 
EStatsType getType () const
 Return the type of this counter. More...
 
uint64_t getValue () const
 Return the value of this counter as 64-bit unsigned integer. More...
 
uint64_t getMinimum () const
 
uint64_t getMaximum () const
 
uint64_t getBase () const
 Get the reference number (only used with the EPercentage/EAverage counter type) More...
 
void reset ()
 Reset the stored counter values. More...
 
bool operator< (const StatsCounter &v) const
 Sorting by name (for the statistics) More...
 

Detailed Description

General-purpose statistics counter.

This class implements a simple counter, which can be used to track various quantities within Mitsuba. At various points during the execution, it is possible to then call Statistics::printStats() to get a human-readable report of their values.

Constructor & Destructor Documentation

mitsuba::StatsCounter::StatsCounter ( const std::string &  category,
const std::string &  name,
EStatsType  type = ENumberValue,
uint64_t  initial = 0L,
uint64_t  base = 0L 
)

Create a new statistics counter.

Parameters
categoryCategory of the counter when shown in the statistics summary
nameName of the counter when shown in the statistics summary
typeCharacterization of the quantity that will be measured
initialInitial value of the counter
baseInitial value of the base counter (only for type == EPercentage and EAverage)
mitsuba::StatsCounter::~StatsCounter ( )

Free all storage used by the counter.

Member Function Documentation

uint64_t mitsuba::StatsCounter::getBase ( ) const
inline

Get the reference number (only used with the EPercentage/EAverage counter type)

const std::string& mitsuba::StatsCounter::getCategory ( ) const
inline

Return the category of this counter.

uint64_t mitsuba::StatsCounter::getMaximum ( ) const
inline
uint64_t mitsuba::StatsCounter::getMinimum ( ) const
inline
const std::string& mitsuba::StatsCounter::getName ( ) const
inline

Return the name of this counter.

EStatsType mitsuba::StatsCounter::getType ( ) const
inline

Return the type of this counter.

uint64_t mitsuba::StatsCounter::getValue ( ) const
inline

Return the value of this counter as 64-bit unsigned integer.

void mitsuba::StatsCounter::incrementBase ( size_t  amount = 1)
inline

Increment the base counter by the specified amount (only for use with EPercentage/EAverage)

uint64_t mitsuba::StatsCounter::operator++ ( )
inline

Increment the counter value by one.

void mitsuba::StatsCounter::operator+= ( size_t  amount)
inline

Increment the counter by the specified amount.

bool mitsuba::StatsCounter::operator< ( const StatsCounter v) const

Sorting by name (for the statistics)

void mitsuba::StatsCounter::recordMaximum ( size_t  value)
inline

When this is a maximum "counter", this function records an observation of the quantity whose maximum is to be determined.

void mitsuba::StatsCounter::recordMinimum ( size_t  value)
inline

When this is a minimum "counter", this function records an observation of the quantity whose minimum is to be determined.

void mitsuba::StatsCounter::reset ( )
inline

Reset the stored counter values.


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