/* * File: HistogramStatistic.cc * Author: jgaebler * * Created on June 22, 2011, 11:56 AM */ #include "HistogramStatistic.h" namespace ubeeme { namespace moversight { /** * @brief Constructor */ HistogramStatistic::HistogramStatistic() { } /** * @brief Constructor * @param name The name of the value to set. */ HistogramStatistic::HistogramStatistic(const char * name) { setName(name); } /** * @brief Destructor */ HistogramStatistic::~HistogramStatistic() { record(); } /** * @brief Collects a value. * @param v The value to collect. */ void HistogramStatistic::collect(double v){ cDoubleHistogram::collect(v); } /** * @brief Collects a time value * @param t The time to collects . */ void HistogramStatistic::collect(GenericTime t) { cDoubleHistogram::collect(t.dbl()); } #if ! OMNETPP //TODOS for ubeeme setName(const char * name); virtual void collect(double value) Collects one value. getMin() getMax() getMean() getStddev() setRange(double lower_bound, double upper_bound); /** * @brief Records the statistics into the scalar result file, with the given name, * and optionally, the given unit (e.g. "s", "m/s", etc). * @param name * @param unit * @note Note that this operation may have side effect: if this object is a histogram, * the method may invoke the transform() on the histogram object, * to force it set up histogram cells before recording. */ virtual void recordAs(const char * name, const char * unit = NULL) #endif } }