dart
Public Member Functions | Protected Attributes | Friends | List of all members
dart::dynamics::TemplateWeakNodePtr< NodeT, BodyNodeT > Class Template Reference

TemplateWeakNodePtr is a templated class that enables users to create a weak non-reference-holding WeakNodePtr. More...

#include <NodePtr.hpp>

Public Member Functions

 TemplateWeakNodePtr ()
 Default constructor.
 
 TemplateWeakNodePtr (NodeT *_ptr)
 Typical constructor. More...
 
template<class OtherNodeT , class OtherBodyNodeT >
 TemplateWeakNodePtr (const TemplateWeakNodePtr< OtherNodeT, OtherBodyNodeT > &_weakPtr)
 Constructor that takes in a WeakNodePtr.
 
template<class OtherNodeT , class OtherBodyNodeT >
 TemplateWeakNodePtr (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_strongPtr)
 Constructor that takes in a strong NodePtr.
 
TemplateWeakNodePtroperator= (NodeT *_ptr)
 Assignment operator for raw Node pointers.
 
template<class OtherNodeT , class OtherBodyNodeT >
TemplateWeakNodePtroperator= (const TemplateWeakNodePtr< OtherNodeT, OtherBodyNodeT > &_weakPtr)
 Assignment operator for WeakNodePtrs.
 
template<class OtherNodeT , class OtherBodyNodeT >
TemplateWeakNodePtroperator= (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_strongPtr)
 Assignment operator for strong NodePtrs.
 
TemplateNodePtr< NodeT, BodyNodeT > lock () const
 Locks the Node reference to ensure that the referenced Node is currently still available. More...
 
void set (NodeT *_ptr)
 Set the Node for this WeakNodePtr.
 
template<class OtherNodeT , class OtherBodyNodeT >
void set (const TemplateWeakNodePtr< OtherNodeT, OtherBodyNodeT > &_weakPtr)
 Set the Node for this WeakNodePtr based on another WeakNodePtr.
 

Protected Attributes

NodeT * mNode
 Node that this pointer references.
 
std::weak_ptr< NodeDestructormWeakDestructor
 Destructor for the Node.
 
TemplateWeakBodyNodePtr< BodyNodeT > mWeakBodyNodePtr
 Pointer to the BodyNode that the Node is attached to.
 

Friends

template<class , class >
class TemplateWeakNodePtr
 

Detailed Description

template<class NodeT, class BodyNodeT>
class dart::dynamics::TemplateWeakNodePtr< NodeT, BodyNodeT >

TemplateWeakNodePtr is a templated class that enables users to create a weak non-reference-holding WeakNodePtr.

Holding onto a WeakNodePtr will NOT prevent anything from getting deleted, but you can use lock() to check whether the Node still exists. If it does exist, it will return a valid NodePtr. Otherwise it will return a nullptr NodePtr.

Constructor & Destructor Documentation

◆ TemplateWeakNodePtr()

template<class NodeT, class BodyNodeT>
dart::dynamics::TemplateWeakNodePtr< NodeT, BodyNodeT >::TemplateWeakNodePtr ( NodeT *  _ptr)
inline

Typical constructor.

_ptr must be a valid pointer (or a nullptr) when passed to this constructor

Member Function Documentation

◆ lock()

template<class NodeT, class BodyNodeT>
TemplateNodePtr<NodeT, BodyNodeT> dart::dynamics::TemplateWeakNodePtr< NodeT, BodyNodeT >::lock ( ) const
inline

Locks the Node reference to ensure that the referenced Node is currently still available.

If the Node is not available any longer (i.e. has been deleted), then this will return a nullptr.


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