80 lines
2.6 KiB
C++
80 lines
2.6 KiB
C++
/*
|
|
* File: VectorStatistic.cc
|
|
* Author: jgaebler
|
|
*
|
|
* Created on June 22, 2011, 4:02 PM
|
|
*/
|
|
|
|
#include "VectorStatistic.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @brief Constructor.
|
|
* @param name The name of the value to record.
|
|
*/
|
|
VectorStatistic::VectorStatistic(const char * name) : stat(name) {
|
|
}
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
VectorStatistic::~VectorStatistic() {
|
|
}
|
|
|
|
|
|
/**
|
|
* @brief Records a time value
|
|
* @param t The time to record.
|
|
* @return The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.).
|
|
*/
|
|
bool
|
|
VectorStatistic::record(const GenericTime & t) {
|
|
return stat.record(t.getTime());
|
|
}
|
|
|
|
/**
|
|
* @brief Records a value.
|
|
* @param value The value to record.
|
|
* @return The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.).
|
|
*/
|
|
bool
|
|
VectorStatistic::record(double value) {
|
|
return stat.record(value);
|
|
}
|
|
|
|
/**
|
|
* @brief Records a value with the current time as timestamp.
|
|
* @param value The value to record.
|
|
* @return The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.).
|
|
*/
|
|
bool
|
|
VectorStatistic::recordWithTimestamp(double value) {
|
|
return recordWithTimestamp(GenericTime::currentTime().getTime(), value);
|
|
}
|
|
|
|
/**
|
|
* @brief Records a value with the current time as timestamp.
|
|
* @param value The value to record.
|
|
* @param time The corresponding timestamp
|
|
* @return The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.).
|
|
*/
|
|
bool
|
|
VectorStatistic::recordWithTimestamp(const BaseTime & time, const double value) {
|
|
return stat.recordWithTimestamp(time, value);
|
|
}
|
|
|
|
/**
|
|
* @brief Returns the number of values actually stored by this output vector object.
|
|
* The values passed while the object was disabled (via disable(),
|
|
* environment configuration, filtering, etc.) do not count.
|
|
* @returns Returns the number of values actually stored by this vector statistic instance.
|
|
*/
|
|
size_t
|
|
VectorStatistic::getValuesStored() {
|
|
return stat.getValuesStored();
|
|
}
|
|
}
|
|
}
|