Panda3D
Public Member Functions

WeakNodePath Class Reference

This class is a wrapper around a NodePath that, unlike the actual NodePath class, doesn't hold a reference count to the node. More...

#include "weakNodePath.h"

List of all members.

Public Member Functions

 WeakNodePath (const NodePath &node_path)
 WeakNodePath (const WeakNodePath &copy)
int compare_to (const WeakNodePath &other) const
 Returns a number less than zero if this WeakNodePath sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
int compare_to (const NodePath &other) const
 Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
int get_key () const
 Returns the same values as NodePath::get_key().
NodePath get_node_path () const
 Returns the NodePath held within this object.
bool is_empty () const
 Returns true if the NodePath contains no nodes, or if it has been deleted.
PandaNodenode () const
 Returns the PandaNode held within this object.
bool operator!= (const NodePath &other) const
 Returns true if the two paths are not equivalent.
bool operator!= (const WeakNodePath &other) const
 Returns true if the two paths are not equivalent.
bool operator< (const WeakNodePath &other) const
 Returns true if this WeakNodePath sorts before the other one, false otherwise.
bool operator< (const NodePath &other) const
 Returns true if this NodePath sorts before the other one, false otherwise.
void operator= (const WeakNodePath &copy)
void operator= (const NodePath &node_path)
bool operator== (const WeakNodePath &other) const
 Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the same order.
bool operator== (const NodePath &other) const
 Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the same order.
void output (ostream &out) const
bool was_deleted () const
 Returns true if the NodePath we were referencing has been quietly deleted outside of the WeakNodePath.

Detailed Description

This class is a wrapper around a NodePath that, unlike the actual NodePath class, doesn't hold a reference count to the node.

Thus the node may be detached from the scene graph and destructed at any time.

You can call is_valid() or was_deleted() at any time to determine whether the node is still around; if it is, get_node_path() will return the associated NodePath.

Definition at line 37 of file weakNodePath.h.


Member Function Documentation

int WeakNodePath::compare_to ( const NodePath other) const [inline]

Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.

Two NodePaths are considered equivalent if they consist of exactly the same list of nodes in the same order. Otherwise, they are different; different NodePaths will be ranked in a consistent but undefined ordering; the ordering is useful only for placing the NodePaths in a sorted container like an STL set.

Definition at line 169 of file weakNodePath.I.

int WeakNodePath::compare_to ( const WeakNodePath other) const [inline]

Returns a number less than zero if this WeakNodePath sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.

Two WeakNodePaths are considered equivalent if they consist of exactly the same list of nodes in the same order. Otherwise, they are different; different WeakNodePaths will be ranked in a consistent but undefined ordering; the ordering is useful only for placing the WeakNodePaths in a sorted container like an STL set.

Definition at line 228 of file weakNodePath.I.

int WeakNodePath::get_key ( ) const [inline]

Returns the same values as NodePath::get_key().

Definition at line 241 of file weakNodePath.I.

References is_empty(), and was_deleted().

NodePath WeakNodePath::get_node_path ( ) const [inline]

Returns the NodePath held within this object.

Definition at line 99 of file weakNodePath.I.

References NodePath::fail(), and was_deleted().

bool WeakNodePath::is_empty ( ) const [inline]

Returns true if the NodePath contains no nodes, or if it has been deleted.

Definition at line 78 of file weakNodePath.I.

Referenced by get_key(), and node().

PandaNode * WeakNodePath::node ( ) const [inline]

Returns the PandaNode held within this object.

Definition at line 112 of file weakNodePath.I.

References is_empty().

bool WeakNodePath::operator!= ( const NodePath other) const [inline]

Returns true if the two paths are not equivalent.

Definition at line 135 of file weakNodePath.I.

bool WeakNodePath::operator!= ( const WeakNodePath other) const [inline]

Returns true if the two paths are not equivalent.

Definition at line 194 of file weakNodePath.I.

bool WeakNodePath::operator< ( const WeakNodePath other) const [inline]

Returns true if this WeakNodePath sorts before the other one, false otherwise.

The sorting order of two nonequivalent WeakNodePaths is consistent but undefined, and is useful only for storing WeakNodePaths in a sorted container like an STL set.

Definition at line 208 of file weakNodePath.I.

bool WeakNodePath::operator< ( const NodePath other) const [inline]

Returns true if this NodePath sorts before the other one, false otherwise.

The sorting order of two nonequivalent NodePaths is consistent but undefined, and is useful only for storing NodePaths in a sorted container like an STL set.

Definition at line 149 of file weakNodePath.I.

bool WeakNodePath::operator== ( const NodePath other) const [inline]

Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the same order.

Definition at line 125 of file weakNodePath.I.

bool WeakNodePath::operator== ( const WeakNodePath other) const [inline]

Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the same order.

Definition at line 184 of file weakNodePath.I.

bool WeakNodePath::was_deleted ( ) const [inline]

Returns true if the NodePath we were referencing has been quietly deleted outside of the WeakNodePath.

Definition at line 89 of file weakNodePath.I.

Referenced by get_key(), and get_node_path().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations