DART  6.10.1
dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT > Class Template Reference

TemplateWeakJointPtr is a templated class that enables users to create a non-reference-holding WeakJointPtr. More...

#include <JointPtr.hpp>

Public Member Functions

 TemplateWeakJointPtr ()=default
 Default constructor. More...
 
 TemplateWeakJointPtr (JointT *_ptr)
 Typical constructor. More...
 
template<class OtherJointT , class OtherBodyNodeT >
 TemplateWeakJointPtr (const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &_weakPtr)
 Constructor that takes in a WeakJointPtr. More...
 
template<class OtherJointT , class OtherBodyNodeT >
 TemplateWeakJointPtr (const TemplateJointPtr< OtherJointT, OtherBodyNodeT > &_strongPtr)
 Constructor that takes in a strong JointPtr. More...
 
TemplateWeakJointPtroperator= (JointT *_ptr)
 Assignment operator for raw Joint pointers. More...
 
template<class OtherJointT , class OtherBodyNodeT >
TemplateWeakJointPtroperator= (const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &_weakPtr)
 Assignment operator for WeakJointPtrs. More...
 
template<class OtherJointT , class OtherBodyNodeT >
TemplateWeakJointPtroperator= (const TemplateJointPtr< OtherJointT, OtherBodyNodeT > &_strongPtr)
 Assignment operator for strong JointPtrs. More...
 
TemplateJointPtr< JointT, BodyNodeT > lock () const
 Locks the Joint reference to ensure that the referenced Joint is currently still available. More...
 
void set (JointT *_ptr)
 Set the Joint for this WeakJointPtr. More...
 
template<class OtherJointT , class OtherBodyNodeT >
void set (const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &_weakPtr)
 Set the Joint for this WeakJointPtr based on another WeakJointPtr. More...
 

Private Attributes

TemplateWeakBodyNodePtr< BodyNodeT > mWeakBodyNode
 Weak poiner to the child BodyNode of this Joint. More...
 

Friends

template<class , class >
class TemplateWeakJointPtr
 

Detailed Description

template<class JointT, class BodyNodeT>
class dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >

TemplateWeakJointPtr is a templated class that enables users to create a non-reference-holding WeakJointPtr.

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

Constructor & Destructor Documentation

◆ TemplateWeakJointPtr() [1/4]

template<class JointT , class BodyNodeT >
dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::TemplateWeakJointPtr ( )
default

Default constructor.

◆ TemplateWeakJointPtr() [2/4]

template<class JointT , class BodyNodeT >
dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::TemplateWeakJointPtr ( JointT *  _ptr)
inline

Typical constructor.

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

◆ TemplateWeakJointPtr() [3/4]

template<class JointT , class BodyNodeT >
template<class OtherJointT , class OtherBodyNodeT >
dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::TemplateWeakJointPtr ( const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &  _weakPtr)
inline

Constructor that takes in a WeakJointPtr.

◆ TemplateWeakJointPtr() [4/4]

template<class JointT , class BodyNodeT >
template<class OtherJointT , class OtherBodyNodeT >
dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::TemplateWeakJointPtr ( const TemplateJointPtr< OtherJointT, OtherBodyNodeT > &  _strongPtr)
inline

Constructor that takes in a strong JointPtr.

Member Function Documentation

◆ lock()

template<class JointT , class BodyNodeT >
TemplateJointPtr<JointT, BodyNodeT> dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::lock ( ) const
inline

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

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

◆ operator=() [1/3]

template<class JointT , class BodyNodeT >
template<class OtherJointT , class OtherBodyNodeT >
TemplateWeakJointPtr& dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::operator= ( const TemplateJointPtr< OtherJointT, OtherBodyNodeT > &  _strongPtr)
inline

Assignment operator for strong JointPtrs.

◆ operator=() [2/3]

template<class JointT , class BodyNodeT >
template<class OtherJointT , class OtherBodyNodeT >
TemplateWeakJointPtr& dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::operator= ( const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &  _weakPtr)
inline

Assignment operator for WeakJointPtrs.

◆ operator=() [3/3]

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

Assignment operator for raw Joint pointers.

◆ set() [1/2]

template<class JointT , class BodyNodeT >
template<class OtherJointT , class OtherBodyNodeT >
void dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::set ( const TemplateWeakJointPtr< OtherJointT, OtherBodyNodeT > &  _weakPtr)
inline

Set the Joint for this WeakJointPtr based on another WeakJointPtr.

◆ set() [2/2]

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

Set the Joint for this WeakJointPtr.

Friends And Related Function Documentation

◆ TemplateWeakJointPtr

template<class JointT , class BodyNodeT >
template<class , class >
friend class TemplateWeakJointPtr
friend

Member Data Documentation

◆ mWeakBodyNode

template<class JointT , class BodyNodeT >
TemplateWeakBodyNodePtr<BodyNodeT> dart::dynamics::TemplateWeakJointPtr< JointT, BodyNodeT >::mWeakBodyNode
private

Weak poiner to the child BodyNode of this Joint.