NLMISC::CHTimer::CNode Struct Reference


Detailed Description

a node in an execution path

Definition at line 286 of file hierarchical_timer.h.

Public Types

typedef std::vector< double > TTimeVect

Public Member Functions

 CNode (CHTimer *owner=NULL, CNode *parent=NULL)
void displayPath (CLog *log) const
uint getNumNodes () const
void getPath (std::string &dest) const
void releaseSons ()
void reset ()
 ~CNode ()

Data Fields

CSimpleClock Clock
uint64 LastSonsTotalTime
uint64 MaxTime
TTimeVect Measures
uint64 MinTime
uint64 NumVisits
CHTimerOwner
CNodeParent
TNodeVect Sons
uint64 SonsPreambule
uint64 SonsTotalTime
uint64 TotalTime


Member Typedef Documentation

typedef std::vector<double> NLMISC::CHTimer::CNode::TTimeVect
 

Definition at line 288 of file hierarchical_timer.h.


Constructor & Destructor Documentation

NLMISC::CHTimer::CNode::CNode CHTimer owner = NULL,
CNode parent = NULL
[inline]
 

Definition at line 304 of file hierarchical_timer.h.

References reset().

00304                                                                 : Parent(parent), Owner(owner)
00305                 {
00306                         reset();
00307                 }

NLMISC::CHTimer::CNode::~CNode  ) 
 

Do simple statistics on a list of values (mean value, standard deviation)

Definition at line 118 of file hierarchical_timer.cpp.

References releaseSons(), and uint.

00119 {
00120         releaseSons();
00121         for(uint k = 0; k < Sons.size(); ++k)
00122                 delete Sons[k];
00123 }


Member Function Documentation

void NLMISC::CHTimer::CNode::displayPath CLog log  )  const
 

Definition at line 134 of file hierarchical_timer.cpp.

References NLMISC::CLog::displayRawNL(), and getPath().

00135 {
00136         std::string path;
00137         getPath(path);
00138         log->displayRawNL(("HTIMER: " + path).c_str());
00139 }

uint NLMISC::CHTimer::CNode::getNumNodes  )  const
 

Definition at line 157 of file hierarchical_timer.cpp.

References uint.

Referenced by NLMISC::CHTimer::displayByExecutionPath().

00158 {
00159         uint sum = 1;
00160         for(uint k = 0; k < Sons.size(); ++k)
00161         {
00162                 sum += Sons[k]->getNumNodes();
00163         }
00164         return sum;
00165 }

void NLMISC::CHTimer::CNode::getPath std::string &  dest  )  const
 

Definition at line 142 of file hierarchical_timer.cpp.

References NLMISC::CHTimer::getName(), Owner, and Parent.

Referenced by displayPath().

00143 {
00144         path.clear();
00145         const CNode *currNode = this;
00146         do
00147         {
00148                 path = path.empty() ? currNode->Owner->getName() 
00149                         : currNode->Owner->getName() + std::string("::") + path;
00150                 currNode = currNode->Parent;
00151         }
00152         while (currNode);
00153 }

void NLMISC::CHTimer::CNode::releaseSons  ) 
 

Definition at line 126 of file hierarchical_timer.cpp.

References uint.

Referenced by ~CNode().

00127 {
00128         for(uint k = 0; k < Sons.size(); ++k)
00129                 delete Sons[k];
00130         Sons.clear();
00131 }

void NLMISC::CHTimer::CNode::reset void   )  [inline]
 

Definition at line 315 of file hierarchical_timer.h.

References NLMISC::contReset(), LastSonsTotalTime, MaxTime, Measures, MinTime, NumVisits, SonsPreambule, SonsTotalTime, TotalTime, and uint64.

Referenced by NLMISC::CHTimer::clear(), and CNode().

00316                 {
00317                         SonsTotalTime            = 0;
00318                         TotalTime                        = 0;
00319                         MaxTime                          = 0;
00320                         MinTime                          = (uint64) -1;
00321                         NumVisits                        = 0;
00322                         SonsPreambule        = 0;                       
00323                         LastSonsTotalTime    = 0;
00324                         NLMISC::contReset(Measures);
00325                 }


Field Documentation

CSimpleClock NLMISC::CHTimer::CNode::Clock
 

Definition at line 302 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::doAfter(), and NLMISC::CHTimer::doBefore().

uint64 NLMISC::CHTimer::CNode::LastSonsTotalTime
 

Definition at line 294 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::CStats::buildFromNodes(), NLMISC::CHTimer::doAfter(), and reset().

uint64 NLMISC::CHTimer::CNode::MaxTime
 

Definition at line 298 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::doAfter(), and reset().

TTimeVect NLMISC::CHTimer::CNode::Measures
 

Definition at line 296 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::CStats::buildFromNodes(), NLMISC::CHTimer::doAfter(), and reset().

uint64 NLMISC::CHTimer::CNode::MinTime
 

Definition at line 297 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::doAfter(), and reset().

uint64 NLMISC::CHTimer::CNode::NumVisits
 

Definition at line 299 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::CStats::buildFromNodes(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), and reset().

CHTimer* NLMISC::CHTimer::CNode::Owner
 

Definition at line 292 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::display(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), NLMISC::CHTimer::estimateAfterStopTime(), getPath(), and NLMISC::CHTimer::startBench().

CNode* NLMISC::CHTimer::CNode::Parent
 

Definition at line 290 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), and getPath().

TNodeVect NLMISC::CHTimer::CNode::Sons
 

Definition at line 291 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::display(), NLMISC::CHTimer::displayByExecutionPath(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), and NLMISC::CHTimer::walkTreeToCurrent().

uint64 NLMISC::CHTimer::CNode::SonsPreambule
 

Definition at line 301 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::display(), NLMISC::CHTimer::displayByExecutionPath(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), and reset().

uint64 NLMISC::CHTimer::CNode::SonsTotalTime
 

Definition at line 295 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::estimateAfterStopTime(), and reset().

uint64 NLMISC::CHTimer::CNode::TotalTime
 

Definition at line 293 of file hierarchical_timer.h.

Referenced by NLMISC::CHTimer::CStats::buildFromNodes(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::estimateAfterStopTime(), and reset().


The documentation for this struct was generated from the following files:
Generated on Tue Mar 16 13:18:18 2004 for NeL by doxygen 1.3.6