21 #ifndef __STATISTICS_H__
22 #define __STATISTICS_H__
37 std::pair<statistics_iterator_t, bool> statistic_position;
38 statistic_position =
statistics_.insert(std::pair<std::string, T>(
name, initial_value));
40 if(statistic_position.second ==
false)
41 std::cout <<
"Statistic " << statistic_position.first->second <<
" already exists!" <<
std::endl;
51 std::cout <<
"Statistic " <<
name <<
" not registered!" <<
std::endl;
64 std::cout <<
"\t" << stat.first <<
" = " << stat.second <<
std::endl;
67 std::cout <<
"_________________________" <<
std::endl;
75 for (std::pair<std::string, T> stat :
statistics_) {
77 stream <<
"\t" << stat.first <<
" = " << stat.second <<
std::endl;
80 stream <<
"_________________________" <<
std::endl;
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
Inform & endl(Inform &inf)
std::string::iterator iterator
Statistics(std::string name)
T getStatisticValue(std::string name)
void registerStatistic(std::string name, T initial_value=0)
std::map< std::string, T >::iterator statistics_iterator_t
std::map< std::string, T > statistics_t
void dumpStatistics(std::ostringstream &stream)
void changeStatisticBy(std::string name, T change_by_value)