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

The range class. More...

#include <Range.hpp>

Inheritance diagram for bactria::ranges::Range:
Collaboration diagram for bactria::ranges::Range:

Public Member Functions

 Range ()
 The default constructor. More...
 
 Range (std::string name, std::uint32_t color=color::bactria_cyan, Category category=Category{}, bool autostart=true)
 The constructor. More...
 
 Range (Range const &other)
 The copy constructor. More...
 
auto operator= (Range const &rhs) -> Range &
 The copy assignment operator. More...
 
 Range (Range &&other) noexcept
 The move constructor. More...
 
auto operator= (Range &&rhs) noexcept -> Range &
 The move assignment operator. More...
 
 ~Range () override
 The destructor. More...
 
auto start () noexcept -> void
 Manual start. More...
 
auto stop () noexcept -> void
 Manual stop. More...
 
auto is_running () const noexcept -> bool
 Query status. 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...
 

Detailed Description

The range class.

The range class is intended for improving the user's visualization experience. By using a range the user can define time spans that will be highlighted in the visualizer (if supported by the corresponding back-end). Back-ends which do not support user-defined visualization will silently ignore any user-defined ranges.

Unlike sectors, ranges can freely overlap and do not need to be correctly nested.

This class can be inherited from to create ranged objects. The objects' lifetimes will then be highlighted in the visualizer.

See also
Event

Constructor & Destructor Documentation

◆ Range() [1/4]

bactria::ranges::Range::Range ( )
inline

The default constructor.

Constructs a Range with the name BACTRIA_GENERIC_RANGE, the color bactria::color::blue and the default Category. It will not be started automatically.

See also
~Range, start, stop, Category

◆ Range() [2/4]

bactria::ranges::Range::Range ( std::string  name,
std::uint32_t  color = color::bactria_cyan,
Category  category = Category{},
bool  autostart = true 
)
inline

The constructor.

Constructs a Range with the name name, the color color and the Category category.

Parameters
nameThe name of the range as it should be shown on the visualizer.
colorThe range's color in ARGB format as it should be shown on the visualizer. Default: bactria::color::bactria_cyan.
categoryThe range's category. Default: bactria's default category.
autostartIf true start the range on construction. Default: true.
See also
~Range, start, stop, Category

◆ Range() [3/4]

bactria::ranges::Range::Range ( Range const &  other)
inline

The copy constructor.

Constructs a Range with the properties of the other Range. If other is already started this will be started on construction. Otherwise, this will not be started on construction.

Parameters
otherThe Range to copy from.
See also
~Range, start, stop

◆ Range() [4/4]

bactria::ranges::Range::Range ( Range &&  other)
inlinenoexcept

The move constructor.

Constructs a Range by moving the properties of the other Range into this. If other is already started this will keep running. Otherwise, this will not be started on construction.

After construction other will be in an undefined state.

See also
~Range, start, stop

◆ ~Range()

bactria::ranges::Range::~Range ( )
inlineoverride

The destructor.

Destructs the Range. If the Range was running until this point the destructor will end it automatically. After destruction this will be in an undefined state and needs to be reinitialized before being used again.

Member Function Documentation

◆ is_running()

auto bactria::ranges::Range::is_running ( ) const -> bool
inlinenoexcept

Query status.

Returns
If true then this has been started and can be stopped.

◆ operator=() [1/2]

auto bactria::ranges::Range::operator= ( Range &&  rhs) -> Range&
inlinenoexcept

The move assignment operator.

Moves the properties of the other Range into this. If other is already started this will keep running. Otherwise, this will not be started by the assignment.

After the assignment other will be in an undefined state.

See also
~Range, start, stop

◆ operator=() [2/2]

auto bactria::ranges::Range::operator= ( Range const &  rhs) -> Range&
inline

The copy assignment operator.

Copies the properties of the rhs Range. If rhs is already started this will be started by the assignment. Otherwise, this will not be started by the assignment.

Parameters
rhsThe Range to copy from.
See also
start, stop

◆ start()

auto bactria::ranges::Range::start ( ) -> void
inlinenoexcept

Manual start.

Manually starts the Range. If this was already started before the method will do nothing.

◆ stop()

auto bactria::ranges::Range::stop ( ) -> void
inlinenoexcept

Manual stop.

Manually stops the range. If this was not running before the method will do nothing.


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