2 #ifndef HUGO_MAPSKELETON_H
3 #define HUGO_MAPSKELETON_H
7 ///Readable map skeleton
8 template<typename K, typename T>
17 ///Default constructor.
20 ///Reads an element of the map.
21 ValueType operator[](const KeyType &i) const {return ValueType();}
25 ///Writeable map skeleton
26 template<typename K, typename T>
27 class WriteMapSkeleton
35 ///Default constructor.
37 ///'Fill with' constructor.
38 WriteMapSkeleton(const ValueType &t) {}
40 ///Write an element of a map.
41 void set(const KeyType &i,const ValueType &t) {}
44 ///Read/Write map skeleton.
45 template<typename K, typename T>
46 class ReadWriteMapSkeleton : public ReadMapSkeleton<K,T>,
47 public WriteMapSkeleton<K,T>
50 ///Default constructor.
51 ReadWriteMapSkeleton() : ReadMapSkeleton(), WriteMapSkeleton() {}
52 ///'Fill with' constructor.
53 ReadWriteMap(const ValueType &t) :ReadMapSkeleton(), WriteMapSkeleton(t) {}
57 ///Dereferable map skeleton
58 template<typename K, typename T>
59 class MemoryMapSkeleton : public ReadWriteMapSkeleton<K,T>
67 ///Default constructor.
68 ReferenceMapSkeleton() : ReadWriteMapSkeleton() {}
69 ///'Fill with' constructor.
70 ReferenceMapSkeleton(const ValueType &t) : ReadWriteMapSkeleton(t) {}
72 ///Give a reference to the value belonging to a key.
73 ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
74 ///Give a const reference to the value belonging to a key.
75 const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
81 #endif // HUGO_MAPSKELETON_H