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

Defines a category. More...

#include <Category.hpp>

Public Member Functions

 Category ()=default
 The default constructor. More...
 
 Category (std::uint32_t id, std::string name)
 The constructor. More...
 
 Category (Category const &other)=default
 The copy constructor. More...
 
auto operator= (Category const &rhs) -> Category &=default
 The copy assignment operator. More...
 
 Category (Category &&other)=default
 The move constructor. More...
 
auto operator= (Category &&rhs) -> Category &=default
 The move assignment operator. More...
 
 ~Category ()=default
 The destructor. More...
 
auto get_id () const noexcept -> std::uint32_t
 The ID getter method. More...
 
auto get_name () const noexcept -> std::string const &
 The name getter method. More...
 
auto get_c_name () const noexcept -> char const *
 The C string name getter method. More...
 

Detailed Description

Defines a category.

This class can be used for defining own categories. Categories can later be used for filtering out Ranges and Events. Each category is defined by an unique id and a name.

Constructor & Destructor Documentation

◆ Category() [1/4]

bactria::ranges::Category::Category ( )
default

The default constructor.

This constructs a default Category with the ID 0 and the name BACTRIA_GENERIC_CATEGORY.

◆ Category() [2/4]

bactria::ranges::Category::Category ( std::uint32_t  id,
std::string  name 
)
inline

The constructor.

This constructs a Category with the ID id and the name name.

◆ Category() [3/4]

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

The copy constructor.

Constructs a category with the same properties as other. this and other will share the same name and ID after construction.

Parameters
otherThe Category to copy from.

◆ Category() [4/4]

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

The move constructor.

Constructs a category by moving other's properties into this. this will be identical to other's state before the move. other will be in an undefined state after construction.

Parameters
otherThe Category to move into this.

◆ ~Category()

bactria::ranges::Category::~Category ( )
default

The destructor.

Destroys the contents of this. this will be in an undefined state after destruction.

Member Function Documentation

◆ get_c_name()

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

The C string name getter method.

Returns
The name assigned to this as C string.

◆ get_id()

auto bactria::ranges::Category::get_id ( ) const -> std::uint32_t
inlinenoexcept

The ID getter method.

Returns
The ID assigned to this.

◆ get_name()

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

The name getter method.

Returns
The name assigned to this.

◆ operator=() [1/2]

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

The move assignment operator.

Moves the properties of rhs into this. this will be identical to rhs's state before the move. rhs will be in an undefined state after the assignment.

Parameters
rhsThe Category to move into this.

◆ operator=() [2/2]

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

The copy assignment operator.

Copies the properties of rhs into this. this and other will share the same name and ID after the assignment.

Parameters
rhsThe Category to copy from.

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