bactria  0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
bactria::reports::Incident< TValue > Class Template Reference

The incident type. More...

#include <Incident.hpp>

Public Member Functions

 Incident ()=default
 Default constructor. More...
 
 Incident (std::string key, TValue value)
 Constructor. More...
 
 Incident (Incident const &other)
 Copy constructor. More...
 
auto operator= (Incident const &rhs) -> Incident &
 Copy-assignment operator. More...
 
 Incident (Incident &&other) noexcept
 Move constructor. More...
 
auto operator= (Incident &&rhs) noexcept -> Incident &
 Move-assignment operator. More...
 
 ~Incident ()=default
 Destructor.
 

Friends

template<typename... TIncidents>
class Report
 

Detailed Description

template<typename TValue>
class bactria::reports::Incident< TValue >

The incident type.

Users can define their own metrics by recording incidents. These are key-value pairs. The key is always a user-defined string, the value must be an arithmetic type or a std::string.

Template Parameters
TValueThe value recorded by the incident.
See also
IncidentRecorder

Constructor & Destructor Documentation

◆ Incident() [1/4]

template<typename TValue >
bactria::reports::Incident< TValue >::Incident ( )
default

Default constructor.

Constructs an Incident with the key BACTRIA_INCIDENT and a default-initialized value.

◆ Incident() [2/4]

template<typename TValue >
bactria::reports::Incident< TValue >::Incident ( std::string  key,
TValue  value 
)
inline

Constructor.

Constructs an Incident with the key key and the value value.

Parameters
keyThe key to store the value under.
valueThe value to store.

◆ Incident() [3/4]

template<typename TValue >
bactria::reports::Incident< TValue >::Incident ( Incident< TValue > const &  other)
inline

Copy constructor.

Copy-constructs an Incident from the other Incident. After construction, both this and other will contain identical copies of the key and the value.

Parameters
otherThe Incident to copy from.

◆ Incident() [4/4]

template<typename TValue >
bactria::reports::Incident< TValue >::Incident ( Incident< TValue > &&  other)
inlinenoexcept

Move constructor.

Constructs an Incident by moving other into this. After construction, this will have taken over the contents of other, while other is in an undefined state.

Parameters
otherThe Incident to move into this.

Member Function Documentation

◆ operator=() [1/2]

template<typename TValue >
auto bactria::reports::Incident< TValue >::operator= ( Incident< TValue > &&  rhs) -> Incident&
inlinenoexcept

Move-assignment operator.

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

Parameters
rhs

◆ operator=() [2/2]

template<typename TValue >
auto bactria::reports::Incident< TValue >::operator= ( Incident< TValue > const &  rhs) -> Incident&
inline

Copy-assignment operator.

Copies the contents of rhs into this. After the copy, both this and rhs will contain identical copies of the key and the value.

Parameters
rhsThe Incident to copy from.

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