Class GraphableNumber.

Inherits Garbage. Inherited by GraphableCounter and GraphableDataSet.

The GraphableNumber class keeps track of past values of a number, and can compute averages for the recent past.

When created, an object records itself by name, and there is a static function to obtain a list of all the objects.

Objects of this class cannot be deleted. Once created, statistics are forever.

GraphableNumber::GraphableNumber( const EString & name )

Constructs a number called name.

uint GraphableNumber::averageSince( uint t ) const

Returns the average value since time t. Overflow is not handled.

void GraphableNumber::clearOldHistory( uint t )

This private helper gets rid of all expired history and makes sure that the maximum and minimum ends of the range encompass t.

uint GraphableNumber::lastValue() const

Returns the most recent stored value.

uint GraphableNumber::maximumSince( uint t ) const

Returns the maximum value since time t.

uint GraphableNumber::minimumSince( uint t ) const

Returns the minimum value since time t.

EString GraphableNumber::name() const

Returns the name supplied to this object's constructor.

uint GraphableNumber::oldestTime() const

Returns the oldest time for which a value is recorded.

void GraphableNumber::setValue( uint v )

Records the current value as v. The current time (with second resolution) is implicitly also recorded.

uint GraphableNumber::value( uint t )

Returns the value at time t, or 0 if t is out of bounds.

uint GraphableNumber::youngestTime() const

Returns the youngest time for which a value is recorded.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.