PrevUpHomeNext

Class template call_stack

boost::call_stack::call_stack

Synopsis

// In header: <boost/call_stack/stack.hpp>

template<std::size_t MaxDepth> 
class call_stack {
public:
  // types
  typedef unspecified                       base_type;             
  typedef base_type::depth_type             depth_type;            
  typedef base_type::stack_type             stack_type;            
  typedef base_type::size_type              size_type;             
  typedef base_type::difference_type        difference_type;       
  typedef base_type::value_type             value_type;              // call_frame in disguise 
  typedef base_type::const_reference        const_reference;         // const reference to a call_frame
  typedef base_type::const_iterator         const_iterator;          // const iterator yielding a call_frame
  typedef base_type::const_reverse_iterator const_reverse_iterator;

  // construct/copy/destruct
  call_stack(bool = false);
  call_stack(const call_stack &);
  call_stack& operator=(call_stack);

  // public member functions
  size_type depth() const;
  size_type size() const;
  size_type max_depth() const;
  size_type max_size() const;
  size_type capacity() const;
  bool empty() const;
  const_iterator begin() const;
  const_iterator end() const;
  const_iterator cbegin() const;
  const_iterator cend() const;
  const_reverse_iterator crbegin() const;
  const_reverse_iterator crend() const;
  const_reverse_iterator rbegin() const;
  const_reverse_iterator rend() const;
  const_reference operator[](size_type) const;
  const_reference at(size_type) const;
  bool operator==(const call_stack &) const;
  bool operator!=(const call_stack &) const;
  void swap(call_stack &);
  depth_type get_stack();
};

Description

Platform-agnostic call stack information. A collection of call_frame. Use call_stack_info to render it in a human-readable form.

Template Parameters

  1. std::size_t MaxDepth

    dictates the maximum number of frames that can be captured.

call_stack public construct/copy/destruct

  1. call_stack(bool capture = false);

    By default, the constructor will not capture the run-time call stack when the object is constructed.

    See Also:

    get_stack() for an alternate way to capure the run-time stack after construction.

    Parameters:

    capture

    If 'true', the run-time stack will be captured.

  2. call_stack(const call_stack & other);
  3. call_stack& operator=(call_stack other);

call_stack public member functions

  1. size_type depth() const;

    Depth of the captured run-time stack.

  2. size_type size() const;
  3. size_type max_depth() const;

    Maximum depth of the call stack. If the run-time call stack is deeper than max_depth(), the captured information will be truncated.

  4. size_type max_size() const;
  5. size_type capacity() const;
  6. bool empty() const;
  7. const_iterator begin() const;

    Returns:

    an iterator pointing to a call_frame.

  8. const_iterator end() const;
  9. const_iterator cbegin() const;
  10. const_iterator cend() const;
  11. const_reverse_iterator crbegin() const;
  12. const_reverse_iterator crend() const;
  13. const_reverse_iterator rbegin() const;
  14. const_reverse_iterator rend() const;
  15. const_reference operator[](size_type idx) const;

    Returns:

    a const reference to a call_frame.

  16. const_reference at(size_type idx) const;
  17. bool operator==(const call_stack & other) const;
  18. bool operator!=(const call_stack & other) const;
  19. void swap(call_stack & other);
  20. depth_type get_stack();

    Capture the call stack at the place where get_stack() is called.


PrevUpHomeNext