My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
Statistics Class Reference

Classes

struct  stat
 

Public Member Functions

 Statistics ()
 
void begin (const char *name)
 
void end ()
 
void print ()
 

Private Attributes

QList< statstats
 
QTime time
 

Detailed Description

Definition at line 212 of file doxygen.cpp.

Constructor & Destructor Documentation

Statistics::Statistics ( )
inline

Definition at line 215 of file doxygen.cpp.

References stats.

{ stats.setAutoDelete(TRUE); }

Member Function Documentation

void Statistics::begin ( const char *  name)
inline

Definition at line 216 of file doxygen.cpp.

References msg(), stats, and time.

Referenced by generateOutput(), parseInput(), and searchInputFiles().

{
stat *entry= new stat(name,0);
stats.append(entry);
time.restart();
}
void Statistics::end ( )
inline

Definition at line 223 of file doxygen.cpp.

References stats, and time.

Referenced by generateOutput(), parseInput(), and searchInputFiles().

{
stats.getLast()->elapsed=((double)time.elapsed())/1000.0;
}
void Statistics::print ( )
inline

Definition at line 227 of file doxygen.cpp.

References Debug::clearFlag(), Statistics::stat::elapsed, Debug::isFlagSet(), msg(), Statistics::stat::name, Debug::setFlag(), stats, and Debug::Time.

Referenced by generateOutput().

{
bool restore=FALSE;
{
restore=TRUE;
}
msg("----------------------\n");
QListIterator<stat> sli(stats);
stat *s;
for ( sli.toFirst(); (s=sli.current()); ++sli )
{
msg("Spent %.3f seconds in %s",s->elapsed,s->name);
}
if (restore) Debug::setFlag("time");
}

Member Data Documentation

QList<stat> Statistics::stats
private

Definition at line 252 of file doxygen.cpp.

Referenced by begin(), end(), print(), and Statistics().

QTime Statistics::time
private

Definition at line 253 of file doxygen.cpp.

Referenced by begin(), and end().


The documentation for this class was generated from the following file: