Go to the documentation of this file.
29 #ifndef HECTOR_POSE_ESTIMATION_COLLECTION_H
30 #define HECTOR_POSE_ESTIMATION_COLLECTION_H
35 #include <boost/shared_ptr.hpp>
36 #include <boost/weak_ptr.hpp>
37 #include <boost/make_shared.hpp>
41 template <
typename T,
typename key_type = std::
string>
45 typedef boost::weak_ptr<T>
WPtr;
48 typedef typename ListType::const_iterator
iterator;
61 Derived *p =
new Derived();
65 template <
typename Derived>
const Ptr&
create(
const key_type& key) {
66 Derived *p =
new Derived();
76 if (!
map_.count(key))
return Ptr();
77 return map_.at(key).lock();
85 template <
typename Derived>
87 return boost::dynamic_pointer_cast<Derived>(
get(key));
107 #endif // HECTOR_POSE_ESTIMATION_COLLECTION_H
ListType::const_iterator const_iterator
boost::weak_ptr< T > WPtr
const Ptr & create(const key_type &key)
ListType::const_iterator iterator
boost::shared_ptr< Derived > add(Derived *p, const key_type &key)
boost::shared_ptr< Derived > add(Derived *p)
boost::shared_ptr< Derived > getType(const key_type &key) const
boost::shared_ptr< T > Ptr
Ptr get(const key_type &key) const
const_iterator end() const
std::list< Ptr > ListType
const_iterator begin() const
const Ptr & add(const Ptr &p, const key_type &key)
std::map< key_type, WPtr > MapType