Changed classname from frame_view to frame

This commit is contained in:
Antony Polukhin
2016-11-25 21:59:30 +03:00
parent 6f8cbefbf2
commit aff892356f
7 changed files with 41 additions and 41 deletions

View File

@@ -12,7 +12,7 @@
# pragma once
#endif
#include <boost/stacktrace/frame_view.hpp>
#include <boost/stacktrace/frame.hpp>
#include <boost/stacktrace/stacktrace.hpp>
#endif // BOOST_STACKTRACE_HPP

View File

@@ -16,26 +16,26 @@
#include <boost/assert.hpp>
#include <boost/stacktrace/detail/backend.hpp>
#include <boost/stacktrace/frame_view.hpp>
#include <boost/stacktrace/frame.hpp>
namespace boost { namespace stacktrace {
// Forward declarations
class stacktrace;
/// Random access iterator over frames that returns `frame_view` on dereference.
/// Random access iterator over frames that returns `frame` on dereference.
class const_iterator: public boost::iterator_facade<
const_iterator,
frame_view,
frame,
boost::random_access_traversal_tag,
frame_view>
frame>
{
/// @cond
typedef boost::iterator_facade<
const_iterator,
frame_view,
frame,
boost::random_access_traversal_tag,
frame_view
frame
> base_t;
const boost::stacktrace::detail::backend* impl_;
@@ -49,8 +49,8 @@ class const_iterator: public boost::iterator_facade<
friend class ::boost::stacktrace::stacktrace;
friend class ::boost::iterators::iterator_core_access;
frame_view dereference() const BOOST_NOEXCEPT {
return frame_view(impl_->get_address(frame_no_));
frame dereference() const BOOST_NOEXCEPT {
return frame(impl_->get_address(frame_no_));
}
bool equal(const const_iterator& it) const BOOST_NOEXCEPT {

View File

@@ -4,8 +4,8 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_STACKTRACE_FRAME_VIEW_HPP
#define BOOST_STACKTRACE_FRAME_VIEW_HPP
#ifndef BOOST_STACKTRACE_FRAME_HPP
#define BOOST_STACKTRACE_FRAME_HPP
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
@@ -23,35 +23,35 @@ namespace boost { namespace stacktrace {
class const_iterator;
/// Non-owning class that references the frame information stored inside the boost::stacktrace::stacktrace class.
class frame_view {
class frame {
/// @cond
const void* addr_;
frame_view(); // = delete
frame(); // = delete
/// @endcond
public:
#ifdef BOOST_STACKTRACE_DOXYGEN_INVOKED
frame_view() = delete;
frame() = delete;
/// @brief Copy constructs frame_view.
/// @brief Copy constructs frame.
/// @throws Nothing.
///
/// @b Complexity: O(1).
frame_view(const frame_view&) = default;
frame(const frame&) = default;
/// @brief Copy assigns frame_view.
/// @brief Copy assigns frame.
/// @throws Nothing.
///
/// @b Complexity: O(1).
frame_view& operator=(const frame_view&) = default;
frame& operator=(const frame&) = default;
#endif
/// @brief Constructs frame_view that can extract information from addr at runtime.
/// @brief Constructs frame that can extract information from addr at runtime.
/// @throws Nothing.
///
/// @b Complexity: O(1).
explicit frame_view(const void* addr) BOOST_NOEXCEPT
explicit frame(const void* addr) BOOST_NOEXCEPT
: addr_(addr)
{}
@@ -82,21 +82,21 @@ public:
};
/// Comparison operators that provide platform dependant ordering and have O(1) complexity.
inline bool operator< (const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return lhs.address() < rhs.address(); }
inline bool operator> (const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return rhs < lhs; }
inline bool operator<=(const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return !(lhs > rhs); }
inline bool operator>=(const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return !(lhs < rhs); }
inline bool operator==(const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return lhs.address() == rhs.address(); }
inline bool operator!=(const frame_view& lhs, const frame_view& rhs) BOOST_NOEXCEPT { return !(lhs == rhs); }
inline bool operator< (const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return lhs.address() < rhs.address(); }
inline bool operator> (const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return rhs < lhs; }
inline bool operator<=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs > rhs); }
inline bool operator>=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs < rhs); }
inline bool operator==(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return lhs.address() == rhs.address(); }
inline bool operator!=(const frame& lhs, const frame& rhs) BOOST_NOEXCEPT { return !(lhs == rhs); }
/// Hashing support, O(1) complexity.
inline std::size_t hash_value(const frame_view& f) BOOST_NOEXCEPT {
inline std::size_t hash_value(const frame& f) BOOST_NOEXCEPT {
return reinterpret_cast<std::size_t>(f.address());
}
/// Outputs stacktrace::frame in a human readable format to output stream.
template <class CharT, class TraitsT>
std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const frame_view& f) {
std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const frame& f) {
os << f.name();
if (f.source_line()) {
@@ -108,4 +108,4 @@ std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT
}} // namespace boost::stacktrace
#endif // BOOST_STACKTRACE_FRAME_VIEW_HPP
#endif // BOOST_STACKTRACE_FRAME_HPP

View File

@@ -19,7 +19,7 @@
#include <string>
#include <boost/stacktrace/detail/backend.hpp>
#include <boost/stacktrace/frame_view.hpp>
#include <boost/stacktrace/frame.hpp>
#include <boost/stacktrace/const_iterator.hpp>
namespace boost { namespace stacktrace {
@@ -34,9 +34,9 @@ class stacktrace {
/// @endcond
public:
typedef frame_view reference;
typedef frame reference;
/// @brief Random access iterator that returns frame_view.
/// @brief Random access iterator that returns frame.
typedef boost::stacktrace::const_iterator iterator;
typedef iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
@@ -79,10 +79,10 @@ public:
/// @param frame_no Zero based index of frame to return. 0
/// is the function index where stacktrace was constructed and
/// index close to this->size() contains function `main()`.
/// @returns frame_view that references the actual frame info, stored inside *this.
/// @returns frame that references the actual frame info, stored inside *this.
///
/// @b Complexity: Amortized O(1), O(1) for noop backend.
frame_view operator[](std::size_t frame_no) const BOOST_NOEXCEPT {
frame operator[](std::size_t frame_no) const BOOST_NOEXCEPT {
return *(cbegin() + frame_no);
}