Panda3D
Loading...
Searching...
No Matches
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.
 
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.
 
bool is_empty () const
 Returns true if the NodePath contains no nodes, or if it has been deleted.
 
 operator bool () const
 Returns true if this NodePath points to a valid, non-null node.
 
bool operator!= (const NodePath &other) const
 
bool operator!= (const WeakNodePath &other) const
 
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.
 

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.

Constructor & Destructor Documentation

◆ WeakNodePath() [1/2]

WeakNodePath::WeakNodePath ( const NodePath & node_path)
inline

Definition at line 17 of file weakNodePath.I.

◆ WeakNodePath() [2/2]

WeakNodePath::WeakNodePath ( const WeakNodePath & copy)
inline

Definition at line 27 of file weakNodePath.I.

◆ ~WeakNodePath()

WeakNodePath::~WeakNodePath ( )
inline

Definition at line 37 of file weakNodePath.I.

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 63 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 98 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 80 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 72 of file weakNodePath.I.

◆ operator=() [1/2]

void WeakNodePath::operator= ( const NodePath & node_path)
inline

Definition at line 44 of file weakNodePath.I.

◆ operator=() [2/2]

void WeakNodePath::operator= ( const WeakNodePath & copy)
inline

Definition at line 53 of file weakNodePath.I.

◆ output()

void WeakNodePath::output ( std::ostream & out) const

Definition at line 19 of file weakNodePath.cxx.

◆ 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.

Friends And Related Symbol Documentation

◆ NodePath

friend class NodePath
friend

Definition at line 68 of file weakNodePath.h.


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