![]() |
PhoenixHardware
0.2.0
Tools to get hardware information
|
Profiler of functions. More...
#include <PProfiler.h>
Public Member Functions | |
size_t | addFunction (const std::string &name, size_t nbThread=1lu) |
Add a function to profile. | |
PProfiler & | operator= (const PProfiler &other) |
Definition of equal operator of PProfiler. | |
PProfiler () | |
Default constructor of PProfiler. | |
PProfiler (const PProfiler &other) | |
Copy constructor of PProfiler. | |
void | print (std::ostream &out=std::cout) const |
Print all the PFunctionPerf of the PProfiler. | |
void | printCsv (std::ostream &out=std::cout) const |
Print all the PFunctionPerf of the PProfiler in CSV format. | |
void | printCsvHeader (std::ostream &out=std::cout) const |
Print header of all the PFunctionPerf of the PProfiler in CSV format. | |
void | rename (size_t index, const std::string &name) |
Rename a function. | |
void | reset () |
Reset all the function perf. | |
void | reset (size_t index, size_t threadIndex=0lu) |
Reset the given PFunctionPerf. | |
void | start (size_t index, size_t threadIndex=0lu) |
Start the given PFunctionPerf. | |
void | stop (size_t index, size_t threadIndex=0lu) |
Stop the given PFunctionPerf. | |
virtual | ~PProfiler () |
Destructor of PProfiler. | |
Protected Member Functions | |
void | copyPProfiler (const PProfiler &other) |
Copy function of PProfiler. | |
Private Member Functions | |
void | initialisationPProfiler () |
Initialisation function of the class PProfiler. | |
Private Attributes | |
PVecFunctionPerf | p_vecFunctionPerf |
Vector of performances for all registered functions. | |
Profiler of functions.
Definition at line 16 of file PProfiler.h.
PProfiler::PProfiler | ( | ) |
Default constructor of PProfiler.
Definition at line 13 of file PProfiler.cpp.
References initialisationPProfiler().
Referenced by copyPProfiler(), operator=(), and PProfiler().
PProfiler::PProfiler | ( | const PProfiler & | other | ) |
Copy constructor of PProfiler.
other | : class to copy |
Definition at line 20 of file PProfiler.cpp.
References copyPProfiler(), and PProfiler().
|
virtual |
size_t PProfiler::addFunction | ( | const std::string & | name, |
size_t | nbThread = 1lu ) |
Add a function to profile.
name | : name of the function to profile |
nbThread | : number of threads which call the function |
Definition at line 43 of file PProfiler.cpp.
References p_vecFunctionPerf, and PFunctionPerf::resize().
|
protected |
Copy function of PProfiler.
other | : class to copy |
Definition at line 118 of file PProfiler.cpp.
References p_vecFunctionPerf, and PProfiler().
Referenced by operator=(), and PProfiler().
|
private |
Initialisation function of the class PProfiler.
Definition at line 123 of file PProfiler.cpp.
Referenced by PProfiler().
Definition of equal operator of PProfiler.
other | : class to copy |
Definition at line 33 of file PProfiler.cpp.
References copyPProfiler(), and PProfiler().
void PProfiler::print | ( | std::ostream & | out = std::cout | ) | const |
Print all the PFunctionPerf of the PProfiler.
[out] | out : ostream to be used |
Definition at line 93 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::printCsv | ( | std::ostream & | out = std::cout | ) | const |
Print all the PFunctionPerf of the PProfiler in CSV format.
[out] | out : ostream to be used |
Definition at line 109 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::printCsvHeader | ( | std::ostream & | out = std::cout | ) | const |
Print header of all the PFunctionPerf of the PProfiler in CSV format.
[out] | out : ostream to be used |
Definition at line 102 of file PProfiler.cpp.
void PProfiler::rename | ( | size_t | index, |
const std::string & | name ) |
Rename a function.
index | : index of the PFunctionPerf to be renamed |
name | : new name of the function |
Definition at line 55 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::reset | ( | ) |
Reset all the function perf.
Definition at line 84 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::reset | ( | size_t | index, |
size_t | threadIndex = 0lu ) |
Reset the given PFunctionPerf.
index | : index of the PFunctionPerf to be reset |
threadIndex | : index of the current thread |
Definition at line 79 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::start | ( | size_t | index, |
size_t | threadIndex = 0lu ) |
Start the given PFunctionPerf.
index | : index of the PFunctionPerf to be started |
threadIndex | : index of the current thread |
Definition at line 63 of file PProfiler.cpp.
References p_vecFunctionPerf.
void PProfiler::stop | ( | size_t | index, |
size_t | threadIndex = 0lu ) |
Stop the given PFunctionPerf.
index | : index of the PFunctionPerf to be stoped |
threadIndex | : index of the current thread |
Definition at line 71 of file PProfiler.cpp.
References p_vecFunctionPerf.
|
private |
Vector of performances for all registered functions.
Definition at line 42 of file PProfiler.h.
Referenced by addFunction(), copyPProfiler(), print(), printCsv(), rename(), reset(), reset(), start(), and stop().