attribute_map_collection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef MESH3D__ATTRIBUTE_MAP_COLLECTION__H
00028 #define MESH3D__ATTRIBUTE_MAP_COLLECTION__H
00029
00030 #include "mesh3d/attribute_map.h"
00031 #include "mesh3d/exception.h"
00032 #include <memory>
00033 #include <map>
00034
00035 namespace mesh3d {
00036
00038 template<typename Key>
00039 class attribute_map_collection
00040 {
00041 private:
00042 typedef std::map<std::string, std::tr1::shared_ptr<attribute_map_base<Key> > > map_map;
00043
00044 public:
00045 typedef typename map_map::const_iterator const_iterator;
00046
00047 attribute_map_collection();
00048
00049 void clear();
00050
00051 size_t size() const;
00052
00053 template<typename Value>
00054 std::tr1::shared_ptr<attribute_map<Key, Value> > create(std::string const &name);
00055
00056 void insert(std::string const &name, std::tr1::shared_ptr<attribute_map_base<Key> > const &map);
00057 void remove(std::string const &name);
00058 bool has (std::string const &name) const;
00059
00060 std::tr1::shared_ptr<attribute_map_base<Key> > find_any(std::string const &name) const;
00061
00062 template<typename Value> std::tr1::shared_ptr<attribute_map<Key, Value> > find(std::string const &name) const;
00063 template<typename Value> std::tr1::shared_ptr<attribute_map<Key, Value> > find_or_create(std::string const &name);
00064
00065 const_iterator begin() const;
00066 const_iterator end () const;
00067
00068 private:
00069 map_map m_maps;
00070 };
00071
00072 }
00073
00074 #include "attribute_map_collection.inl"
00075
00076 #endif
00077