bactria
0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
|
The phase class. More...
#include <Phase.hpp>
Public Member Functions | |
Phase ()=default | |
The default constructor. More... | |
Phase (std::string name) | |
The non-entering constructor. More... | |
Phase (std::string name, std::string source, std::uint32_t lineno, std::string caller) | |
The entering constructor. More... | |
Phase (const Phase &)=delete | |
The copy constructor (deleted). More... | |
auto | operator= (const Phase &) -> Phase &=delete |
The copy assignment operator (deleted). More... | |
Phase (Phase &&other) | |
The move constructor. More... | |
auto | operator= (Phase &&rhs) -> Phase & |
The move assignment operator. More... | |
~Phase () | |
The destructor. More... | |
auto | enter (std::string source, std::uint32_t lineno, std::string caller) -> void |
Enter the phase. More... | |
auto | leave (std::string source, std::uint32_t lineno, std::string caller) -> void |
Leave the phase. More... | |
The phase class.
Phases are used for structuring the program into logical segments. Sectors can be added to any phase in the program. Like Sectors, Phases have to be correctly nested.
|
default |
The default constructor.
The default constructor will generate a phase with the name BACTRIA_GENERIC_PHASE
. This phase will not be entered; this still needs to be done with a (correctly nested) pair of bactria_Enter() and bactria_Leave() or ~Phase().
|
inlineexplicit |
The non-entering constructor.
The non-entering constructor will generate a phase with the name name. This phase will not be entered; this still needs to be done with a (correctly nested) pair of bactria_Enter() and bactria_Leave() or ~Phase().
name | The phase name as it should appear on the output file or visualizer. |
|
inline |
The entering constructor.
The entering constructor will generate a phase with the name name. This phase will be entered immediately. To leave it, the user can call bactria_Leave() or wait for ~Phase() to be triggered.
name | The phase name as it should appear on the output file or visualizer. |
source | The source file this phase should be assigned to. This should be __FILE__ . |
lineno | The line number of the source file. This should be __LINE__ . |
caller | The surrounding function this phase is constructed in. This should be __func__ . |
|
delete |
The copy constructor (deleted).
Phases are not intended to be copied. Thus, the copy constructor is deleted.
|
inline |
The move constructor.
Moves the other phase into this
phase. Using other
after the move results in undefined behaviour.
other | The phase to be moved. |
|
inline |
The destructor.
Destructs the phase. If the phase was entered and there was no preceeding call to bactria_Leave() or leave() the destructor will trigger this functionality before the contents of this
are deleted.
|
inline |
Enter the phase.
Enters the phase. It is allowed to enter a phase multiple times (for example in multiple code locations) as long as there is an equal amount of correctly nested calls to leave(), bactria_Leave() or ~Phase().
source | The source file where the phase is entered. This should be __FILE__ . |
lineno | The source line where the phase is entered. This should be __LINE__ . |
caller | The function where the phase is entered. This should be __func__ . |
|
inline |
Leave the phase.
Leaves the phase. It is allowed to leave a phase multiple times (for example in multiple code locations) as long as there is an equal amount of correctly nested calls to enter(), bactria_Enter() or Phase().
source | The source file where the phase is left. This should be __FILE__ . |
lineno | The source line where the phase is left. This should be __LINE__ . |
caller | The function where the phase is left. This should be __func__ . |
The copy assignment operator (deleted).
Phases are not intended to be copied. Thus, the copy assignment operator is deleted.
The move assignment operator.
Moves the rhs phase into this
phase. Using rhs after the move results in undefined behaviour.
rhs | The phase to be moved. |