Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches

Captured and filtered stacktrace with string conversion support. More...

#include <stacktrace.hpp>

Public Member Functions

constexpr Stacktrace ()=default
constexpr Stacktrace (const Stacktrace &)=default
constexpr Stacktrace (Stacktrace &&) noexcept=default
constexpr ~Stacktrace () noexcept=default
constexpr Stacktraceoperator= (const Stacktrace &)=default
constexpr Stacktraceoperator= (Stacktrace &&) noexcept=default
std::string ToString (bool include_header=true) const
 Converts stacktrace to a formatted string.
constexpr bool Empty () const noexcept
 Checks if no frames were captured.
constexpr auto Frames () const noexcept -> std::span< const std::string >
 Returns captured frames.
constexpr size_t Size () const noexcept
 Returns number of captured frames.

Static Public Member Functions

static Stacktrace Capture (const StacktraceConfig &config={})
 Captures stacktrace using provided config.

Detailed Description

Captured and filtered stacktrace with string conversion support.

Definition at line 77 of file stacktrace.hpp.

Constructor & Destructor Documentation

◆ Stacktrace() [1/3]

helios::Stacktrace::Stacktrace ( )
constexprdefault

◆ Stacktrace() [2/3]

helios::Stacktrace::Stacktrace ( const Stacktrace & )
constexprdefault

◆ Stacktrace() [3/3]

helios::Stacktrace::Stacktrace ( Stacktrace && )
constexprdefaultnoexcept

◆ ~Stacktrace()

helios::Stacktrace::~Stacktrace ( )
constexprdefaultnoexcept

Member Function Documentation

◆ Capture()

Stacktrace helios::Stacktrace::Capture ( const StacktraceConfig & config = {})
staticnodiscard

Captures stacktrace using provided config.

Parameters
configCapture and formatting configuration
Returns
Captured stacktrace object

Definition at line 288 of file stacktrace.cpp.

◆ Empty()

bool helios::Stacktrace::Empty ( ) const
inlinenodiscardconstexprnoexcept

Checks if no frames were captured.

Returns
True if no frames were captured, false otherwise

Definition at line 105 of file stacktrace.hpp.

◆ Frames()

auto helios::Stacktrace::Frames ( ) const -> std::span< const std::string >
inlinenodiscardconstexprnoexcept

Returns captured frames.

Returns
Read-only span of captured frames

Definition at line 113 of file stacktrace.hpp.

◆ operator=() [1/2]

Stacktrace & helios::Stacktrace::operator= ( const Stacktrace & )
constexprdefault

◆ operator=() [2/2]

Stacktrace & helios::Stacktrace::operator= ( Stacktrace && )
constexprdefaultnoexcept

◆ Size()

size_t helios::Stacktrace::Size ( ) const
inlinenodiscardconstexprnoexcept

Returns number of captured frames.

Returns
Number of captured frames

Definition at line 122 of file stacktrace.hpp.

◆ ToString()

std::string helios::Stacktrace::ToString ( bool include_header = true) const
nodiscard

Converts stacktrace to a formatted string.

Parameters
include_headerWhether to include Stack trace: header
Returns
Formatted stacktrace string

Definition at line 303 of file stacktrace.cpp.