Output connection interface. More...
#include <senf/Utils/Statistics.hh>
Public Member Functions | |
| template<class Target > | |
| Owner & | connect (Target &target, std::string label="") const |
| Connect externally managed target. More... | |
| template<class PTarget > | |
| Owner & | connect (std::unique_ptr< PTarget > target, std::string label="") const |
| Connect internally managed target. More... | |
| Owner & | noconnect () const |
| Don't connect the output. More... | |
| console::ScopedDirectory & | dir () const |
| Get target's console directory. More... | |
Output connection interface.
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::signals2::trackable to ensure they are automatically disconnected when destroyed. Externally managed targets are passed by non-const reference to connect(), internally managed targets are passed using std::auto_ptr.
A target is any callable object which takes three float values as argument: The current minimum, average and maximum value.
Definition at line 123 of file Statistics.hh.
| Owner& senf::StatisticsBase::OutputProxy< Owner >::connect | ( | Target & | target, |
| std::string | label = "" |
||
| ) | const |
Connect externally managed target.
| Owner& senf::StatisticsBase::OutputProxy< Owner >::connect | ( | std::unique_ptr< PTarget > | target, |
| std::string | label = "" |
||
| ) | const |
Connect internally managed target.
| console::ScopedDirectory& senf::StatisticsBase::OutputProxy< Owner >::dir | ( | ) | const |
Get target's console directory.
| Owner& senf::StatisticsBase::OutputProxy< Owner >::noconnect | ( | ) | const |
Don't connect the output.