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>
148 const IndexMap& im=IndexMap())
149 : iter_(iter), indexMap_(im)
154 : iter_(), indexMap_()
160 return *(iter_ +
get(indexMap_, key));
165 RandomAccessIterator iter_;
177 AssociativePropertyMap<T> >
182 typedef T UniqueAssociativeContainer;
187 typedef typename UniqueAssociativeContainer::value_type::first_type
193 typedef typename UniqueAssociativeContainer::value_type::second_type
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
278 inline Reference operator[](KeyType key)
const 280 return map_->find(key)->second;
283 const UniqueAssociativeContainer* map_;
316 template<
typename T,
typename C>
std::size_t ValueType
The value type of the map.
Definition: propertymap.hh:296
RAI RandomAccessIterator
The type of the random access iterator.
Definition: propertymap.hh:111
PM::KeyType KeyType
The type of the key of the property map.
Definition: propertymap.hh:19
A property map that applies the identity function to integers.
Definition: propertymap.hh:289
T Tag
the tag identifying the property.
Definition: propertymap.hh:322
T ValueType
Definition: propertymap.hh:70
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition: propertymap.hh:90
R Reference
The reference type of the property map.
Definition: propertymap.hh:133
PM::Category Category
The category the property map belongs to.
Definition: propertymap.hh:31
IM IndexMap
The type of the index map.
Definition: propertymap.hh:118
T ValueType
Definition: propertymap.hh:60
std::size_t KeyType
The key type of the map.
Definition: propertymap.hh:293
std::ptrdiff_t KeyType
Definition: propertymap.hh:62
C Container
The container type to whose entries the properties are attached.
Definition: propertymap.hh:327
Tag for the category of readable property maps.
Definition: propertymap.hh:35
LvaluePropertyMapTag Category
The category of this property map.
Definition: propertymap.hh:138
LvaluePropertyMapTag Category
Definition: propertymap.hh:73
Dune namespace.
Definition: alignment.hh:10
ValueType & Reference
Definition: propertymap.hh:61
Tag for the category of readable and writable property maps.
Definition: propertymap.hh:46
Selector for the property map type.
Definition: propertymap.hh:317
const ValueType & Reference
Definition: propertymap.hh:71
T ValueType
The value type of the property map.
Definition: propertymap.hh:128
std::size_t Reference
The reference type of the map.
Definition: propertymap.hh:299
PM::ValueType ValueType
The type of the values of the property map.
Definition: propertymap.hh:23
Adapter to turn a random access iterator into a property map.
Definition: propertymap.hh:104
ValueType operator[](const KeyType &key) const
Definition: propertymap.hh:304
IndexMap::KeyType KeyType
The key type of the property map.
Definition: propertymap.hh:123
Definition: propertymap.hh:14
Reference operator[](KeyType key) const
Access the a value by reference.
Definition: propertymap.hh:158
Tag for the category of writable property maps.
Definition: propertymap.hh:39
LvaluePropertyMapTag Category
Definition: propertymap.hh:63
PM::Reference Reference
The type of the reference to the values.
Definition: propertymap.hh:27
IteratorPropertyMap()
Constructor.
Definition: propertymap.hh:153
ReadablePropertyMapTag Category
The category of the map.
Definition: propertymap.hh:302
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition: propertymap.hh:147
An adaptor to turn an unique associative container into a property map.
Definition: propertymap.hh:233
Definition: propertymap.hh:77
Tag for the category of lvalue property maps.
Definition: propertymap.hh:53
std::ptrdiff_t KeyType
Definition: propertymap.hh:72
An adapter to turn an unique associative container into a property map.
Definition: propertymap.hh:175