Sirikata
Public Member Functions | Private Attributes
Sirikata::Trace::WindowedStats< SampleType > Class Template Reference

Tracks a window of a fixed number of recent samples and can report statistics about them, e.g. More...

#include <WindowedStats.hpp>

Collaboration diagram for Sirikata::Trace::WindowedStats< SampleType >:

List of all members.

Public Member Functions

 WindowedStats (std::size_t nsamples)
void sample (const SampleType &s)
 Record a sample.
SampleType average () const
const CircularBuffer
< SampleType > & 
getSamples () const

Private Attributes

CircularBuffer< SampleType > mSamples

Detailed Description

template<typename SampleType>
class Sirikata::Trace::WindowedStats< SampleType >

Tracks a window of a fixed number of recent samples and can report statistics about them, e.g.

average, max, min, etc. The sample type must specify basic math operations.


Constructor & Destructor Documentation

template<typename SampleType >
Sirikata::Trace::WindowedStats< SampleType >::WindowedStats ( std::size_t  nsamples) [inline]

Member Function Documentation

template<typename SampleType >
SampleType Sirikata::Trace::WindowedStats< SampleType >::average ( ) const [inline]
template<typename SampleType >
const CircularBuffer<SampleType>& Sirikata::Trace::WindowedStats< SampleType >::getSamples ( ) const [inline]
template<typename SampleType >
void Sirikata::Trace::WindowedStats< SampleType >::sample ( const SampleType &  s) [inline]

Member Data Documentation

template<typename SampleType >
CircularBuffer<SampleType> Sirikata::Trace::WindowedStats< SampleType >::mSamples [private]

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