hpp::manipulation::Container< Element, Key > Class Template Reference

#include <hpp/manipulation/container.hh>

Public Types

typedef std::map< Key, Element > ElementMap_t
 

Public Member Functions

void add (const Key &name, const Element &element)
 Add an element. More...
 
const Element & get (const Key &name) const
 Return the element named name. More...
 
template<typename ReturnType >
ReturnType getAllAs () const
 Return a list of all elements. More...
 
const ElementMap_tgetAll () const
 Return the underlying map. More...
 
std::ostream & print (std::ostream &os) const
 Print object in a stream. More...
 

Protected Member Functions

 Container ()
 Constructor. More...
 

Member Typedef Documentation

◆ ElementMap_t

template<typename Element, typename Key = std::string>
typedef std::map<Key, Element> hpp::manipulation::Container< Element, Key >::ElementMap_t

Constructor & Destructor Documentation

◆ Container()

template<typename Element, typename Key = std::string>
hpp::manipulation::Container< Element, Key >::Container ( )
inlineprotected

Constructor.

Member Function Documentation

◆ add()

template<typename Element, typename Key = std::string>
void hpp::manipulation::Container< Element, Key >::add ( const Key &  name,
const Element &  element 
)
inline

Add an element.

◆ get()

template<typename Element, typename Key = std::string>
const Element& hpp::manipulation::Container< Element, Key >::get ( const Key &  name) const
inline

Return the element named name.

◆ getAll()

template<typename Element, typename Key = std::string>
const ElementMap_t& hpp::manipulation::Container< Element, Key >::getAll ( ) const
inline

Return the underlying map.

◆ getAllAs()

template<typename Element, typename Key = std::string>
template<typename ReturnType >
ReturnType hpp::manipulation::Container< Element, Key >::getAllAs ( ) const
inline

Return a list of all elements.

Template Parameters
ReturnTypemust have a push_back method.

◆ print()

template<typename Element, typename Key = std::string>
std::ostream& hpp::manipulation::Container< Element, Key >::print ( std::ostream &  os) const
inline

Print object in a stream.