#include <senf/Utils/Statistics.hh>
This class is returned from senf::StatisticsBase::output() and the derived output()
implementations to allow connecting an output with an arbitrary target.
There are two types of targets:
boost::signals::trackable
to ensure they are automatically disconnected when destroyed.std::auto_ptr
.
A target is any callable object which takes three float values as argument: The current minimum, average and maximum value.
// Simple function as statistics target void collect(float min, float avg, float max) { ... } // Function object struct Collector { void operator()(float min, float avg, float max, float dev) { ... } };
Definition at line 124 of file Statistics.hh.
Public Member Functions |
|
template<class Target > | |
Owner & | connect (Target &target, std::string label="") const |
Connect externally managed target. |
|
template<class PTarget > | |
Owner & | connect (std::auto_ptr< PTarget > target, std::string label="") const |
Connect internally managed target. |
|
Owner & | noconnect () const |
Don't connect the output. |
|
senf::console::ScopedDirectory & | dir () const |
Get target's console directory. |
Owner & senf::StatisticsBase::StatisticsBase::OutputProxy< Owner >:: | ||||
connect | ( | std::auto_ptr< PTarget > | target, | |
std::string |
label = ""
|
) | ||
Connect internally managed target.
Definition at line 63 of file Statistics.cti.
Owner & senf::StatisticsBase::StatisticsBase::OutputProxy< Owner >:: | ||||
connect | ( | Target & | target, | |
std::string |
label = ""
|
) | ||
Connect externally managed target.
Definition at line 50 of file Statistics.cti.
senf::console::ScopedDirectory & senf::StatisticsBase::StatisticsBase::OutputProxy< Owner >:: | ||||
dir | () | |||
Get target's console directory.
Definition at line 82 of file Statistics.cti.
Owner & senf::StatisticsBase::StatisticsBase::OutputProxy< Owner >:: | ||||
noconnect | () | |||
Don't connect the output.
Definition at line 75 of file Statistics.cti.