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

TemplateDegreeOfFreedomPtr is a templated class that enables users to create a reference-counting DegreeOfFreedomPtr. More...

#include <DegreeOfFreedomPtr.hpp>

Public Member Functions

 TemplateDegreeOfFreedomPtr ()=default
 Default constructor. More...
 
 TemplateDegreeOfFreedomPtr (DegreeOfFreedomT *_ptr)
 Typical constructor. More...
 
template<class OtherDegreeOfFreedomT , class OtherBodyNodeT >
 TemplateDegreeOfFreedomPtr (const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &_dofp)
 Constructor that takes in a strong DegreeOfFreedomPtrs. More...
 
TemplateDegreeOfFreedomPtroperator= (DegreeOfFreedomT *_ptr)
 Assignment operator. More...
 
template<class OtherDegreeOfFreedomT , class OtherBodyNodeT >
TemplateDegreeOfFreedomPtroperator= (const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &_dofp)
 Assignment operator for DegreeOfFreedomPtrs. More...
 
 operator DegreeOfFreedomT * () const
 Implicit conversion. More...
 
DegreeOfFreedomT & operator* () const
 Dereferencing operator. More...
 
DegreeOfFreedomT * operator-> () const
 Dereferencing operation. More...
 
DegreeOfFreedomT * get () const
 Get the raw DegreeOfFreedom pointer. More...
 
TemplateBodyNodePtr< BodyNodeT > getBodyNodePtr () const
 Get the BodyNode that this DegreeOfFreedomPtr is tied to. More...
 
std::size_t getLocalIndex () const
 Get the local generalized coordinate index that this DegreeOfFreedomPtr is tied to. More...
 
void set (DegreeOfFreedomT *_ptr)
 Set the DegreeOfFreedom for this DegreeOfFreedomPtr. More...
 
Comparison operators
template<class OtherDofT , class OtherBodyNodeT >
bool operator== (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Equality. More...
 
template<class OtherDofT , class OtherBodyNodeT >
bool operator!= (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Inequality. More...
 
template<class OtherDofT , class OtherBodyNodeT >
bool operator< (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Less than. More...
 
template<class OtherDofT , class OtherBodyNodeT >
bool operator> (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Greater than. More...
 
template<class OtherDofT , class OtherBodyNodeT >
bool operator<= (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Less than or equal to. More...
 
template<class OtherDofT , class OtherBodyNodeT >
bool operator>= (const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
 Greater than or equal to. More...
 

Private Attributes

TemplateBodyNodePtr< BodyNodeT > mBodyNodePtr
 Reference-holding 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 TemplateDegreeOfFreedomPtr
 

Detailed Description

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

TemplateDegreeOfFreedomPtr is a templated class that enables users to create a reference-counting DegreeOfFreedomPtr.

Holding onto a DegreeOfFreedomPtr will ensure that the BodyNode (and by extension, Skeleton) corresponding to a DegreeOfFreedom does not get deleted. However, the DegreeOfFreedom itself will be deleted if the parent Joint of the BodyNode is changed to a Joint type that has a small number of DegreesOfFreedom than the local of the DegreeOfFreedom that this DegreeOfFreedomPtr referred to. In such a case, this will trigger and assertion in debug mode, or have a nullptr value if not in debug mode.

Constructor & Destructor Documentation

◆ TemplateDegreeOfFreedomPtr() [1/3]

template<class DegreeOfFreedomT , class BodyNodeT >
dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateDegreeOfFreedomPtr ( )
default

Default constructor.

◆ TemplateDegreeOfFreedomPtr() [2/3]

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

Typical constructor.

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

◆ TemplateDegreeOfFreedomPtr() [3/3]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDegreeOfFreedomT , class OtherBodyNodeT >
dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::TemplateDegreeOfFreedomPtr ( const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &  _dofp)
inline

Constructor that takes in a strong DegreeOfFreedomPtrs.

Member Function Documentation

◆ get()

template<class DegreeOfFreedomT , class BodyNodeT >
DegreeOfFreedomT* dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::get ( ) const
inline

Get the raw DegreeOfFreedom pointer.

◆ getBodyNodePtr()

template<class DegreeOfFreedomT , class BodyNodeT >
TemplateBodyNodePtr<BodyNodeT> dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::getBodyNodePtr ( ) const
inline

Get the BodyNode that this DegreeOfFreedomPtr is tied to.

◆ getLocalIndex()

template<class DegreeOfFreedomT , class BodyNodeT >
std::size_t dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::getLocalIndex ( ) const
inline

Get the local generalized coordinate index that this DegreeOfFreedomPtr is tied to.

◆ operator DegreeOfFreedomT *()

template<class DegreeOfFreedomT , class BodyNodeT >
dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator DegreeOfFreedomT * ( ) const
inline

Implicit conversion.

◆ operator!=()

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

Inequality.

◆ operator*()

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

Dereferencing operator.

◆ operator->()

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

Dereferencing operation.

◆ operator<()

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
bool dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator< ( const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _rhs) const
inline

Less than.

◆ operator<=()

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

Less than or equal to.

◆ operator=() [1/2]

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDegreeOfFreedomT , class OtherBodyNodeT >
TemplateDegreeOfFreedomPtr& dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator= ( const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &  _dofp)
inline

Assignment operator for DegreeOfFreedomPtrs.

◆ operator=() [2/2]

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

Assignment operator.

◆ operator==()

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

Equality.

◆ operator>()

template<class DegreeOfFreedomT , class BodyNodeT >
template<class OtherDofT , class OtherBodyNodeT >
bool dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::operator> ( const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &  _rhs) const
inline

Greater than.

◆ operator>=()

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

Greater than or equal to.

◆ set()

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

Set the DegreeOfFreedom for this DegreeOfFreedomPtr.

Friends And Related Function Documentation

◆ TemplateDegreeOfFreedomPtr

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

Member Data Documentation

◆ mBodyNodePtr

template<class DegreeOfFreedomT , class BodyNodeT >
TemplateBodyNodePtr<BodyNodeT> dart::dynamics::TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT >::mBodyNodePtr
private

Reference-holding pointer to the child BodyNode of this DegreeOfFreedom.

◆ mIndex

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

Local index of this DegreeOfFreedom within its Joint.