A remark added.
2 #ifndef HUGO_MAPSKELETON_H
3 #define HUGO_MAPSKELETON_H
6 ///\brief Map concepts checking classes for testing and documenting.
10 /// The namespace of HUGOlib concepts and concept checking classes
13 /// Readable map concept
14 template<typename K, typename T>
20 /// Map's value type. (The type of objects associated with the keys).
23 /// Returns the value associated with a key.
24 ValueType operator[](const KeyType &k) const {return ValueType();}
26 ///Default constructor
31 /// Writable map concept
32 template<typename K, typename T>
38 /// Map's value type. (The type of objects associated with the keys).
41 /// Sets the value associated with a key.
42 void set(const KeyType &k,const ValueType &t) {}
44 ///Default constructor
48 ///Read/Writeable map concept
49 template<typename K, typename T>
50 class ReadWriteMap : public ReadMap<K,T>,
56 /// Map's value type. (The type of objects associated with the keys).
59 /// Returns the value associated with a key.
60 ValueType operator[](const KeyType &k) const {return ValueType();}
61 /// Sets the value associated with a key.
62 void set(const KeyType &k,const ValueType &t) {}
64 ///Default constructor
69 ///Dereferable map concept
70 template<typename K, typename T>
71 class ReferenceMap : public ReadWriteMap<K,T>
76 /// Map's value type. (The type of objects associated with the keys).
82 typedef ValueType& ReferenceType;
83 /// Map's const reference type.
84 typedef const ValueType& ConstReferenceType;
86 ///Returns a reference to the value associated to a key.
87 ReferenceType operator[](const KeyType &i) { return tmp; }
88 ///Returns a const reference to the value associated to a key.
89 ConstReferenceType operator[](const KeyType &i) const
91 /// Sets the value associated with a key.
92 void set(const KeyType &k,const ValueType &t) { operator[](k)=t; }
94 ///Default constructor
97 } //namespace skeleton
99 #endif // HUGO_MAPSKELETON_H