// Copyright Antony Polukhin, 2016-2017. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_STACKTRACE_FRAME_HPP #define BOOST_STACKTRACE_FRAME_HPP #include #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif #include #include #include #include // boost::stacktrace::detail::native_frame_ptr_t #include #include namespace boost { namespace stacktrace { /// Comparison operators that provide platform dependant ordering and have O(1) complexity; are Async-Handler-Safe. BOOST_CONSTEXPR inline bool operator< (const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return lhs.address() < rhs.address(); } BOOST_CONSTEXPR inline bool operator> (const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return rhs < lhs; } BOOST_CONSTEXPR inline bool operator<=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs > rhs); } BOOST_CONSTEXPR inline bool operator>=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs < rhs); } BOOST_CONSTEXPR inline bool operator==(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return lhs.address() == rhs.address(); } BOOST_CONSTEXPR inline bool operator!=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs == rhs); } /// Fast hashing support, O(1) complexity; Async-Handler-Safe. inline std::size_t hash_value(const frame& f) BOOST_NOEXCEPT { return reinterpret_cast(f.address()); } /// Outputs stacktrace::frame in a human readable format to string; unsafe to use in async handlers. BOOST_STACKTRACE_FUNCTION std::string to_string(const frame& f); /// Outputs stacktrace::frame in a human readable format to output stream; unsafe to use in async handlers. template std::basic_ostream& operator<<(std::basic_ostream& os, const frame& f) { return os << boost::stacktrace::to_string(f); } }} // namespace boost::stacktrace /// @cond #include #ifndef BOOST_STACKTRACE_LINK # if defined(BOOST_STACKTRACE_USE_NOOP) # include # elif defined(BOOST_MSVC) || defined(BOOST_STACKTRACE_USE_WINDBG) || defined(BOOST_STACKTRACE_USE_WINDBG_CACHED) # include # else # include # endif #endif /// @endcond #endif // BOOST_STACKTRACE_FRAME_HPP