CMS 3D CMS Logo

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

#include <TimerStack.h>

Public Member Functions

void clean_stack ()
 
void pop ()
 
void pop_and_push (std::string name)
 
void push (std::string name)
 
 ~HTimerStack ()
 

Private Attributes

std::stack< TimeMe * > stack
 

Detailed Description

Definition at line 5 of file TimerStack.h.

Constructor & Destructor Documentation

HTimerStack::~HTimerStack ( )
inline

Definition at line 8 of file TimerStack.h.

References clean_stack().

9  {
10  clean_stack();
11  }
void clean_stack()
Definition: TimerStack.h:27

Member Function Documentation

void HTimerStack::clean_stack ( )
inline

Definition at line 27 of file TimerStack.h.

References pop(), and stack.

Referenced by ~HTimerStack().

27  {
28  while(!stack.empty()) pop();
29  }
void pop()
Definition: TimerStack.h:20
std::stack< TimeMe * > stack
Definition: TimerStack.h:37
void HTimerStack::pop ( )
inline

Definition at line 20 of file TimerStack.h.

References stack.

Referenced by clean_stack(), and pop_and_push().

20  {
21  if (!stack.empty()) {
22  delete stack.top();
23  stack.pop();
24  }
25  }
std::stack< TimeMe * > stack
Definition: TimerStack.h:37
void HTimerStack::pop_and_push ( std::string  name)
inline

Definition at line 31 of file TimerStack.h.

References pop(), and push().

Referenced by HTrackAssociator::fillCaloTowers(), HTrackAssociator::fillEcal(), HTrackAssociator::fillHcal(), and HTrackAssociator::fillHcalTowers().

31  {
32  pop();
33  push(name);
34  }
void pop()
Definition: TimerStack.h:20
void push(std::string name)
Definition: TimerStack.h:13
void HTimerStack::push ( std::string  name)
inline

Definition at line 13 of file TimerStack.h.

References counter, TimingReport::current(), and stack.

Referenced by HTrackAssociator::fillCaloTowers(), HTrackAssociator::fillEcal(), HTrackAssociator::fillHcal(), HTrackAssociator::fillHcalTowers(), and pop_and_push().

13  {
14  if( (*TimingReport::current())["firstcall_"+name].counter == 0)
15  stack.push(new TimeMe("firstcall_"+name));
16  else
17  stack.push(new TimeMe(name));
18  }
std::stack< TimeMe * > stack
Definition: TimerStack.h:37
static TimingReport * current()
Definition: TimingReport.cc:21
static std::atomic< unsigned int > counter

Member Data Documentation

std::stack<TimeMe*> HTimerStack::stack
private

Definition at line 37 of file TimerStack.h.

Referenced by clean_stack(), pop(), and push().