PrevUpHomeNext

Class template node_ptr

boost::node_ptr

Synopsis

// In header: <boost/smart_ptr/root_ptr.hpp>

template<typename T> 
class node_ptr : public smart_ptr::detail::node_ptr_base< T > {
public:
  // types
  typedef T value_type;

  // construct/copy/destruct
  explicit node_ptr(node_proxy const &);
  template<typename V, typename PoolAllocator> 
    explicit node_ptr(node_proxy const &, node< V, PoolAllocator > *);
  template<typename V> node_ptr(node_ptr< V > const &);
  node_ptr(node_ptr< T > const &);
  template<typename V> node_ptr& operator=(node_ptr< V > const &);
  node_ptr& operator=(node_ptr< T > const &);
  template<typename V, typename PoolAllocator> 
    node_ptr& operator=(node< V, PoolAllocator > *);
  ~node_ptr();

  // public member functions
  template<typename V> void reset(node_ptr< V > const &);
  template<typename V, typename PoolAllocator> 
    void reset(node< V, PoolAllocator > *);
  bool cyclic() const;
};

Description

Deterministic region based memory manager.

Complete memory management utility on top of standard reference counting.

[Note] Note

Must be initialized with a reference to a node_proxy , given by a root_ptr<> .

node_ptr public construct/copy/destruct

  1. explicit node_ptr(node_proxy const & x);

    Initialization of a pointer.

    Parameters:

    x

    Reference to a node_proxy the pointer belongs to.

  2. template<typename V, typename PoolAllocator> 
      explicit node_ptr(node_proxy const & x, node< V, PoolAllocator > * p);

    Initialization of a pointer.

    Parameters:

    p

    New pointee object to manage.

    x

    Reference to a node_proxy the pointer belongs to.

  3. template<typename V> node_ptr(node_ptr< V > const & p);

    Initialization of a pointer.

    Parameters:

    p

    New pointer to manage.

  4. node_ptr(node_ptr< T > const & p);

    Initialization of a pointer.

    Parameters:

    p

    New pointer to manage.

  5. template<typename V> node_ptr& operator=(node_ptr< V > const & p);

    Assignment.

    Parameters:

    p

    New pointer to manage.

  6. node_ptr& operator=(node_ptr< T > const & p);

    Assignment.

    Parameters:

    p

    New pointer to manage.

  7. template<typename V, typename PoolAllocator> 
      node_ptr& operator=(node< V, PoolAllocator > * p);

    Assignment.

    Parameters:

    p

    New pointer to manage.

  8. ~node_ptr();

    Destructor.

node_ptr public member functions

  1. template<typename V> void reset(node_ptr< V > const & p);

    Assignment.

    Parameters:

    p

    New pointer to manage.

  2. template<typename V, typename PoolAllocator> 
      void reset(node< V, PoolAllocator > * p);

    Assignment.

    Parameters:

    p

    New pointer to manage.

  3. bool cyclic() const;

    Explicit cyclicism detection mechanism, for use only inside destructors.

    TODO I'm not sure what this means??? return if there is an object to destroy? Need a link to the example here See root_ptr_example1.cpp for an unfinished on.

    Returns:

    Whether the pointer inside a destructor points to an object already destroyed.


PrevUpHomeNext