37 ,
m_header (
" Counter :: Group | # | sum | mean/eff^* | rms/err^* | min | max |")
39 ,
m_format1 (
" %|15.15s|%|-15.15s|%|32t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" )
41 ,
m_format2 (
"*%|15.15s|%|-15.15s|%|32t||%|10d| |%|11.5g| |(%|#9.7g| +- %|-#9.7g|)%%| ------- | ------- |" )
50 "The header row for the output Stat-table" ) ;
54 "The format for the regular row in the output Stat-table" ) ;
58 "The format for the regular row in the outptu Stat-table" ) ;
62 "Use the special format for printout of efficiency counters" ) ;
150 Printout& printer)
const;
160 Printout& printer)
const;
169 Printout& printer)
const;
178 Printout& printer)
const;
186 const Counter* pCounter)
const ;
195 {
if ( j->second == c ) {
return std::make_pair(
i->first , j->first ) ; } }
200 inline size_t num ()
const
207 {
if ( 0 != j->second ) { ++result ; } ; }
214 void print ()
const ;
239 ( const
std::
string& grp ,
240 const
std::
string& nam )
const
243 if ( m_counts.end() ==
i ) {
return 0 ; }
245 if ( i->second.end() == j ) {
return 0 ; }
265 #pragma warning(push)
266 #pragma warning(disable:2259)
275 refpCounter =
get ( grp , nam ) ;
276 if ( 0 != refpCounter ) {
return COUNTER_EXISTS ; }
280 if ( 0 != initial_value ) {
281 refpCounter->
addFlag ( static_cast<double>(initial_value) ) ;
286 if ( m_counts.end() ==
i )
305 StatusCode sc = create ( group, name, initial_value, p ) ;
307 throw std::runtime_error(
"CounterSvc::Counter('"+group+
"::"+name+
"') exists already!");
317 if ( m_counts.end() ==
i ) {
return COUNTER_NOT_PRESENT ; }
319 if ( i->second.end() == j ) {
return COUNTER_NOT_PRESENT ; }
321 i->second.erase ( j ) ;
332 {
delete j->second ; }
343 {
remove (
i->first ).ignore () ; }
355 const Counter*
c =
get( grp , nam ) ;
356 if ( 0 == c ) {
return COUNTER_NOT_PRESENT ; }
359 return printer ( log , c ) ;
364 class conditionalPrint {
371 void operator() (
const Pair &p) {
373 (*printer)(*
log, p.second).ignore();
386 if ( m_counts.end() ==
i ) {
return COUNTER_NOT_PRESENT ; }
391 sorted_map_t sorted_map(i->second.begin(), i->second.end());
393 conditionalPrint(printer, log));
404 return printer ( log , pCounter ) ;
412 {
return print( refCounter.
counter() , printer ) ; }
421 sorted_map_t sorted_map;
430 conditionalPrint(printer, log));
456 const size_t _num =
num() ;
460 <<
"Number of counters : " << _num <<
endmsg
466 sorted_map_t sorted_map;
472 if ( 0 == c ) { continue ; }
476 for (sorted_map_t::const_iterator
i = sorted_map.begin();
i != sorted_map.end(); ++
i )