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

EMERGENCY 5 multiplayer per component value history. More...

#include <MapCacheStatistics.h>

Inheritance diagram for em5::multiplayer::MultiValueHistory:

Public Member Functions

 MultiValueHistory (const size_t historyLimit=40)
 Constructor. More...
 
void addEntryType (const std::string &name)
 
void addValue (uint8 componentId, uint64 value, uint16 timePassedInMilliseconds)
 Adds a value to the history of the given component. Nothing is added when the component id is unknown. More...
 
void saveToFile () const
 Saves the per component history as csv to a file named "mapcache_values.csv". The location is the application user data directory. More...
 
const std::unordered_map< uint8, ValueHistory > & getList () const
 Returns the list of the stored per component value history. More...
 
size_t getValueCount () const
 Returns how many entries each value history entry has (This value is only correct for all entries, when always for all components a value was added) More...
 

Detailed Description

EMERGENCY 5 multiplayer per component value history.

Constructor & Destructor Documentation

em5::multiplayer::MultiValueHistory::MultiValueHistory ( const size_t  historyLimit = 40)

Constructor.

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

Member Function Documentation

void em5::multiplayer::MultiValueHistory::addEntryType ( const std::string &  name)
void em5::multiplayer::MultiValueHistory::addValue ( uint8  componentId,
uint64  value,
uint16  timePassedInMilliseconds 
)

Adds a value to the history of the given component. Nothing is added when the component id is unknown.

Parameters
[in]componentIdThe id of the component for which the value should be added
[in]valueThe value to be inserted to the history
[in]timePassedInMillisecondsThe time passed since last value
const std::unordered_map< uint8, ValueHistory > & em5::multiplayer::MultiValueHistory::getList ( ) const
inline

Returns the list of the stored per component value history.

size_t em5::multiplayer::MultiValueHistory::getValueCount ( ) const
inline

Returns how many entries each value history entry has (This value is only correct for all entries, when always for all components a value was added)

void em5::multiplayer::MultiValueHistory::saveToFile ( ) const

Saves the per component history as csv to a file named "mapcache_values.csv". The location is the application user data directory.


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