Go to the documentation of this file.
3 #ifndef DUNE_PROPERTYMAP_HH
4 #define DUNE_PROPERTYMAP_HH
76 template<
class Reference,
class PropertyMap>
80 template<
class Reference,
class PropertyMap,
class Key>
85 return static_cast<const PropertyMap&
>(pmap)[key];
88 template<
class Reference,
class PropertyMap,
class Key,
class Value>
91 const Key& key,
const Value& value)
93 static_assert(std::is_convertible<typename PropertyMap::Category,WritablePropertyMapTag>::value,
94 "WritablePropertyMapTag required!");
95 static_cast<const PropertyMap&
>(pmap)[key] = value;
101 template<
class RAI,
class IM,
102 class T =
typename std::iterator_traits<RAI>::value_type,
103 class R =
typename std::iterator_traits<RAI>::reference>
149 : iter_(iter), indexMap_(im)
154 : iter_(), indexMap_()
160 return *(iter_ +
get(indexMap_, key));
177 AssociativePropertyMap<T> >
182 typedef T UniqueAssociativeContainer;
187 typedef typename UniqueAssociativeContainer::value_type::first_type
193 typedef typename UniqueAssociativeContainer::value_type::second_type
199 typedef ValueType& Reference;
220 inline Reference operator[](KeyType key)
const
222 return map_->find(key)->second;
225 UniqueAssociativeContainer* map_;
235 ConstAssociativePropertyMap<T> >
240 typedef T UniqueAssociativeContainer;
245 typedef typename UniqueAssociativeContainer::value_type::first_type
251 typedef typename UniqueAssociativeContainer::value_type::second_type
257 typedef const ValueType& Reference;
278 inline Reference operator[](KeyType key)
const
280 return map_->find(key)->second;
283 const UniqueAssociativeContainer* map_;
316 template<
typename T,
typename C>
RAI RandomAccessIterator
The type of the random access iterator.
Definition: propertymap.hh:111
IM IndexMap
The type of the index map.
Definition: propertymap.hh:118
const typedef ValueType & Reference
Definition: propertymap.hh:71
PM::Reference Reference
The type of the reference to the values.
Definition: propertymap.hh:27
T ValueType
The value type of the property map.
Definition: propertymap.hh:128
An adapter to turn an unique associative container into a property map.
Definition: propertymap.hh:175
std::size_t KeyType
The key type of the map.
Definition: propertymap.hh:293
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition: propertymap.hh:90
T Tag
the tag identifying the property.
Definition: propertymap.hh:322
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition: propertymap.hh:147
T ValueType
Definition: propertymap.hh:70
Definition: propertymap.hh:14
std::ptrdiff_t KeyType
Definition: propertymap.hh:62
Definition: propertymap.hh:77
Tag for the category of lvalue property maps.
Definition: propertymap.hh:53
ReadablePropertyMapTag Category
The category of the map.
Definition: propertymap.hh:302
ValueType & Reference
Definition: propertymap.hh:61
C Container
The container type to whose entries the properties are attached.
Definition: propertymap.hh:327
Tag for the category of writable property maps.
Definition: propertymap.hh:39
IteratorPropertyMap()
Constructor.
Definition: propertymap.hh:153
R Reference
The reference type of the property map.
Definition: propertymap.hh:133
A property map that applies the identity function to integers.
Definition: propertymap.hh:289
ValueType operator[](const KeyType &key) const
Definition: propertymap.hh:304
PM::ValueType ValueType
The type of the values of the property map.
Definition: propertymap.hh:23
T ValueType
Definition: propertymap.hh:60
Reference operator[](KeyType key) const
Access the a value by reference.
Definition: propertymap.hh:158
PM::KeyType KeyType
The type of the key of the property map.
Definition: propertymap.hh:19
IndexMap::KeyType KeyType
The key type of the property map.
Definition: propertymap.hh:123
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)
Definition: propertymap.hh:82
std::size_t Reference
The reference type of the map.
Definition: propertymap.hh:299
LvaluePropertyMapTag Category
The category of this property map.
Definition: propertymap.hh:138
Adapter to turn a random access iterator into a property map.
Definition: propertymap.hh:104
PM::Category Category
The category the property map belongs to.
Definition: propertymap.hh:31
LvaluePropertyMapTag Category
Definition: propertymap.hh:73
Tag for the category of readable and writable property maps.
Definition: propertymap.hh:46
Selector for the property map type.
Definition: propertymap.hh:317
std::size_t ValueType
The value type of the map.
Definition: propertymap.hh:296
LvaluePropertyMapTag Category
Definition: propertymap.hh:63
Tag for the category of readable property maps.
Definition: propertymap.hh:35
std::ptrdiff_t KeyType
Definition: propertymap.hh:72
An adaptor to turn an unique associative container into a property map.
Definition: propertymap.hh:233
Dune namespace.
Definition: alignedallocator.hh:13