26 #ifndef REGISTRATION_UTILS_H 27 #define REGISTRATION_UTILS_H 41 boost::function<double()> funct = [variable] {
return static_cast<double>(*variable); };
64 const boost::function<T()> &funct,
67 boost::function<double()> double_funct = [funct] {
return static_cast<double>(funct()); };
78 const boost::function<
double()> &funct,
91 #endif // REGISTRATION_UTILS_H
The StatisticsRegistry class reads the value of registered variables and publishes them on the specif...
IdType customRegister(StatisticsRegistry ®istry, const std::string &name, const T *variable, RegistrationsRAII *bookkeeping=NULL, bool enabled=true)
Default implementation that accepts anything variable that can be casted to a double.
IdType registerVariable(const std::string &name, const double *variable, RegistrationsRAII *bookkeeping=NULL, bool enabled=true)
registerVariable Specialization for double*, the most common case, to avoid going through a boost fun...
The RegistrationsRAII class holds handles to registered variables and when it is destroyed, unregisters them automatically.
IdType registerFunction(const std::string &name, const boost::function< double()> &funct, RegistrationsRAII *bookkeeping=NULL, bool enabled=true)
registerFunction Adds a function that returns double with the specified name