...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::stacktrace::frame — Class that stores frame/function address and can get information about it at runtime.
// In header: <boost/stacktrace/detail/frame_decl.hpp> class frame { public: // types typedef unspecified native_frame_ptr_t; // construct/copy/destruct frame() noexcept; frame(const frame &) = default; explicit frame(native_frame_ptr_t) noexcept; template<typename T> explicit frame(T *) noexcept; constexpr frame & operator=(const frame &) = default; // public member functions std::string name() const; constexpr native_frame_ptr_t address() const noexcept; std::string source_file() const; std::size_t source_line() const; constexpr bool empty() const noexcept; };
frame
public
construct/copy/destructframe() noexcept;Constructs frame that references NULL address. Calls to source_file() and source_line() will return empty string. Calls to source_line() will return 0.
Complexity: O(1).
Async-Handler-Safety: Safe.
Throws: |
Nothing. |
frame(const frame &) = default;Copy constructs frame.
Complexity: O(1).
Async-Handler-Safety: Safe.
Throws: |
Nothing. |
explicit frame(native_frame_ptr_t addr) noexcept;Constructs frame that references addr and could later generate information about that address using platform specific features.
Complexity: O(1).
Async-Handler-Safety: Safe.
Throws: |
Nothing. |
template<typename T> explicit frame(T * function_addr) noexcept;Constructs frame that references function_addr and could later generate information about that function using platform specific features.
Complexity: O(1).
Async-Handler-Safety: Safe.
Throws: |
Nothing. |
constexpr frame & operator=(const frame &) = default;Copy assigns frame.
Complexity: O(1).
Async-Handler-Safety: Safe.
Throws: |
Nothing. |
frame
public member functionsstd::string name() const;
Complexity: unknown (lots of platform specific work).
Async-Handler-Safety: Unsafe.
Returns: |
Name of the frame (function name in a human readable form). |
Throws: |
std::bad_alloc if not enough memory to construct resulting string. |
constexpr native_frame_ptr_t address() const noexcept;
Complexity: O(1).
Async-Handler-Safety: Safe.
Returns: |
Address of the frame function. |
Throws: |
Nothing. |
std::string source_file() const;
Complexity: unknown (lots of platform specific work).
Async-Handler-Safety: Unsafe.
Returns: |
Path to the source file, were the function of the frame is defined. Returns empty string if this->source_line() == 0. |
Throws: |
std::bad_alloc if not enough memory to construct resulting string. |
std::size_t source_line() const;
Complexity: unknown (lots of platform specific work).
Async-Handler-Safety: Unsafe.
Returns: |
Code line in the source file, were the function of the frame is defined. |
Throws: |
std::bad_alloc if not enough memory to construct string for internal needs. |
constexpr bool empty() const noexcept;Checks that frame is not references NULL address.
Complexity: O(1)
Async-Handler-Safety: Safe. Checks that frame references NULL address. Complexity: O(1)
Async-Handler-Safety: Safe.
Returns: |
|
Returns: |
|