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