Emergency 20 Dokumentation  4.2.0
em5::multiplayer::ValueHistory Class Reference

EMERGENCY 5 multiplayer value history. More...

#include <MapCacheStatistics.h>

Inheritance diagram for em5::multiplayer::ValueHistory:

Public Member Functions

 ValueHistory (size_t historyLimit)
 Constructor. More...
 
void addValue (uint64 value, uint16 timePassedInMilliseconds)
 Adds a value to the history. When the maximum limit is reached the "oldest" value (first element in the list) gets removed. More...
 
const std::vector< uint64 > & getValues () const
 Returns the stored values. More...
 
const boost::container::flat_map< uint16, uint64 > & getPerSecondValues () const
 Returns the stored per second values. More...
 
uint64 getLowestValue () const
 Returns the lowest value which was added to the history. More...
 
uint64 getHighestValue () const
 Returns the highest value which was added to the history. More...
 

Detailed Description

EMERGENCY 5 multiplayer value history.

Constructor & Destructor Documentation

em5::multiplayer::ValueHistory::ValueHistory ( size_t  historyLimit)

Constructor.

Parameters
[in]historyLimitThe maximum limit of values to be stored, a value of zero (0) indicates unlimited storage (use this with caution)

Member Function Documentation

void em5::multiplayer::ValueHistory::addValue ( uint64  value,
uint16  timePassedInMilliseconds 
)

Adds a value to the history. When the maximum limit is reached the "oldest" value (first element in the list) gets removed.

Parameters
[in]valueThe value to be inserted to the history
[in]timePassedInMillisecondsThe time passed since last value
uint64 em5::multiplayer::ValueHistory::getHighestValue ( ) const
inline

Returns the highest value which was added to the history.

uint64 em5::multiplayer::ValueHistory::getLowestValue ( ) const
inline

Returns the lowest value which was added to the history.

const boost::container::flat_map< uint16, uint64 > & em5::multiplayer::ValueHistory::getPerSecondValues ( ) const
inline

Returns the stored per second values.

const std::vector< uint64 > & em5::multiplayer::ValueHistory::getValues ( ) const
inline

Returns the stored values.


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