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>
Dune namespace.
Definition alignment.hh:11
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition propertymap.hh:90
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)
Definition propertymap.hh:82
Definition propertymap.hh:15
PM::ValueType ValueType
The type of the values of the property map.
Definition propertymap.hh:23
PM::Category Category
The category the property map belongs to.
Definition propertymap.hh:31
PM::Reference Reference
The type of the reference to the values.
Definition propertymap.hh:27
PM::KeyType KeyType
The type of the key of the property map.
Definition propertymap.hh:19
Tag for the category of readable property maps.
Definition propertymap.hh:36
Tag for the category of writable property maps.
Definition propertymap.hh:40
Tag for the category of readable and writable property maps.
Definition propertymap.hh:48
Tag for the category of lvalue property maps.
Definition propertymap.hh:55
ValueType & Reference
Definition propertymap.hh:61
std::ptrdiff_t KeyType
Definition propertymap.hh:62
T ValueType
Definition propertymap.hh:60
LvaluePropertyMapTag Category
Definition propertymap.hh:63
std::ptrdiff_t KeyType
Definition propertymap.hh:72
const ValueType & Reference
Definition propertymap.hh:71
T ValueType
Definition propertymap.hh:70
LvaluePropertyMapTag Category
Definition propertymap.hh:73
Definition propertymap.hh:78
Adapter to turn a random access iterator into a property map.
Definition propertymap.hh:106
IndexMap::KeyType KeyType
The key type of the property map.
Definition propertymap.hh:123
R Reference
The reference type of the property map.
Definition propertymap.hh:133
T ValueType
The value type of the property map.
Definition propertymap.hh:128
Reference operator[](KeyType key) const
Access the a value by reference.
Definition propertymap.hh:158
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition propertymap.hh:147
IteratorPropertyMap()
Constructor.
Definition propertymap.hh:153
IM IndexMap
The type of the index map.
Definition propertymap.hh:118
RAI RandomAccessIterator
The type of the random access iterator.
Definition propertymap.hh:111
LvaluePropertyMapTag Category
The category of this property map.
Definition propertymap.hh:138
An adapter to turn an unique associative container into a property map.
Definition propertymap.hh:178
An adaptor to turn an unique associative container into a property map.
Definition propertymap.hh:236
A property map that applies the identity function to integers.
Definition propertymap.hh:291
std::size_t ValueType
The value type of the map.
Definition propertymap.hh:296
std::size_t KeyType
The key type of the map.
Definition propertymap.hh:293
ValueType operator[](const KeyType &key) const
Definition propertymap.hh:304
std::size_t Reference
The reference type of the map.
Definition propertymap.hh:299
ReadablePropertyMapTag Category
The category of the map.
Definition propertymap.hh:302
Selector for the property map type.
Definition propertymap.hh:318
T Tag
the tag identifying the property.
Definition propertymap.hh:322
C Container
The container type to whose entries the properties are attached.
Definition propertymap.hh:327