bactria  0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
bactria::Context Class Referencefinal

The context. More...

#include <Context.hpp>

Public Member Functions

 Context ()=default
 The constructor. More...
 
 Context (Context const &other) noexcept=default
 The copy constructor. More...
 
auto operator= (Context const &rhs) noexcept -> Context &=default
 The copy assignment operator. More...
 
 Context (Context &&other) noexcept
 The move constructor. More...
 
auto operator= (Context &&rhs) noexcept -> Context &
 The move assignment operator. More...
 
 ~Context ()
 The destructor. More...
 

Detailed Description

The context.

The bactria context. As long as at least one instance of this object exists in the process the user can use bactria's functionality. However, frequent Context creations and destructions should be avoided as they might result in significant overhead.

Constructor & Destructor Documentation

◆ Context() [1/3]

bactria::Context::Context ( )
default

The constructor.

Loads the plugins and maintains the plugins' internal states. It is allowed to have multiple Context objects because the plugins are reference counted. They will only be unloaded once the last Context in a process reaches the end of its lifetime.

See also
~Context

◆ Context() [2/3]

bactria::Context::Context ( Context const &  other)
defaultnoexcept

The copy constructor.

Copies a context. Internally, both Context objects will point to the same plugins.

Parameters
[in]otherThe context to copy from.

◆ Context() [3/3]

bactria::Context::Context ( Context &&  other)
inlinenoexcept

The move constructor.

Moves another context into this. The state of the original context is undefined afterwards, while this will maintain the original state.

Parameters
[in,out]otherThe context to move into this.
See also
~Context

◆ ~Context()

bactria::Context::~Context ( )
inline

The destructor.

Destructs the context. If there are multiple Context objects in the process, this will decrement the plugins' reference counters. Otherwise, the plugins are unloaded. In this case, bactria's functionality can no longer be safely used.

See also
Context()

Member Function Documentation

◆ operator=() [1/2]

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

The move assignment operator.

Moves another context into this. The state of the original context is undefined afterwards, while this will maintain the original state.

Parameters
[in,out]rhsThe context to move into this.

◆ operator=() [2/2]

auto bactria::Context::operator= ( Context const &  rhs) -> Context &=default
defaultnoexcept

The copy assignment operator.

Copies a context. Internally, both Context objects will point to the same plugins.

Parameters
[in]rhsThe context to copy from.

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