5 #ifndef DUNE_PROPERTYMAP_HH 6 #define DUNE_PROPERTYMAP_HH 10 #include <type_traits> 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>
Reference operator[](KeyType key) const
Access the a value by reference.
Definition: propertymap.hh:160
C Container
The container type to whose entries the properties are attached.
Definition: propertymap.hh:329
IM IndexMap
The type of the index map.
Definition: propertymap.hh:120
T Tag
the tag identifying the property.
Definition: propertymap.hh:324
PM::KeyType KeyType
The type of the key of the property map.
Definition: propertymap.hh:21
LvaluePropertyMapTag Category
Definition: propertymap.hh:65
IteratorPropertyMap()
Constructor.
Definition: propertymap.hh:155
Tag for the category of readable property maps.
Definition: propertymap.hh:37
T ValueType
The value type of the property map.
Definition: propertymap.hh:130
Tag for the category of readable and writable property maps.
Definition: propertymap.hh:48
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition: propertymap.hh:92
A property map that applies the identity function to integers.
Definition: propertymap.hh:291
Adapter to turn a random access iterator into a property map.
Definition: propertymap.hh:106
std::size_t ValueType
The value type of the map.
Definition: propertymap.hh:298
std::size_t Reference
The reference type of the map.
Definition: propertymap.hh:301
Definition: propertymap.hh:16
Dune namespace
Definition: alignedallocator.hh:12
RAI RandomAccessIterator
The type of the random access iterator.
Definition: propertymap.hh:113
PM::ValueType ValueType
The type of the values of the property map.
Definition: propertymap.hh:25
const ValueType & Reference
Definition: propertymap.hh:73
Tag for the category of writable property maps.
Definition: propertymap.hh:41
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition: propertymap.hh:149
T ValueType
Definition: propertymap.hh:72
ValueType operator[](const KeyType &key) const
Definition: propertymap.hh:306
An adaptor to turn an unique associative container into a property map.
Definition: propertymap.hh:235
ReadablePropertyMapTag Category
The category of the map.
Definition: propertymap.hh:304
Definition: propertymap.hh:79
PM::Category Category
The category the property map belongs to.
Definition: propertymap.hh:33
Tag for the category of lvalue property maps.
Definition: propertymap.hh:55
IndexMap::KeyType KeyType
The key type of the property map.
Definition: propertymap.hh:125
LvaluePropertyMapTag Category
Definition: propertymap.hh:75
PM::Reference Reference
The type of the reference to the values.
Definition: propertymap.hh:29
R Reference
The reference type of the property map.
Definition: propertymap.hh:135
Selector for the property map type.
Definition: propertymap.hh:319
std::ptrdiff_t KeyType
Definition: propertymap.hh:64
An adapter to turn an unique associative container into a property map.
Definition: propertymap.hh:177
T ValueType
Definition: propertymap.hh:62
LvaluePropertyMapTag Category
The category of this property map.
Definition: propertymap.hh:140
std::ptrdiff_t KeyType
Definition: propertymap.hh:74
std::size_t KeyType
The key type of the map.
Definition: propertymap.hh:295
ValueType & Reference
Definition: propertymap.hh:63