PhoenixHardware  0.2.0
Tools to get hardware information
Loading...
Searching...
No Matches
PProfiler.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __PPROFILER_H__
8#define __PPROFILER_H__
9
10#include <vector>
11#include "PFunctionPerf.h"
12
13typedef std::vector<PFunctionPerf> PVecFunctionPerf;
14
17 public:
18 PProfiler();
19 PProfiler(const PProfiler & other);
20 virtual ~PProfiler();
21 PProfiler & operator = (const PProfiler & other);
22
23 size_t addFunction(const std::string & name, size_t nbThread = 1lu);
24 void rename(size_t index, const std::string & name);
25 void start(size_t index, size_t threadIndex = 0lu);
26 void stop(size_t index, size_t threadIndex = 0lu);
27 void reset(size_t index, size_t threadIndex = 0lu);
28 void reset();
29
30 void print(std::ostream & out = std::cout) const;
31
32 void printCsvHeader(std::ostream & out = std::cout) const;
33 void printCsv(std::ostream & out = std::cout) const;
34
35 protected:
36 void copyPProfiler(const PProfiler & other);
37
38 private:
40
43};
44
45
46
47#endif
48
std::vector< PFunctionPerf > PVecFunctionPerf
Definition PProfiler.h:13
void initialisationPProfiler()
Initialisation function of the class PProfiler.
void printCsvHeader(std::ostream &out=std::cout) const
Print header of all the PFunctionPerf of the PProfiler in CSV format.
void start(size_t index, size_t threadIndex=0lu)
Start the given PFunctionPerf.
Definition PProfiler.cpp:63
PProfiler()
Default constructor of PProfiler.
Definition PProfiler.cpp:13
void print(std::ostream &out=std::cout) const
Print all the PFunctionPerf of the PProfiler.
Definition PProfiler.cpp:93
void printCsv(std::ostream &out=std::cout) const
Print all the PFunctionPerf of the PProfiler in CSV format.
void copyPProfiler(const PProfiler &other)
Copy function of PProfiler.
void rename(size_t index, const std::string &name)
Rename a function.
Definition PProfiler.cpp:55
PProfiler & operator=(const PProfiler &other)
Definition of equal operator of PProfiler.
Definition PProfiler.cpp:33
virtual ~PProfiler()
Destructor of PProfiler.
Definition PProfiler.cpp:25
size_t addFunction(const std::string &name, size_t nbThread=1lu)
Add a function to profile.
Definition PProfiler.cpp:43
void reset()
Reset all the function perf.
Definition PProfiler.cpp:84
PVecFunctionPerf p_vecFunctionPerf
Vector of performances for all registered functions.
Definition PProfiler.h:42
void stop(size_t index, size_t threadIndex=0lu)
Stop the given PFunctionPerf.
Definition PProfiler.cpp:71