5#ifndef DUNE_PROPERTYMAP_HH
6#define DUNE_PROPERTYMAP_HH
78 template<
class Reference,
class PropertyMap>
82 template<
class Reference,
class PropertyMap,
class Key>
87 return static_cast<const PropertyMap&
>(pmap)[key];
90 template<
class Reference,
class PropertyMap,
class Key,
class Value>
93 const Key& key,
const Value& value)
95 static_assert(std::is_convertible<typename PropertyMap::Category,WritablePropertyMapTag>::value,
96 "WritablePropertyMapTag required!");
97 static_cast<const PropertyMap&
>(pmap)[key] = value;
103 template<
class RAI,
class IM,
104 class T =
typename std::iterator_traits<RAI>::value_type,
105 class R =
typename std::iterator_traits<RAI>::reference>
151 : iter_(iter), indexMap_(im)
156 : iter_(), indexMap_()
162 return *(iter_ +
get(indexMap_, key));
179 AssociativePropertyMap<T> >
184 typedef T UniqueAssociativeContainer;
189 typedef typename UniqueAssociativeContainer::value_type::first_type
195 typedef typename UniqueAssociativeContainer::value_type::second_type
201 typedef ValueType& Reference;
222 inline Reference operator[](KeyType key)
const
224 return map_->find(key)->second;
227 UniqueAssociativeContainer* map_;
237 ConstAssociativePropertyMap<T> >
242 typedef T UniqueAssociativeContainer;
247 typedef typename UniqueAssociativeContainer::value_type::first_type
253 typedef typename UniqueAssociativeContainer::value_type::second_type
259 typedef const ValueType& Reference;
280 inline Reference operator[](KeyType key)
const
282 return map_->find(key)->second;
285 const UniqueAssociativeContainer* map_;
318 template<
typename T,
typename C>
Dune namespace.
Definition alignedallocator.hh:13
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition propertymap.hh:92
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)
Definition propertymap.hh:84
Definition propertymap.hh:17
PM::ValueType ValueType
The type of the values of the property map.
Definition propertymap.hh:25
PM::Category Category
The category the property map belongs to.
Definition propertymap.hh:33
PM::Reference Reference
The type of the reference to the values.
Definition propertymap.hh:29
PM::KeyType KeyType
The type of the key of the property map.
Definition propertymap.hh:21
Tag for the category of readable property maps.
Definition propertymap.hh:38
Tag for the category of writable property maps.
Definition propertymap.hh:42
Tag for the category of readable and writable property maps.
Definition propertymap.hh:50
Tag for the category of lvalue property maps.
Definition propertymap.hh:57
ValueType & Reference
Definition propertymap.hh:63
std::ptrdiff_t KeyType
Definition propertymap.hh:64
T ValueType
Definition propertymap.hh:62
LvaluePropertyMapTag Category
Definition propertymap.hh:65
std::ptrdiff_t KeyType
Definition propertymap.hh:74
const ValueType & Reference
Definition propertymap.hh:73
T ValueType
Definition propertymap.hh:72
LvaluePropertyMapTag Category
Definition propertymap.hh:75
Definition propertymap.hh:80
Adapter to turn a random access iterator into a property map.
Definition propertymap.hh:108
IndexMap::KeyType KeyType
The key type of the property map.
Definition propertymap.hh:125
R Reference
The reference type of the property map.
Definition propertymap.hh:135
T ValueType
The value type of the property map.
Definition propertymap.hh:130
Reference operator[](KeyType key) const
Access the a value by reference.
Definition propertymap.hh:160
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition propertymap.hh:149
IteratorPropertyMap()
Constructor.
Definition propertymap.hh:155
IM IndexMap
The type of the index map.
Definition propertymap.hh:120
RAI RandomAccessIterator
The type of the random access iterator.
Definition propertymap.hh:113
LvaluePropertyMapTag Category
The category of this property map.
Definition propertymap.hh:140
An adapter to turn an unique associative container into a property map.
Definition propertymap.hh:180
An adaptor to turn an unique associative container into a property map.
Definition propertymap.hh:238
A property map that applies the identity function to integers.
Definition propertymap.hh:293
std::size_t ValueType
The value type of the map.
Definition propertymap.hh:298
std::size_t KeyType
The key type of the map.
Definition propertymap.hh:295
ValueType operator[](const KeyType &key) const
Definition propertymap.hh:306
std::size_t Reference
The reference type of the map.
Definition propertymap.hh:301
ReadablePropertyMapTag Category
The category of the map.
Definition propertymap.hh:304
Selector for the property map type.
Definition propertymap.hh:320
T Tag
the tag identifying the property.
Definition propertymap.hh:324
C Container
The container type to whose entries the properties are attached.
Definition propertymap.hh:329