CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PerfCounter Class Reference

#include <ProfilingTools.h>

Public Member Functions

void add (double increment=1.0)
 
double get () const
 
 PerfCounter ()
 

Static Public Member Functions

static void add (const char *name, double increment=1.0)
 
static void enable ()
 
static PerfCounterget (const char *name)
 
static void printAll ()
 

Private Attributes

double value_
 

Detailed Description

Definition at line 8 of file ProfilingTools.h.

Constructor & Destructor Documentation

PerfCounter::PerfCounter ( )
inline

Definition at line 10 of file ProfilingTools.h.

10 : value_(0) {}

Member Function Documentation

void PerfCounter::add ( double  increment = 1.0)
inline
static void PerfCounter::add ( const char *  name,
double  increment = 1.0 
)
inlinestatic

Definition at line 16 of file ProfilingTools.h.

References get().

16 { PerfCounter::get(name).add(increment); }
double get() const
static void PerfCounter::enable ( )
static
PerfCounter & PerfCounter::get ( const char *  name)
static
double PerfCounter::get ( void  ) const
inline
void PerfCounter::printAll ( )
static

Definition at line 45 of file ProfilingTools.cc.

References perfCounters_.

46 {
47  for (boost::unordered_map<const char *, PerfCounter>::const_iterator it = perfCounters_.begin(), ed = perfCounters_.end(); it != ed; ++it) {
48  fprintf(stderr, "%-40s: %g\n", it->first, it->second.get());
49  }
50 }
boost::unordered_map< const char *, PerfCounter > perfCounters_

Member Data Documentation

double PerfCounter::value_
private

Definition at line 20 of file ProfilingTools.h.

Referenced by add(), and get().