bactria
0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
|
The event class. More...
#include <Event.hpp>
Public Member Functions | |
Event () | |
The default constructor. More... | |
Event (std::string name, std::uint32_t color=color::bactria_orange, Category category=Category{}) | |
The constructor. More... | |
Event (const Event &other) | |
The copy constructor. More... | |
auto | operator= (const Event &rhs) -> Event & |
The copy assignment operator. More... | |
Event (Event &&other) noexcept | |
The move constructor. More... | |
auto | operator= (Event &&rhs) noexcept -> Event & |
The move assignment operator. More... | |
~Event () override | |
The destructor. More... | |
auto | fire (std::string source, std::uint32_t lineno, std::string caller) noexcept -> void |
Fire the event. More... | |
auto | set_action (std::function< std::string(void)> a) noexcept -> void |
Set a user-defined action for generating the event name. More... | |
Public Member Functions inherited from bactria::ranges::Marker | |
Marker ()=default | |
Default constructor. More... | |
Marker (std::string name, std::uint32_t color, Category category) | |
Constructor. More... | |
Marker (Marker const &other)=default | |
Copy constructor. More... | |
auto | operator= (Marker const &rhs) -> Marker &=default |
Copy-assignment operator. More... | |
Marker (Marker &&other)=default | |
Move constructor. More... | |
auto | operator= (Marker &&rhs) -> Marker &=default |
Move-assignment operator. More... | |
virtual | ~Marker ()=default |
Destroy the Marker object. | |
auto | get_name () const noexcept -> std::string const & |
Return the marker's name. More... | |
auto | get_c_name () const noexcept -> char const * |
Return the marker's name (C string). More... | |
auto | get_color () const noexcept -> std::uint32_t |
Return the marker's color. More... | |
auto | get_category () const noexcept -> Category const & |
Return the marker's category. More... | |
Additional Inherited Members | |
Protected Attributes inherited from bactria::ranges::Marker | |
std::string | m_name {"BACTRIA_GENERIC_MARKER"} |
The name assigned to the Marker. More... | |
std::uint32_t | m_color {color::orange} |
The color assigned to the Marker. More... | |
Category | m_category {} |
The Category assigned to the Marker. More... | |
The event class.
The user can record his own events which will appear as special markers on the visualizer. In contrast to a Range, an event denotes a single point in time.
|
inline |
The default constructor.
The default constructor will generate an event with the name BACTRIA_GENERIC_EVENT, orange color and the generic Category.
|
inline |
The constructor.
The constructor will generate an event with the name name, the color color and the Category category.
name | The name as it should appear on the visualizer. |
color | The color as it should appear on the visualizer. Needs to be supplied in ARGB format. |
category | The category this event should be assigned to. This allows for later filtering. |
|
inline |
The copy constructor.
The copy constructor will generate a new event with the same properties as the original.
other | The event to copy the properties from. |
|
inlinenoexcept |
The move constructor.
The move constructor will move the contents of the original event into this event. The original event will be in an invalid state; using it is undefined behaviour.
other | The Event to be moved. |
|
inlineoverride |
The destructor.
The destructor will discard all internal contents of the event. After the call to the destructor the event will be in an invalid state; using it is undefined behaviour.
|
inlinenoexcept |
Fire the event.
Firing the event generates an entry on the visualizer with this event's name, color and category. While the interface requires the source file, the line number and the calling function, this information may not be supported by all back-ends. In this case the parameters will be silently ignored.
source | The source file where the event is fired. Should be __FILE__ . |
lineno | The source line where the event is fired. Should be __LINE__ . |
caller | The surrounding function of the event firing. Should be __func__ . |
The copy assignment operator.
The copy assignment operator will generate a new event with the same properties as the original.
rhs | The event to copy the properties from. |
The move assignment operator.
The move assignment operator will move the contents of the original event into this event. The original event will be in an invalid state; using it is undefined behaviour.
rhs | The event to be moved. |
|
inlinenoexcept |
Set a user-defined action for generating the event name.
This method allows to specify a user-defined action which generates the name. It will be executed upon firing the event. This method will override the name specified in the constructor.
a | The action to execute upon firing the event. |