dart
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
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.
 
 TemplateNodePtr (NodeT *_ptr)
 Typical constructor. More...
 
template<class OtherNodeT , class OtherBodyNodeT >
 TemplateNodePtr (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_ptr)
 Constructor that takes in a strong NodePtr.
 
TemplateNodePtroperator= (NodeT *_ptr)
 Assignment operator.
 
template<class OtherNodeT , class OtherBodyNodeT >
TemplateNodePtroperator= (const TemplateNodePtr< OtherNodeT, OtherBodyNodeT > &_ptr)
 Assignment operator for NodePtrs.
 
 operator NodeT * () const
 Implicit conversion.
 
NodeT & operator* () const
 Dereferencing operator.
 
NodeT * operator-> () const
 Dereferencing operation.
 
NodeT * get () const
 Get the raw Node pointer.
 
void set (NodeT *_ptr)
 Set the Node for this NodePtr.
 

Protected Attributes

NodeT * mNode
 Node that this NodePtr refers to.
 
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.

Constructor & Destructor Documentation

◆ TemplateNodePtr()

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

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.


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