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

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

#include <SpecializedNodeManager.hpp>

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

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

 SkeletonSpecializedFor ()
 
template<class NodeType >
std::size_t getNumNodes (std::size_t treeIndex) const
 Get the number of Nodes of the specified type that are in the treeIndexth tree of this Skeleton. More...
 
template<class NodeType >
NodeType * getNode (std::size_t treeIndex, std::size_t nodeIndex)
 Get the nodeIndexth Node of the specified type within the tree of treeIndex. More...
 
template<class NodeType >
const NodeType * getNode (std::size_t treeIndex, std::size_t nodeIndex) const
 Get the nodeIndexth Node of the specified type within the tree of treeIndex. More...
 
template<class NodeType >
NodeType * getNode (const std::string &name)
 Get the Node of the specified type with the given name. More...
 
template<class NodeType >
const NodeType * getNode (const std::string &name) const
 Get the Node of the specified type with the given name. More...
 
template<class NodeType >
constexpr bool _isSpecializedForNode (type< NodeType >)
 
template<class NodeType >
std::size_t getNumNodes () const
 Get the number of Nodes corresponding to the specified type. 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 >
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...
 
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 T >
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 >, std::size_t treeIndex) const
 Redirect to BasicNodeManagerForSkeleton::getNumNodes(std::size_t) More...
 
std::size_t _getNumNodes (type< SpecNode >, std::size_t treeIndex) const
 Specialized implementation of getNumNodes(std::size_t) More...
 
template<class NodeType >
NodeType * _getNode (type< NodeType >, std::size_t treeIndex, std::size_t nodeIndex)
 Redirect to BasicNodeManagerForSkeleton::getNode(std::size_t, std::size_t) More...
 
SpecNode * _getNode (type< SpecNode >, std::size_t treeIndex, std::size_t nodeIndex)
 Specialized implementation of getNode(std::size_t, std::size_t) More...
 
template<class NodeType >
NodeType * _getNode (type< NodeType >, const std::string &name)
 Redirect to BasicNodeManagerForSkeleton::getNode(const std::string&) More...
 
SpecNode * _getNode (type< SpecNode >, const std::string &name)
 Specialized implementation of getNode(const std::string&) More...
 
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 T >
static constexpr bool _isSpecializedForNode (type< T >)
 Return false. More...
 
static constexpr bool _isSpecializedForNode (type< SpecNode >)
 Return true. More...
 

Protected Attributes

std::vector< BasicNodeManagerForBodyNode::NodeMap::iterator > mTreeSpecNodeIterators
 std::vector of iterators that allow direct access to the specialized Nodes of each tree More...
 
NodeNameMgrMap::iterator mSpecNodeNameMgrIterator
 Iterator that gives direct access to the name manager of the specialized Nodes. More...
 
NodeNameMgrMap mNodeNameMgrMap
 NameManager for tracking Nodes. More...
 
std::vector< NodeMapmTreeNodeMaps
 A NodeMap for each tree to allow tree Nodes to be accessed independently. More...
 
SpecializedTreeNodes mSpecializedTreeNodes
 A map that allows SpecializedNodeManagers to have a direct iterator to the tree-wise storage of its specialized Node. More...
 
NodeMap mNodeMap
 Map that retrieves the Nodes of a specified type. More...
 
NodeDestructorSet mNodeDestructors
 A set for storing the Node destructors. More...
 
BasicNodeManagerForBodyNode::NodeMap::iterator mSpecNodeIterator
 Iterator that allows direct access to the specialized Nodes. More...
 

Detailed Description

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

SkeletonSpecializedForNode allows classes that inherit Skeleton 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

◆ SkeletonSpecializedFor()

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

Member Function Documentation

◆ _getNode() [1/6]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::_getNode ( type< NodeType >  ,
const std::string &  name 
)
protected

Redirect to BasicNodeManagerForSkeleton::getNode(const std::string&)

◆ _getNode() [2/6]

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

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

◆ _getNode() [3/6]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::_getNode ( type< NodeType >  ,
std::size_t  treeIndex,
std::size_t  nodeIndex 
)
protected

Redirect to BasicNodeManagerForSkeleton::getNode(std::size_t, std::size_t)

◆ _getNode() [4/6]

template<class SpecNode >
SpecNode * dart::dynamics::SkeletonSpecializedFor< SpecNode >::_getNode ( type< SpecNode >  ,
const std::string &  name 
)
protected

Specialized implementation of getNode(const std::string&)

◆ _getNode() [5/6]

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

Specialized implementation of getNode(std::size_t)

◆ _getNode() [6/6]

template<class SpecNode >
SpecNode * dart::dynamics::SkeletonSpecializedFor< SpecNode >::_getNode ( type< SpecNode >  ,
std::size_t  treeIndex,
std::size_t  nodeIndex 
)
protected

Specialized implementation of getNode(std::size_t, std::size_t)

◆ _getNumNodes() [1/4]

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

Redirect to BasicNodeManagerForBodyNode::getNumNodes()

