DART  6.7.3
dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT > Class Template Reference

TemplateWeakDegreeOfFreedomPtr is a templated class that enables users to create a non-reference-holding WeakDegreeOfFreedomPtr. More...

#include <DegreeOfFreedomPtr.hpp>

Public Member Functions

 TemplateWeakDegreeOfFreedomPtr ()
 Default constructor. More...
 
 TemplateWeakDegreeOfFreedomPtr (DegreeOfFreedomT *_ptr)
 Typical constructor. More...
 
template<class OtherDofT , class OtherBodyNodeT >
 TemplateWeakDegreeOfFreedomPtr (const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
 Constructor that takes in a WeakDegreeOfFreedomPtr. More...
 
template<class OtherDofT , class OtherBodyNodeT >
 TemplateWeakDegreeOfFreedomPtr (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_strongPtr)
 Constructor that takes in a strong DegreeOfFreedomPtr. More...
 
TemplateWeakDegreeOfFreedomPtroperator= (DegreeOfFreedomT *_ptr)
 Assignment operator for raw DegreeOfFreedom pointers. More...
 
template<class OtherDofT , class OtherBodyNodeT >
TemplateWeakDegreeOfFreedomPtroperator= (const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
 Assignemnt operator for WeakDegreeOfFreedomPtrs. More...
 
template<class OtherDofT , class OtherBodyNodeT >
TemplateWeakDegreeOfFreedomPtroperator= (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_strongPtr)
 Assignment operator for strong DegreeOfFreedomPtrs. More...
 
TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT > lock () const
 Locks the DegreeOfFreedom reference to ensure that the referenced DegreeOfFreedom is currently still available. More...
 
void set (DegreeOfFreedomT *_ptr)
 Set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr. More...
 
template<class OtherDofT , class OtherBodyNodeT >
void set (const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
 Attempt to set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr based on another WeakDegreeOfFreedomPtr. More...
 

Private Attributes

TemplateWeakBodyNodePtr< BodyNodeT > mWeakBodyNode
 Weak pointer to the child BodyNode of this DegreeOfFreedom. More...
 
std::size_t mIndex
 Local index of this DegreeOfFreedom within its Joint. More...
 

Friends

template<class , class >
class TemplateWeakDegreeOfFreedomPtr
 

Detailed Description

template<class DegreeOfFreedomT, class BodyNodeT>
class dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >

TemplateWeakDegreeOfFreedomPtr is a templated class that enables users to create a non-reference-holding WeakDegreeOfFreedomPtr.

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

Constructor & Destructor Documentation

◆ TemplateWeakDegreeOfFreedomPtr() [1/4]

template<class DegreeOfFreedomT , class BodyNodeT >
dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateWeakDegreeOfFreedomPtr ( )
inline

Default constructor.

◆ TemplateWeakDegreeOfFreedomPtr() [2/4]

template<class DegreeOfFreedomT , class BodyNodeT >
dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateWeakDegreeOfFreedomPtr ( DegreeOfFreedomT *  _ptr)
inline

Typical constructor.

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

◆ TemplateWeakDegreeOfFreedomPtr() [3/4]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateWeakDegreeOfFreedomPtr ( const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _weakPtr)
inline

Constructor that takes in a WeakDegreeOfFreedomPtr.

◆ TemplateWeakDegreeOfFreedomPtr() [4/4]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateWeakDegreeOfFreedomPtr ( const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _strongPtr)
inline

Constructor that takes in a strong DegreeOfFreedomPtr.

Member Function Documentation

◆ lock()

template<class DegreeOfFreedomT , class BodyNodeT >
TemplateDegreeOfFreedomPtr<DegreeOfFreedomT, BodyNodeT> dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::lock ( ) const
inline

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

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

◆ operator=() [1/3]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
TemplateWeakDegreeOfFreedomPtr& dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator= ( const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _strongPtr)
inline

Assignment operator for strong DegreeOfFreedomPtrs.

◆ operator=() [2/3]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
TemplateWeakDegreeOfFreedomPtr& dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator= ( const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _weakPtr)
inline

Assignemnt operator for WeakDegreeOfFreedomPtrs.

◆ operator=() [3/3]

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

Assignment operator for raw DegreeOfFreedom pointers.

◆ set() [1/2]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
void dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::set ( const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _weakPtr)
inline

Attempt to set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr based on another WeakDegreeOfFreedomPtr.

◆ set() [2/2]

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

Set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr.

Friends And Related Function Documentation

◆ TemplateWeakDegreeOfFreedomPtr

template<class DegreeOfFreedomT , class BodyNodeT >
template<class , class >
friend class TemplateWeakDegreeOfFreedomPtr
friend

Member Data Documentation

◆ mIndex

template<class DegreeOfFreedomT , class BodyNodeT >
std::size_t dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::mIndex
private

Local index of this DegreeOfFreedom within its Joint.

◆ mWeakBodyNode

template<class DegreeOfFreedomT , class BodyNodeT >
TemplateWeakBodyNodePtr<BodyNodeT> dart::dynamics::TemplateWeakDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::mWeakBodyNode
private

Weak pointer to the child BodyNode of this DegreeOfFreedom.