DART  6.10.1
dart::dynamics::BodyNodeSpecializedFor< SpecNode > Class Template Reference

BodyNodeSpecializedFor allows classes that inherit BodyNode to have constant-time access to a specific type of Node. More...

#include <SpecializedNodeManager.hpp>

Inheritance diagram for dart::dynamics::BodyNodeSpecializedFor< SpecNode >:
dart::dynamics::detail::BasicNodeManagerForBodyNode dart::dynamics::SkeletonSpecializedFor< SpecNode >

Public Types

using NodeMap = std::map< std::type_index, std::vector< Node * > >
 
using NodeDestructorSet = std::unordered_set< NodeDestructorPtr >
 
using NodeNameMgrMap = std::map< std::type_index, common::NameManager< Node * > >
 
using SpecializedTreeNodes = std::map< std::type_index, std::vector< NodeMap::iterator > * >
 

Public Member Functions

 BodyNodeSpecializedFor ()
 Default constructor. More...
 
template<class NodeType >
std::size_t getNumNodes () const
 Get the number of Nodes corresponding to the specified type. More...
 
template<class NodeType >
NodeType * getNode (std::size_t index)
 Get the Node of the specified type and the specified index. More...
 
template<class NodeType >
const NodeType * getNode (std::size_t index) const
 Get the Node of the specified type and the specified index. More...
 

Static Public Member Functions

template<class NodeType >
static constexpr bool isSpecializedForNode ()
 Check if this Manager is specialized for a specific type of Node. More...
 

Protected Member Functions

template<class NodeType >
std::size_t _getNumNodes (type< NodeType >) const
 Redirect to BasicNodeManagerForBodyNode::getNumNodes() More...
 
std::size_t _getNumNodes (type< SpecNode >) const
 Specialized implementation of getNumNodes() More...
 
template<class NodeType >
NodeType * _getNode (type< NodeType >, std::size_t index)
 Redirect to BasicNodeManagerForBodyNode::getNode(std::size_t) More...
 
SpecNode * _getNode (type< SpecNode >, std::size_t index)
 Specialized implementation of getNode(std::size_t) More...
 

Static Protected Member Functions

template<class NodeType >
static constexpr bool _isSpecializedForNode (type< NodeType >)
 Return false. More...
 
static constexpr bool _isSpecializedForNode (type< SpecNode >)
 Return true. More...
 

Protected Attributes

BasicNodeManagerForBodyNode::NodeMap::iterator mSpecNodeIterator
 Iterator that allows direct access to the specialized Nodes. More...
 
NodeMap mNodeMap
 Map that retrieves the Nodes of a specified type. More...
 
NodeDestructorSet mNodeDestructors
 A set for storing the Node destructors. More...
 

Detailed Description

template<class SpecNode>
class dart::dynamics::BodyNodeSpecializedFor< SpecNode >

BodyNodeSpecializedFor allows classes that inherit BodyNode to have constant-time access to a specific type of Node.

Member Typedef Documentation

◆ NodeDestructorSet

◆ NodeMap

using dart::dynamics::detail::BasicNodeManagerForBodyNode::NodeMap = std::map<std::type_index, std::vector<Node*> >
inherited

◆ NodeNameMgrMap

◆ SpecializedTreeNodes

using dart::dynamics::detail::BasicNodeManagerForBodyNode::SpecializedTreeNodes = std::map<std::type_index, std::vector<NodeMap::iterator>*>
inherited

Constructor & Destructor Documentation

◆ BodyNodeSpecializedFor()

template<class SpecNode >
dart::dynamics::BodyNodeSpecializedFor< SpecNode >::BodyNodeSpecializedFor

Default constructor.

Member Function Documentation

◆ _getNode() [1/2]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_getNode ( type< NodeType >  ,
std::size_t  index 
)
protected

Redirect to BasicNodeManagerForBodyNode::getNode(std::size_t)

◆ _getNode() [2/2]

template<class SpecNode >
SpecNode * dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_getNode ( type< SpecNode >  ,
std::size_t  index 
)
protected

Specialized implementation of getNode(std::size_t)

◆ _getNumNodes() [1/2]

template<class SpecNode >
template<class NodeType >
std::size_t dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_getNumNodes ( type< NodeType >  ) const
protected

Redirect to BasicNodeManagerForBodyNode::getNumNodes()

◆ _getNumNodes() [2/2]

template<class SpecNode >
std::size_t dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_getNumNodes ( type< SpecNode >  ) const
protected

Specialized implementation of getNumNodes()

◆ _isSpecializedForNode() [1/2]

template<class SpecNode >
template<class NodeType >
constexpr bool dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_isSpecializedForNode ( type< NodeType >  )
staticconstexprprotected

Return false.

◆ _isSpecializedForNode() [2/2]

template<class SpecNode >
constexpr bool dart::dynamics::BodyNodeSpecializedFor< SpecNode >::_isSpecializedForNode ( type< SpecNode >  )
staticconstexprprotected

Return true.

◆ getNode() [1/2]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::BodyNodeSpecializedFor< SpecNode >::getNode ( std::size_t  index)

Get the Node of the specified type and the specified index.

◆ getNode() [2/2]

template<class SpecNode >
template<class NodeType >
const NodeType * dart::dynamics::BodyNodeSpecializedFor< SpecNode >::getNode ( std::size_t  index) const

Get the Node of the specified type and the specified index.

◆ getNumNodes()

template<class SpecNode >
template<class NodeType >
std::size_t dart::dynamics::BodyNodeSpecializedFor< SpecNode >::getNumNodes

Get the number of Nodes corresponding to the specified type.

◆ isSpecializedForNode()

template<class SpecNode >
template<class NodeType >
constexpr bool dart::dynamics::BodyNodeSpecializedFor< SpecNode >::isSpecializedForNode
staticconstexpr

Check if this Manager is specialized for a specific type of Node.

Member Data Documentation

◆ mNodeDestructors

NodeDestructorSet dart::dynamics::detail::BasicNodeManagerForBodyNode::mNodeDestructors
protectedinherited

A set for storing the Node destructors.

◆ mNodeMap

NodeMap dart::dynamics::detail::BasicNodeManagerForBodyNode::mNodeMap
protectedinherited

Map that retrieves the Nodes of a specified type.

◆ mSpecNodeIterator

template<class SpecNode >
BasicNodeManagerForBodyNode::NodeMap::iterator dart::dynamics::BodyNodeSpecializedFor< SpecNode >::mSpecNodeIterator
protected

Iterator that allows direct access to the specialized Nodes.