33 ,
m_header (
" Counter :: Group | # | sum | mean/eff^* | rms/err^* | min | max |")
35 ,
m_format1 (
" %|15.15s|%|-15.15s|%|32t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" )
37 ,
m_format2 (
"*%|15.15s|%|-15.15s|%|32t||%|10d| |%|11.5g| |(%|#9.7g| +- %|-#9.7g|)%%| ------- | ------- |" )
46 "The header row for the output Stat-table" ) ;
50 "The format for the regular row in the output Stat-table" ) ;
54 "The format for the regular row in the outptu Stat-table" ) ;
58 "Use the special format for printout of efficiency counters" ) ;
146 Printout& printer)
const;
156 Printout& printer)
const;
165 Printout& printer)
const;
174 Printout& printer)
const;
182 const Counter* pCounter)
const ;
191 {
if ( j->second == c ) {
return std::make_pair(
i->first , j->first ) ; } }
196 inline size_t num ()
const
203 {
if ( 0 != j->second ) { ++result ; } ; }
210 void print ()
const ;
235 ( const
std::
string& grp ,
236 const
std::
string& nam )
const
239 if ( m_counts.end() ==
i ) {
return 0 ; }
241 if ( i->second.end() == j ) {
return 0 ; }
261 #pragma warning(push)
262 #pragma warning(disable:2259)
271 refpCounter =
get ( grp , nam ) ;
272 if ( 0 != refpCounter ) {
return COUNTER_EXISTS ; }
276 if ( 0 != initial_value ) {
277 refpCounter->
addFlag ( static_cast<double>(initial_value) ) ;
282 if ( m_counts.end() ==
i )
301 StatusCode sc = create ( group, name, initial_value, p ) ;
303 throw std::runtime_error(
"CounterSvc::Counter('"+group+
"::"+name+
"') exists already!");
313 if ( m_counts.end() ==
i ) {
return COUNTER_NOT_PRESENT ; }
315 if ( i->second.end() == j ) {
return COUNTER_NOT_PRESENT ; }
317 i->second.erase ( j ) ;
328 {
delete j->second ; }
339 {
remove (
i->first ).ignore () ; }
351 const Counter*
c =
get( grp , nam ) ;
352 if ( 0 == c ) {
return COUNTER_NOT_PRESENT ; }
355 return printer ( log , c ) ;
360 class conditionalPrint {
367 void operator() (
const Pair &p) {
369 (*printer)(*
log, p.second).ignore();
382 if ( m_counts.end() ==
i ) {
return COUNTER_NOT_PRESENT ; }
387 sorted_map_t sorted_map(i->second.begin(), i->second.end());
389 conditionalPrint(printer, log));
400 return printer ( log , pCounter ) ;
408 {
return print( refCounter.
counter() , printer ) ; }
417 sorted_map_t sorted_map;
426 conditionalPrint(printer, log));
452 const size_t _num =
num() ;
456 <<
"Number of counters : " << _num <<
endmsg
462 sorted_map_t sorted_map;
468 if ( 0 == c ) { continue ; }
472 for (sorted_map_t::const_iterator
i = sorted_map.begin();
i != sorted_map.end(); ++
i )