3 #ifndef DUNE_PROPERTYMAP_HH 4 #define DUNE_PROPERTYMAP_HH 77 template<
class Reference,
class PropertyMap>
81 template<
class Reference,
class PropertyMap,
class Key>
86 return static_cast<const PropertyMap&
>(pmap)[key];
89 template<
class Reference,
class PropertyMap,
class Key,
class Value>
92 const Key& key,
const Value& value)
95 ::exists),
"WritablePropertyMapTag required!");
96 static_cast<const PropertyMap&
>(pmap)[key] = value;
102 template<
class RAI,
class IM,
103 class T =
typename std::iterator_traits<RAI>::value_type,
104 class R =
typename std::iterator_traits<RAI>::reference>
149 const IndexMap& im=IndexMap())
150 : iter_(iter), indexMap_(im)
155 : iter_(), indexMap_()
161 return *(iter_ +
get(indexMap_, key));
166 RandomAccessIterator iter_;
178 AssociativePropertyMap<T> >
183 typedef T UniqueAssociativeContainer;
188 typedef typename UniqueAssociativeContainer::value_type::first_type
194 typedef typename UniqueAssociativeContainer::value_type::second_type
221 inline Reference operator[](KeyType key)
const 223 return map_->find(key)->second;
226 UniqueAssociativeContainer* map_;
236 ConstAssociativePropertyMap<T> >
241 typedef T UniqueAssociativeContainer;
246 typedef typename UniqueAssociativeContainer::value_type::first_type
252 typedef typename UniqueAssociativeContainer::value_type::second_type
279 inline Reference operator[](KeyType key)
const 281 return map_->find(key)->second;
284 const UniqueAssociativeContainer* map_;
317 template<
typename T,
typename C>
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition: propertymap.hh:91
PM::KeyType KeyType
The type of the key of the property map.
Definition: propertymap.hh:20
std::size_t ValueType
The value type of the map.
Definition: propertymap.hh:297
PM::ValueType ValueType
The type of the values of the property map.
Definition: propertymap.hh:24
ValueType & Reference
Definition: propertymap.hh:62
ValueType operator[](const KeyType &key) const
Definition: propertymap.hh:305
T ValueType
Definition: propertymap.hh:71
Tag for the category of readable property maps.
Definition: propertymap.hh:36
RAI RandomAccessIterator
The type of the random access iterator.
Definition: propertymap.hh:112
An adapter to turn an unique associative container into a property map.
Definition: propertymap.hh:176
std::ptrdiff_t KeyType
Definition: propertymap.hh:63
std::size_t KeyType
The key type of the map.
Definition: propertymap.hh:294
std::size_t Reference
The reference type of the map.
Definition: propertymap.hh:300
Traits for type conversions and type information.
R Reference
The reference type of the property map.
Definition: propertymap.hh:134
Reference operator[](KeyType key) const
Access the a value by reference.
Definition: propertymap.hh:159
C Container
The container type to whose entries the properties are attached.
Definition: propertymap.hh:328
Tag for the category of writable property maps.
Definition: propertymap.hh:40
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition: propertymap.hh:148
Definition: propertymap.hh:15
IndexMap::KeyType KeyType
The key type of the property map.
Definition: propertymap.hh:124
IM IndexMap
The type of the index map.
Definition: propertymap.hh:119
LvaluePropertyMapTag Category
Definition: propertymap.hh:64
T Tag
the tag identifying the property.
Definition: propertymap.hh:323
Selector for the property map type.
Definition: propertymap.hh:318
Definition: propertymap.hh:78
IteratorPropertyMap()
Constructor.
Definition: propertymap.hh:154
ReadablePropertyMapTag Category
The category of the map.
Definition: propertymap.hh:303
A property map that applies the identity function to integers.
Definition: propertymap.hh:290
Checks wether a type is convertible to another.
Definition: typetraits.hh:176
LvaluePropertyMapTag Category
Definition: propertymap.hh:74
const ValueType & Reference
Definition: propertymap.hh:72
An adaptor to turn an unique associative container into a property map.
Definition: propertymap.hh:234
Adapter to turn a random access iterator into a property map.
Definition: propertymap.hh:105
PM::Category Category
The category the property map belongs to.
Definition: propertymap.hh:32
PM::Reference Reference
The type of the reference to the values.
Definition: propertymap.hh:28
std::ptrdiff_t KeyType
Definition: propertymap.hh:73
Tag for the category of lvalue property maps.
Definition: propertymap.hh:54
LvaluePropertyMapTag Category
The category of this property map.
Definition: propertymap.hh:139
T ValueType
The value type of the property map.
Definition: propertymap.hh:129
T ValueType
Definition: propertymap.hh:61
Dune namespace.
Definition: alignment.hh:9
Tag for the category of readable and writable property maps.
Definition: propertymap.hh:47