bactria  0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
bactria::ranges::Marker Class Reference

The abstract base class for markers. More...

#include <Marker.hpp>

Inheritance diagram for bactria::ranges::Marker:
Collaboration diagram for bactria::ranges::Marker:

Public Member Functions

 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...
 

Protected Attributes

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...
 

Detailed Description

The abstract base class for markers.

This class serves as abstract base for Events and Ranges. It should not be used directly by the user.

Constructor & Destructor Documentation

◆ Marker() [1/4]

bactria::ranges::Marker::Marker ( )
default

Default constructor.

Constructs a marker with the name BACTRIA_GENERIC_MARKER, the color bactria::ranges::color::orange and a default-initialized category.

◆ Marker() [2/4]

bactria::ranges::Marker::Marker ( std::string  name,
std::uint32_t  color,
Category  category 
)
inline

Constructor.

Constructs a marker with the name name, the color color and the category category.

Parameters
nameThe name shown in the visual output.
colorThe color shown in the visual output.
categoryThe category.

◆ Marker() [3/4]

bactria::ranges::Marker::Marker ( Marker const &  other)
default

Copy constructor.

Copy-constructs a Marker by copying the internals from other. After the copy, this and other will have copies of the same name, color and category.

Parameters
otherThe Marker to copy from.

◆ Marker() [4/4]

bactria::ranges::Marker::Marker ( Marker &&  other)
default

Move constructor.

Move-constructs a Marker by moving the internals from other. After the move, this will have taken over the internals from other which is in an undefined state afterwards.

Parameters
otherThe Marker to move into this.

Member Function Documentation

◆ get_c_name()

auto bactria::ranges::Marker::get_c_name ( ) const -> char const*
inlinenoexcept

Return the marker's name (C string).

Returns the name assigned to this Marker as a C string.

Returns
The name.

◆ get_category()

auto bactria::ranges::Marker::get_category ( ) const -> Category const&
inlinenoexcept

Return the marker's category.

Returns the Category assigned to this Marker.

Returns
The Category.

◆ get_color()

auto bactria::ranges::Marker::get_color ( ) const -> std::uint32_t
inlinenoexcept

Return the marker's color.

Returns the color assigned to this Marker.

Returns
The color.

◆ get_name()

auto bactria::ranges::Marker::get_name ( ) const -> std::string const&
inlinenoexcept

Return the marker's name.

Returns the name assigned to this Marker.

Returns
The name.

◆ operator=() [1/2]

auto bactria::ranges::Marker::operator= ( Marker &&  rhs) -> Marker &=default
default

Move-assignment operator.

Moves the contents of rhs into this. After the move, this will have taken over the internals from rhs which is in an undefined state afterwards.

Parameters
rhsThe Marker to move into this.

◆ operator=() [2/2]

auto bactria::ranges::Marker::operator= ( Marker const &  rhs) -> Marker &=default
default

Copy-assignment operator.

Copies the contents of rhs into this. After the copy, this and rhs will have copies of the same name, color and category.

Parameters
rhsThe Marker to copy from.

Member Data Documentation

◆ m_category

Category bactria::ranges::Marker::m_category {}
protected

The Category assigned to the Marker.

Users should not rely on this member to be stable. It may change between versions without further notice.

◆ m_color

std::uint32_t bactria::ranges::Marker::m_color {color::orange}
protected

The color assigned to the Marker.

Users should not rely on this member to be stable. It may change between versions without further notice.

◆ m_name

std::string bactria::ranges::Marker::m_name {"BACTRIA_GENERIC_MARKER"}
protected

The name assigned to the Marker.

Users should not rely on this member to be stable. It may change between versions without further notice.


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