Panda3D
Public Member Functions | List of all members
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"

Public Member Functions

 WeakNodePath (const NodePath &node_path)
 
 WeakNodePath (const WeakNodePath &copy)
 
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. More...
 
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. More...
 
int get_key () const
 Returns the same values as NodePath::get_key(). More...
 
NodePath get_node_path () const
 Returns the NodePath held within this object. More...
 
bool is_empty () const
 Returns true if the NodePath contains no nodes, or if it has been deleted. More...
 
PandaNodenode () const
 Returns the PandaNode held within this object. More...
 
bool operator!= (const NodePath &other) const
 Returns true if the two paths are not equivalent. More...
 
bool operator!= (const WeakNodePath &other) const
 Returns true if the two paths are not equivalent. More...
 
bool operator< (const NodePath &other) const
 Returns true if this NodePath sorts before the other one, false otherwise. More...
 
bool operator< (const WeakNodePath &other) const
 Returns true if this WeakNodePath sorts before the other one, false otherwise. More...
 
void operator= (const NodePath &node_path)
 
void operator= (const WeakNodePath &copy)
 
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. More...
 
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. More...
 
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. More...
 

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

◆ compare_to() [1/2]

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.

References operator==().

Referenced by operator<().

◆ compare_to() [2/2]

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.

References get_key().

◆ get_key()

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().

Referenced by compare_to().

◆ get_node_path()

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(), node(), and was_deleted().

Referenced by was_deleted().

◆ is_empty()

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.

References was_deleted().

Referenced by get_key(), and node().

◆ node()

PandaNode * WeakNodePath::node ( ) const
inline

Returns the PandaNode held within this object.

Definition at line 112 of file weakNodePath.I.

References is_empty(), and operator==().

Referenced by get_node_path().

◆ operator!=() [1/2]

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.

References operator<().

Referenced by operator==().

◆ operator!=() [2/2]

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.

References operator<().

◆ operator<() [1/2]

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.

References compare_to().

Referenced by operator!=().

◆ operator<() [2/2]

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.

References compare_to().

◆ operator==() [1/2]

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.

References operator!=().

Referenced by compare_to(), and node().

◆ operator==() [2/2]

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.

References operator!=().

◆ was_deleted()

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.

References get_node_path().

Referenced by get_key(), get_node_path(), and is_empty().


The documentation for this class was generated from the following files: