4 #ifndef DUNE_PROPERTYMAP_HH
5 #define DUNE_PROPERTYMAP_HH
79 template<
class Reference,
class PropertyMap>
83 template<
class Reference,
class PropertyMap,
class Key>
88 return static_cast<const PropertyMap&
>(pmap)[key];
91 template<
class Reference,
class PropertyMap,
class Key,
class Value>
94 const Key& key,
const Value& value)
97 ::exists),
"WritablePropertyMapTag required!");
98 static_cast<const PropertyMap&
>(pmap)[key] = value;
104 template<
class RAI,
class IM,
105 class T =
typename std::iterator_traits<RAI>::value_type,
106 class R =
typename std::iterator_traits<RAI>::reference>
152 : iter_(iter), indexMap_(im)
157 : iter_(), indexMap_()
163 return *(iter_ +
get(indexMap_, key));
180 AssociativePropertyMap<T> >
185 typedef T UniqueAssociativeContainer;
190 typedef typename UniqueAssociativeContainer::value_type::first_type
196 typedef typename UniqueAssociativeContainer::value_type::second_type
202 typedef ValueType& Reference;
223 inline Reference operator[](KeyType key)
const
225 return map_->find(key)->second;
228 UniqueAssociativeContainer* map_;
238 ConstAssociativePropertyMap<T> >
243 typedef T UniqueAssociativeContainer;
248 typedef typename UniqueAssociativeContainer::value_type::first_type
254 typedef typename UniqueAssociativeContainer::value_type::second_type
260 typedef const ValueType& Reference;
281 inline Reference operator[](KeyType key)
const
283 return map_->find(key)->second;
286 const UniqueAssociativeContainer* map_;
319 template<
typename T,
typename C>
std::ptrdiff_t KeyType
Definition: propertymap.hh:65
IndexMap::KeyType KeyType
The key type of the property map.
Definition: propertymap.hh:126
Tag for the category of readable and writable property maps.
Definition: propertymap.hh:49
C Container
The container type to whose entries the properties are attached.
Definition: propertymap.hh:330
std::size_t Reference
The reference type of the map.
Definition: propertymap.hh:302
PM::Reference Reference
The type of the reference to the values.
Definition: propertymap.hh:30
ValueType & Reference
Definition: propertymap.hh:64
Checks wether a type is convertible to another.
Definition: typetraits.hh:212
PM::Category Category
The category the property map belongs to.
Definition: propertymap.hh:34
LvaluePropertyMapTag Category
The category of this property map.
Definition: propertymap.hh:141
ReadablePropertyMapTag Category
The category of the map.
Definition: propertymap.hh:305
A property map that applies the identity function to integers.
Definition: propertymap.hh:292
#define dune_static_assert(COND, MSG)
Helper template so that compilation fails if condition is not true.
Definition: static_assert.hh:79
ValueType operator[](const KeyType &key) const
Definition: propertymap.hh:307
IteratorPropertyMap()
Constructor.
Definition: propertymap.hh:156
Tag for the category of readable property maps.
Definition: propertymap.hh:38
LvaluePropertyMapTag Category
Definition: propertymap.hh:76
RAI RandomAccessIterator
The type of the random access iterator.
Definition: propertymap.hh:114
PM::KeyType KeyType
The type of the key of the property map.
Definition: propertymap.hh:22
std::ptrdiff_t KeyType
Definition: propertymap.hh:75
Traits for type conversions and type information.
Definition: propertymap.hh:17
Tag for the category of writable property maps.
Definition: propertymap.hh:42
IteratorPropertyMap(RandomAccessIterator iter, const IndexMap &im=IndexMap())
Constructor.
Definition: propertymap.hh:150
Fallback implementation of the C++0x static_assert feature.
LvaluePropertyMapTag Category
Definition: propertymap.hh:66
Selector for the property map type.
Definition: propertymap.hh:320
An adapter to turn an unique associative container into a property map.
Definition: propertymap.hh:178
Definition: propertymap.hh:80
IM IndexMap
The type of the index map.
Definition: propertymap.hh:121
PM::ValueType ValueType
The type of the values of the property map.
Definition: propertymap.hh:26
R Reference
The reference type of the property map.
Definition: propertymap.hh:136
T ValueType
Definition: propertymap.hh:73
An adaptor to turn an unique associative container into a property map.
Definition: propertymap.hh:236
std::size_t ValueType
The value type of the map.
Definition: propertymap.hh:299
Reference operator[](KeyType key) const
Access the a value by reference.
Definition: propertymap.hh:161
Tag for the category of lvalue property maps.
Definition: propertymap.hh:56
T ValueType
Definition: propertymap.hh:63
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Definition: propertymap.hh:93
T ValueType
The value type of the property map.
Definition: propertymap.hh:131
Adapter to turn a random access iterator into a property map.
Definition: propertymap.hh:107
std::size_t KeyType
The key type of the map.
Definition: propertymap.hh:296
const ValueType & Reference
Definition: propertymap.hh:74
T Tag
the tag identifying the property.
Definition: propertymap.hh:325