Panda3D
Public Member Functions | Friends | 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)
 
void clear ()
 Sets this NodePath to the empty NodePath. More...
 
int compare_to (const NodePath &other) const
 
int compare_to (const WeakNodePath &other) const
 
int get_key () const
 
NodePath get_node_path () const
 Returns the NodePath held within this object, or an empty NodePath with the error flag set if the object was deleted. More...
 
bool is_empty () const
 Returns true if the NodePath contains no nodes, or if it has been deleted. More...
 
bool operator != (const NodePath &other) const
 
bool operator != (const WeakNodePath &other) const
 
 operator bool () const
 Returns true if this NodePath points to a valid, non-null node. More...
 
bool operator< (const NodePath &other) const
 
bool operator< (const WeakNodePath &other) const
 
void operator= (const NodePath &node_path)
 
void operator= (const WeakNodePath &copy)
 
bool operator== (const NodePath &other) const
 
bool operator== (const WeakNodePath &other) const
 
void output (std::ostream &out) const
 
 PT (PandaNode) node() const
 
bool was_deleted () const
 Returns true if the NodePath we were referencing has been quietly deleted outside of the WeakNodePath. More...
 

Friends

class NodePath
 

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 32 of file weakNodePath.h.

Member Function Documentation

◆ clear()

void WeakNodePath::clear ( )
inline

Sets this NodePath to the empty NodePath.

It will no longer point to any node.

Definition at line 64 of file weakNodePath.I.

◆ get_node_path()

NodePath WeakNodePath::get_node_path ( ) const
inline

Returns the NodePath held within this object, or an empty NodePath with the error flag set if the object was deleted.

Definition at line 99 of file weakNodePath.I.

◆ 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 81 of file weakNodePath.I.

◆ operator bool()

WeakNodePath::operator bool ( ) const
inline

Returns true if this NodePath points to a valid, non-null node.

Definition at line 73 of file weakNodePath.I.

◆ 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 90 of file weakNodePath.I.


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