CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

PerfCounter Class Reference

#include <ProfilingTools.h>

List of all members.

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.

: value_(0) {}

Member Function Documentation

void PerfCounter::add ( double  increment = 1.0) [inline]

Definition at line 13 of file ProfilingTools.h.

References value_.

{ value_ += increment; }
static void PerfCounter::add ( const char *  name,
double  increment = 1.0 
) [inline, static]

Definition at line 16 of file ProfilingTools.h.

References get().

{ PerfCounter::get(name).add(increment); }
static void PerfCounter::enable ( ) [static]
PerfCounter & PerfCounter::get ( const char *  name) [static]

Definition at line 40 of file ProfilingTools.cc.

References mergeVDriftHistosByStation::name, and perfCounters_.

{
    return perfCounters_[name];
}
double PerfCounter::get ( void  ) const [inline]

Definition at line 14 of file ProfilingTools.h.

References value_.

Referenced by add().

{ return value_; }
void PerfCounter::printAll ( ) [static]

Definition at line 45 of file ProfilingTools.cc.

References perfCounters_.

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

Member Data Documentation

double PerfCounter::value_ [private]

Definition at line 20 of file ProfilingTools.h.

Referenced by add(), and get().