Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef multiKeyMap_H_
00010 #define multiKeyMap_H_
00011
00012 #include <map>
00013
00014 namespace MAKLogger
00015 {
00020 template <typename Key1,typename Key2, typename Value>
00021 class DtMultiKeyMap : public std::map<std::pair<Key1,Key2>,Value>
00022 {
00023 public:
00025
00026 typedef std::pair<Key1,Key2> KeyPair;
00027 typedef std::map<KeyPair,Value> KeyPairValueMap;
00028 typedef typename KeyPairValueMap::iterator iterator;
00029 typedef typename KeyPairValueMap::const_iterator const_iterator;
00031
00033 DtMultiKeyMap();
00034
00036 virtual ~DtMultiKeyMap();
00037
00039 DtMultiKeyMap(const DtMultiKeyMap<Key1,Key2,Value>&);
00040
00042 DtMultiKeyMap<Key1,Key2,Value>& operator=(
00043 const DtMultiKeyMap<Key1,Key2,Value>&);
00044
00046 iterator insert(Key1 key1,Key2 key2,Value value);
00047
00049
00050 iterator find(const Key1& key1);
00051 const_iterator find(const Key1& key1) const;
00053
00055
00056 iterator find(const Key2& key2);
00057 const_iterator find(const Key2& key2) const;
00059
00061 Value& operator[](const Key1& key1);
00062
00064 Value& operator[](const Key2& key2);
00065
00066 protected:
00068 std::map<Key1,Key2> key2LookUp;
00070 std::map<Key2,Key1> key1LookUp;
00071 };
00072 }
00073
00074 #define multiKeyMap_INC_
00075 #include "multiKeyMap.inl"
00076 #undef multiKeyMap_INC_
00077
00078 #endif