Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

NodePtr Class Reference

A reference-counted smart pointer for Nodes. More...

List of all members.


Public Methods

 NodePtr (Node *node=0)
 Constructor.

 NodePtr (const NodePtr &nodePtr)
 Copy constructor.

 ~NodePtr ()
 Destructor.

 operator bool () const
 Automatic conversion to bool.

NodePtr & operator= (const NodePtr &nodePtr)
 Assignment operator.

bool operator== (const NodePtr &nodePtr) const
 Compare two NodePtrs.

Nodeoperator * () const
 Dereference operator.

Nodeoperator-> () const
 Access a method of the Node.

Nodeget () const
 Get a raw pointer to the Node.

void reset (Node *node=0)
 Reset the NodePtr to point to a different Node.

void swap (NodePtr &nodePtr) throw ()

Private Methods

void dispose () throw ()
void share (std::map< Node *, size_t >::value_type *countPtr) throw ()

Private Attributes

std::map< Node *, size_t
>::value_type * 
countPtr

Friends

class ScriptNode
 Script nodes can be self-referential, so NodePtr works some special magic.


Detailed Description

A reference-counted smart pointer for Nodes.


Constructor & Destructor Documentation

NodePtr Node   node = 0 [explicit]
 

Constructor.

Parameters:
node a pointer to a Node

NodePtr const NodePtr &    nodePtr
 

Copy constructor.

Parameters:
nodePtr 

~NodePtr   [inline]
 

Destructor.


Member Function Documentation

Node * get   const [inline]
 

Get a raw pointer to the Node.

Returns:
a raw pointer to the underlying Node.

Node & operator *   const [inline]
 

Dereference operator.

Returns:
a reference to the underlying Node.

operator bool   const [inline]
 

Automatic conversion to bool.

Node * operator->   const [inline]
 

Access a method of the Node.

NodePtr & operator= const NodePtr &    nodePtr [inline]
 

Assignment operator.

Parameters:
nodePtr 

bool operator== const NodePtr &    nodePtr const [inline]
 

Compare two NodePtrs.

Returns:
true if both NodePtrs point to the same Node; false otherwise.

void reset Node   node = 0
 

Reset the NodePtr to point to a different Node.

Parameters:
node 

Friends And Related Function Documentation

ScriptNode [friend]
 

Script nodes can be self-referential, so NodePtr works some special magic.