A simple type-erase stacktrace abstraction.
More...
#include <Stacktrace.hpp>
|
using | size_fn = std::size_t (*)(const std::any&) |
|
using | empty_fn = bool (*)(const std::any&) |
|
using | description_fn = std::string (*)(const std::any&, std::size_t) |
|
using | source_file_fn = std::string (*)(const std::any&, std::size_t) |
|
using | source_line_fn = std::size_t (*)(const std::any&, std::size_t) |
|
|
| ~Stacktrace ()=default |
| Defaulted destructor.
|
|
template<typename Inner>
requires (!std::same_as<Stacktrace, std::remove_cvref_t<Inner>>) && stacktrace::backend<Inner> |
constexpr | Stacktrace (Inner &&inner) |
| Constructor storing the given stacktrace-backend type-erased.
|
|
| Stacktrace (const Stacktrace &)=default |
| Defaulted move-constructor.
|
|
Stacktrace & | operator= (const Stacktrace &)=default |
| Defaulted move-assignment-operator.
|
|
| Stacktrace (Stacktrace &&)=default |
| Defaulted copy-constructor.
|
|
Stacktrace & | operator= (Stacktrace &&)=default |
| Defaulted copy-assignment-operator.
|
|
constexpr std::size_t | size () const |
| Queries the underlying stacktrace-backend for its size.
|
|
constexpr bool | empty () const |
| Queries the underlying stacktrace-backend whether its empty.
|
|
constexpr std::string | description (const std::size_t at) const |
| Queries the underlying stacktrace-backend for the description of the selected stacktrace-entry.
|
|
constexpr std::string | source_file (const std::size_t at) const |
| Queries the underlying stacktrace-backend for the source-file of the selected stacktrace-entry.
|
|
constexpr std::size_t | source_line (const std::size_t at) const |
| Queries the underlying stacktrace-backend for the source-line of the selected stacktrace-entry.
|
|
A simple type-erase stacktrace abstraction.
◆ description_fn
◆ empty_fn
◆ size_fn
◆ source_file_fn
◆ source_line_fn
◆ ~Stacktrace()
mimicpp::Stacktrace::~Stacktrace |
( |
| ) |
|
|
default |
◆ Stacktrace() [1/3]
template<typename Inner>
requires (!std::same_as<
Stacktrace, std::remove_cvref_t<Inner>>) && stacktrace::backend<Inner>
mimicpp::Stacktrace::Stacktrace |
( |
Inner && | inner | ) |
|
|
inlineexplicitnodiscardconstexpr |
Constructor storing the given stacktrace-backend type-erased.
- Template Parameters
-
Inner | The actual stacktrace-backend type. |
Traits | The auto-detected trait type. |
- Parameters
-
inner | The actual stacktrace-backend object. |
◆ Stacktrace() [2/3]
mimicpp::Stacktrace::Stacktrace |
( |
const Stacktrace & | | ) |
|
|
nodiscarddefault |
Defaulted move-constructor.
◆ Stacktrace() [3/3]
Defaulted copy-constructor.
◆ description()
std::string mimicpp::Stacktrace::description |
( |
const std::size_t | at | ) |
const |
|
inlinenodiscardconstexpr |
Queries the underlying stacktrace-backend for the description of the selected stacktrace-entry.
- Parameters
-
at | The stacktrace-entry index. |
- Returns
- The description of the selected stacktrace-entry.
◆ empty()
bool mimicpp::Stacktrace::empty |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Queries the underlying stacktrace-backend whether its empty.
- Returns
True
if no stacktrace-entries exist.
◆ operator=() [1/2]
Defaulted move-assignment-operator.
◆ operator=() [2/2]
Defaulted copy-assignment-operator.
◆ size()
std::size_t mimicpp::Stacktrace::size |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Queries the underlying stacktrace-backend for its size.
- Returns
- The stacktrace-entry size.
◆ source_file()
std::string mimicpp::Stacktrace::source_file |
( |
const std::size_t | at | ) |
const |
|
inlinenodiscardconstexpr |
Queries the underlying stacktrace-backend for the source-file of the selected stacktrace-entry.
- Parameters
-
at | The stacktrace-entry index. |
- Returns
- The source-file of the selected stacktrace-entry.
◆ source_line()
std::size_t mimicpp::Stacktrace::source_line |
( |
const std::size_t | at | ) |
const |
|
inlinenodiscardconstexpr |
Queries the underlying stacktrace-backend for the source-line of the selected stacktrace-entry.
- Parameters
-
at | The stacktrace-entry index. |
- Returns
- The source-line of the selected stacktrace-entry.
◆ operator==
The documentation for this class was generated from the following file: