DART  6.7.3
dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT > Class Template Reference

TemplateNodePtr is a templated class that enables users to create a strong reference-counting NodePtr. More...

#include <NodePtr.hpp>

Public Types

using element_type = NodeT
 

Public Member Functions

 TemplateNodePtr ()
 Default constructor. More...
 
 TemplateNodePtr (NodeT *_ptr)
 Typical constructor. More...
 
template<class OtherNodeT , class OtherBodyNodeT >
 TemplateNodePtr (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_ptr)
 Constructor that takes in a strong NodePtr. More...
 
TemplateNodePtroperator= (NodeT *_ptr)
 Assignment operator. More...
 
template<class OtherNodeT , class OtherBodyNodeT >
TemplateNodePtroperator= (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_ptr)
 Assignment operator for NodePtrs. More...
 
 operator NodeT * () const
 Implicit conversion. More...
 
NodeT & operator* () const
 Dereferencing operator. More...
 
NodeT * operator-> () const
 Dereferencing operation. More...
 
NodeT * get () const
 Get the raw Node pointer. More...
 
void set (NodeT *_ptr)
 Set the Node for this NodePtr. More...
 

Protected Attributes

NodeT * mNode
 Node that this NodePtr refers to. More...
 
std::shared_ptr< NodeDestructormDestructor
 Hold onto a shared_ptr to the Node's Destructor to make sure the Node stays alive. More...
 
TemplateBodyNodePtr< BodyNodeT > mBodyNodePtr
 Hold onto a BodyNodePtr to the Node's associated BodyNode to make sure that the BodyNode stays alive. More...
 

Friends

template<class , class >
class TemplateNodePtr
 

Detailed Description

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

TemplateNodePtr is a templated class that enables users to create a strong reference-counting NodePtr.

Holding onto a NodePtr will ensure that the BodyNode associated with a Node does not get deleted, and it will also ensure that the Node itself does not get deleted. This templated class can be applied to any class that inherits from dart::dynamics::Node.

Member Typedef Documentation

◆ element_type

template<class NodeT , class BodyNodeT >
using dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::element_type = NodeT

Constructor & Destructor Documentation

◆ TemplateNodePtr() [1/3]

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

Default constructor.

◆ TemplateNodePtr() [2/3]

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

Typical constructor.

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

◆ TemplateNodePtr() [3/3]

template<class NodeT , class BodyNodeT >
template<class OtherNodeT , class OtherBodyNodeT >
dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::TemplateNodePtr ( const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &  _ptr)
inline

Constructor that takes in a strong NodePtr.

Member Function Documentation

◆ get()

template<class NodeT , class BodyNodeT >
NodeT* dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::get ( ) const
inline

Get the raw Node pointer.

◆ operator NodeT *()

template<class NodeT , class BodyNodeT >
dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::operator NodeT * ( ) const
inline

Implicit conversion.

◆ operator*()

template<class NodeT , class BodyNodeT >
NodeT& dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::operator* ( ) const
inline

Dereferencing operator.

◆ operator->()

template<class NodeT , class BodyNodeT >
NodeT* dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::operator-> ( ) const
inline

Dereferencing operation.

◆ operator=() [1/2]

template<class NodeT , class BodyNodeT >
template<class OtherNodeT , class OtherBodyNodeT >
TemplateNodePtr& dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::operator= ( const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &  _ptr)
inline

Assignment operator for NodePtrs.

◆ operator=() [2/2]

template<class NodeT , class BodyNodeT >
TemplateNodePtr& dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::operator= ( NodeT *  _ptr)
inline

Assignment operator.

◆ set()

template<class NodeT , class BodyNodeT >
void dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::set ( NodeT *  _ptr)
inline

Set the Node for this NodePtr.

Friends And Related Function Documentation

◆ TemplateNodePtr

template<class NodeT , class BodyNodeT >
template<class , class >
friend class TemplateNodePtr
friend

Member Data Documentation

◆ mBodyNodePtr

template<class NodeT , class BodyNodeT >
TemplateBodyNodePtr<BodyNodeT> dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::mBodyNodePtr
protected

Hold onto a BodyNodePtr to the Node's associated BodyNode to make sure that the BodyNode stays alive.

◆ mDestructor

template<class NodeT , class BodyNodeT >
std::shared_ptr<NodeDestructor> dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::mDestructor
protected

Hold onto a shared_ptr to the Node's Destructor to make sure the Node stays alive.

◆ mNode

template<class NodeT , class BodyNodeT >
NodeT* dart::dynamics::TemplateNodePtr< NodeT, BodyNodeT >::mNode
protected

Node that this NodePtr refers to.