NLMISC::CHTimer::CStatSorter Struct Reference


Detailed Description

A statistics sorter, based on some criterion. It works on pointers on CStats objects

Definition at line 374 of file hierarchical_timer.h.

Public Member Functions

 CStatSorter (TSortCriterion criterion=TotalTime)
bool operator() (const CStats *lhs, const CStats *rhs)

Data Fields

TSortCriterion Criterion


Constructor & Destructor Documentation

NLMISC::CHTimer::CStatSorter::CStatSorter TSortCriterion  criterion = TotalTime  )  [inline]
 

Definition at line 376 of file hierarchical_timer.h.

References Criterion.

00376                                                                   : Criterion(criterion)
00377                 {}


Member Function Documentation

bool NLMISC::CHTimer::CStatSorter::operator() const CStats lhs,
const CStats rhs
 

Definition at line 916 of file hierarchical_timer.cpp.

References Criterion, NLMISC::CHTimer::CStats::MaxTime, NLMISC::CHTimer::CStats::MeanTime, NLMISC::CHTimer::CStats::MinTime, nlassert, NLMISC::CHTimer::CStats::NumVisits, NLMISC::CHTimer::CStats::TotalTime, and NLMISC::CHTimer::CStats::TotalTimeWithoutSons.

00917 {
00918         switch(Criterion)
00919         {
00920                 case CHTimer::TotalTime:                                return lhs->TotalTime >= rhs->TotalTime;
00921                 case CHTimer::TotalTimeWithoutSons:             return lhs->TotalTimeWithoutSons >= rhs->TotalTimeWithoutSons;
00922                 case CHTimer::MeanTime:                                 return lhs->MeanTime >= rhs->MeanTime;
00923                 case CHTimer::NumVisits:                                return lhs->NumVisits >= rhs->NumVisits;
00924                 case CHTimer::MaxTime:                                  return lhs->MaxTime >= rhs->MaxTime;
00925                 case CHTimer::MinTime:                                  return lhs->MinTime < rhs->MinTime;     
00926                 default:
00927                         nlassert(0); // not a valid criterion
00928                 break;
00929         }
00930         return false;
00931 }


Field Documentation

TSortCriterion NLMISC::CHTimer::CStatSorter::Criterion
 

Definition at line 378 of file hierarchical_timer.h.

Referenced by CStatSorter(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), and operator()().


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