2 #ifndef HUGO_MAPSKELETON_H
3 #define HUGO_MAPSKELETON_H
6 ///\brief Map concepts checking classes for testing and documenting.
10 ///Readable map skeleton
11 template<typename K, typename T>
20 ///Default constructor.
23 ///Reads an element of the map.
24 ValueType operator[](const KeyType &i) const {return ValueType();}
28 ///Writeable map skeleton
29 template<typename K, typename T>
30 class WriteMapSkeleton
38 ///Default constructor.
40 ///'Fill with' constructor.
41 WriteMapSkeleton(const ValueType &t) {}
43 ///Write an element of a map.
44 void set(const KeyType &i,const ValueType &t) {}
47 ///Read/Write map skeleton.
48 template<typename K, typename T>
49 class ReadWriteMapSkeleton : public ReadMapSkeleton<K,T>,
50 public WriteMapSkeleton<K,T>
53 ///Default constructor.
54 ReadWriteMapSkeleton() : ReadMapSkeleton(), WriteMapSkeleton() {}
55 ///'Fill with' constructor.
56 ReadWriteMap(const ValueType &t) :ReadMapSkeleton(), WriteMapSkeleton(t) {}
60 ///Dereferable map skeleton
61 template<typename K, typename T>
62 class MemoryMapSkeleton : public ReadWriteMapSkeleton<K,T>
70 ///Default constructor.
71 ReferenceMapSkeleton() : ReadWriteMapSkeleton() {}
72 ///'Fill with' constructor.
73 ReferenceMapSkeleton(const ValueType &t) : ReadWriteMapSkeleton(t) {}
75 ///Give a reference to the value belonging to a key.
76 ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
77 ///Give a const reference to the value belonging to a key.
78 const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
84 #endif // HUGO_MAPSKELETON_H