collection of attribute maps for specific key type
#include <attribute_map_collection.h>
Public Types | |
typedef map_map::const_iterator | const_iterator |
Public Member Functions | |
attribute_map_collection () | |
void | clear () |
size_t | size () const |
template<typename Value > | |
std::tr1::shared_ptr < attribute_map< Key, Value > > | create (std::string const &name) |
void | insert (std::string const &name, std::tr1::shared_ptr< attribute_map_base< Key > > const &map) |
void | remove (std::string const &name) |
bool | has (std::string const &name) const |
std::tr1::shared_ptr < attribute_map_base< Key > > | find_any (std::string const &name) const |
template<typename Value > | |
std::tr1::shared_ptr < attribute_map< Key, Value > > | find (std::string const &name) const |
template<typename Value > | |
std::tr1::shared_ptr < attribute_map< Key, Value > > | find_or_create (std::string const &name) |
const_iterator | begin () const |
const_iterator | end () const |
Definition at line 39 of file attribute_map_collection.h.
typedef map_map::const_iterator mesh3d::attribute_map_collection< Key >::const_iterator |
Definition at line 45 of file attribute_map_collection.h.
mesh3d::attribute_map_collection< Key >::attribute_map_collection | ( | ) | [inline] |
Definition at line 43 of file attribute_map_collection.inl.
void mesh3d::attribute_map_collection< Key >::clear | ( | ) | [inline] |
Definition at line 48 of file attribute_map_collection.inl.
size_t mesh3d::attribute_map_collection< Key >::size | ( | ) | const [inline] |
Definition at line 55 of file attribute_map_collection.inl.
std::tr1::shared_ptr< attribute_map< Key, Value > > mesh3d::attribute_map_collection< Key >::create | ( | std::string const & | name | ) | [inline] |
Definition at line 113 of file attribute_map_collection.inl.
00114 { 00115 std::tr1::shared_ptr<attribute_map<Key, Value> > p(new attribute_map<Key, Value>); 00116 insert(name, p); 00117 return p; 00118 }
void mesh3d::attribute_map_collection< Key >::insert | ( | std::string const & | name, | |
std::tr1::shared_ptr< attribute_map_base< Key > > const & | map | |||
) | [inline] |
Definition at line 61 of file attribute_map_collection.inl.
void mesh3d::attribute_map_collection< Key >::remove | ( | std::string const & | name | ) | [inline] |
Definition at line 70 of file attribute_map_collection.inl.
bool mesh3d::attribute_map_collection< Key >::has | ( | std::string const & | name | ) | const [inline] |
Definition at line 76 of file attribute_map_collection.inl.
std::tr1::shared_ptr< attribute_map_base< Key > > mesh3d::attribute_map_collection< Key >::find_any | ( | std::string const & | name | ) | const [inline] |
Definition at line 83 of file attribute_map_collection.inl.
00084 { 00085 const_iterator i = m_maps.find(name); 00086 00087 if(i == m_maps.end()) 00088 { 00089 throw attribute_map_not_found_exception(name); 00090 } 00091 00092 assert(i != m_maps.end()); 00093 return i->second; 00094 }
std::tr1::shared_ptr< attribute_map< Key, Value > > mesh3d::attribute_map_collection< Key >::find | ( | std::string const & | name | ) | const [inline] |
Definition at line 123 of file attribute_map_collection.inl.
00124 { 00125 std::tr1::shared_ptr<attribute_map_base<Key> > p = find_any(name); 00126 00127 if( 00128 std::tr1::shared_ptr<attribute_map<Key, Value> > 00129 t = std::tr1::dynamic_pointer_cast<attribute_map<Key, Value> >(p) 00130 ) 00131 { 00132 return t; 00133 } 00134 else 00135 { 00136 throw incompatible_attribute_type_exception( 00137 name, 00138 p->value_type_id().name(), 00139 typeid(Value).name() 00140 ); 00141 00142 //return std::tr1::shared_ptr<attribute_map<Key, Value> >(); 00143 } 00144 }
std::tr1::shared_ptr< attribute_map< Key, Value > > mesh3d::attribute_map_collection< Key >::find_or_create | ( | std::string const & | name | ) | [inline] |
Definition at line 149 of file attribute_map_collection.inl.
00150 { 00151 map_map::iterator i = m_maps.find(name); 00152 if(i != m_maps.end()) 00153 { 00154 if( 00155 std::tr1::shared_ptr<attribute_map<Key, Value> > 00156 t = std::tr1::dynamic_pointer_cast<attribute_map<Key, Value> >(i->second) 00157 ) 00158 { 00159 return t; 00160 } 00161 else 00162 { 00163 throw incompatible_attribute_type_exception( 00164 name, 00165 t->value_type_id().name(), 00166 typeid(Value).name() 00167 ); 00168 00169 //return std::tr1::shared_ptr<attribute_map<Key, Value> >(); 00170 } 00171 } 00172 else 00173 { 00174 return create<Value>(name); 00175 } 00176 }
attribute_map_collection< Key >::const_iterator mesh3d::attribute_map_collection< Key >::begin | ( | ) | const [inline] |
Definition at line 98 of file attribute_map_collection.inl.
attribute_map_collection< Key >::const_iterator mesh3d::attribute_map_collection< Key >::end | ( | ) | const [inline] |
Definition at line 105 of file attribute_map_collection.inl.