◆ _getNumNodes() [2/4]

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

Redirect to BasicNodeManagerForSkeleton::getNumNodes(std::size_t)

◆ _getNumNodes() [3/4]

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

Specialized implementation of getNumNodes()

◆ _getNumNodes() [4/4]

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

Specialized implementation of getNumNodes(std::size_t)

◆ _isSpecializedForNode() [1/3]

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

◆ _isSpecializedForNode() [2/3]

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

Return true.

◆ _isSpecializedForNode() [3/3]

template<class SpecNode >
template<class T >
static constexpr bool dart::dynamics::SkeletonSpecializedFor< SpecNode >::_isSpecializedForNode ( type< T >  )
staticconstexprprotected

Return false.

◆ getNode() [1/9]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::getNode ( const std::string &  name)

Get the Node of the specified type with the given name.

◆ getNode() [2/9]

template<class SpecNode >
template<class NodeType >
const NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::getNode ( const std::string &  name) const

Get the Node of the specified type with the given name.

◆ getNode() [3/9]

template<class NodeType >
NodeType * dart::dynamics::detail::BasicNodeManagerForBodyNode::getNode ( std::size_t  index)
inherited

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

◆ getNode() [4/9]

template<class NodeType >
NodeType * dart::dynamics::detail::BasicNodeManagerForBodyNode::getNode ( class NodeType  )
inherited

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

◆ getNode() [5/9]

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

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

◆ getNode() [6/9]

template<class NodeType >
const NodeType * dart::dynamics::detail::BasicNodeManagerForBodyNode::getNode ( std::size_t  index) const
inherited

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

◆ getNode() [7/9]

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

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

◆ getNode() [8/9]

template<class SpecNode >
template<class NodeType >
NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::getNode ( std::size_t  treeIndex,
std::size_t  nodeIndex 
)

Get the nodeIndexth Node of the specified type within the tree of treeIndex.

◆ getNode() [9/9]

template<class SpecNode >
template<class NodeType >
const NodeType * dart::dynamics::SkeletonSpecializedFor< SpecNode >::getNode ( std::size_t  treeIndex,
std::size_t  nodeIndex 
) const

Get the nodeIndexth Node of the specified type within the tree of treeIndex.

◆ getNumNodes() [1/4]

template<class NodeType >
std::size_t dart::dynamics::detail::BasicNodeManagerForBodyNode::getNumNodes
inherited

Get the number of Nodes corresponding to the specified type.

◆ getNumNodes() [2/4]

template<class NodeType >
std::size_t dart::dynamics::detail::BasicNodeManagerForBodyNode::getNumNodes ( class NodeType  )
inherited

Get the number of Nodes corresponding to the specified type.

◆ getNumNodes() [3/4]

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

Get the number of Nodes corresponding to the specified type.

◆ getNumNodes() [4/4]

template<class SpecNode >
template<class NodeType >
std::size_t dart::dynamics::SkeletonSpecializedFor< SpecNode >::getNumNodes ( std::size_t  treeIndex) const

Get the number of Nodes of the specified type that are in the treeIndexth tree of this Skeleton.

◆ isSpecializedForNode()

template<class SpecNode >
template<class NodeType >
constexpr bool dart::dynamics::SkeletonSpecializedFor< 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.

◆ mNodeNameMgrMap

NodeNameMgrMap dart::dynamics::detail::BasicNodeManagerForSkeleton::mNodeNameMgrMap
protectedinherited

NameManager for tracking Nodes.

◆ mSpecializedTreeNodes

SpecializedTreeNodes dart::dynamics::detail::BasicNodeManagerForSkeleton::mSpecializedTreeNodes
protectedinherited

A map that allows SpecializedNodeManagers to have a direct iterator to the tree-wise storage of its specialized Node.

Each entry in this map contains a pointer to a vector of iterators. Each vector of iterators is stored in its corresponding SpecializedNodeManager. This system allows Node specialization to be extensible, enabling custom derived Skeleton types that are specialized for more than the default specialized Nodes.

◆ mSpecNodeIterator

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

Iterator that allows direct access to the specialized Nodes.

◆ mSpecNodeNameMgrIterator

template<class SpecNode >
NodeNameMgrMap::iterator dart::dynamics::SkeletonSpecializedFor< SpecNode >::mSpecNodeNameMgrIterator
protected

Iterator that gives direct access to the name manager of the specialized Nodes.

◆ mTreeNodeMaps

std::vector<NodeMap> dart::dynamics::detail::BasicNodeManagerForSkeleton::mTreeNodeMaps
protectedinherited

A NodeMap for each tree to allow tree Nodes to be accessed independently.

◆ mTreeSpecNodeIterators

template<class SpecNode >
std::vector<BasicNodeManagerForBodyNode::NodeMap::iterator> dart::dynamics::SkeletonSpecializedFor< SpecNode >::mTreeSpecNodeIterators
protected

std::vector of iterators that allow direct access to the specialized Nodes of each tree