Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class frame

boost::stacktrace::frame — Class that stores frame/function address and can get information about it at runtime.

Synopsis

// In header: <boost/stacktrace/detail/frame_decl.hpp>


class frame {
public:
  // types
  typedef unspecified native_frame_ptr_t;

  // public member functions
  frame() noexcept;
  frame(const frame &) = default;
  constexpr frame & operator=(const frame &) = default;
  explicit frame(native_frame_ptr_t) noexcept;
  template<typename T> explicit frame(T *) noexcept;
  std::string name() const;
  constexpr native_frame_ptr_t address() const noexcept;
  std::string source_file() const;
  std::size_t source_line() const;
  explicit constexpr operator bool() const noexcept;
  constexpr bool empty() const noexcept;
};

Description

frame public member functions

  1. frame() 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.
  2. frame(const frame &) = default;
    Copy constructs frame.

    Complexity: O(1).

    Async-Handler-Safety: Safe.

    Throws:

    Nothing.
  3. constexpr frame & operator=(const frame &) = default;
    Copy assigns frame.

    Complexity: O(1).

    Async-Handler-Safety: Safe.

    Throws:

    Nothing.
  4. 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.
  5. 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.
  6. std::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.
  7. constexpr native_frame_ptr_t address() const noexcept;

    Complexity: O(1).

    Async-Handler-Safety: Safe.

    Returns:

    Address of the frame function.

    Throws:

    Nothing.
  8. 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.
  9. 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.
  10. explicit constexpr operator bool() const noexcept;
    Checks that frame is not references NULL address.

    Complexity: O(1)

    Async-Handler-Safety: Safe.

    Returns:

    true if this->address() != 0

  11. constexpr bool empty() const noexcept;
    Checks that frame references NULL address.

    Complexity: O(1)

    Async-Handler-Safety: Safe.

    Returns:

    true if this->address() == 0


PrevUpHomeNext