MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
multiKeyMap.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef multiKeyMap_H_
10 #define multiKeyMap_H_
11 
12 #include <map>
13 
14 namespace MAKLogger
15 {
20  template <typename Key1,typename Key2, typename Value>
21  class DtMultiKeyMap : public std::map<std::pair<Key1,Key2>,Value>
22  {
23  public:
25  typedef std::pair<Key1,Key2> KeyPair;
27  typedef std::map<KeyPair,Value> KeyPairValueMap;
28  typedef typename KeyPairValueMap::iterator iterator;
29  typedef typename KeyPairValueMap::const_iterator const_iterator;
31 
33  DtMultiKeyMap();
34 
36  virtual ~DtMultiKeyMap();
37 
40 
44 
46  iterator insert(Key1 key1,Key2 key2,Value value);
47 
49  iterator find(const Key1& key1);
51  const_iterator find(const Key1& key1) const;
53 
55  iterator find(const Key2& key2);
57  const_iterator find(const Key2& key2) const;
59 
61  Value& operator[](const Key1& key1);
62 
64  Value& operator[](const Key2& key2);
65 
66  protected:
68  std::map<Key1,Key2> key2LookUp;
70  std::map<Key2,Key1> key1LookUp;
71  };
72 }
73 
74 #define multiKeyMap_INC_
75 #include "multiKeyMap.inl"
76 #undef multiKeyMap_INC_
77 
78 #endif
DtMultiKeyMap()
Ctr constructs an empty map.
iterator insert(Key1 key1, Key2 key2, Value value)
Insert a value with it&#39;s two unique keys.
virtual ~DtMultiKeyMap()
Dtr.
KeyPairValueMap::iterator iterator
The type definition for the map.
Definition: multiKeyMap.h:28
std::map< Key2, Key1 > key1LookUp
Map used to look up Key1 by Key2.
Definition: multiKeyMap.h:70
std::map< Key1, Key2 > key2LookUp
Map used to look up Key2 by Key1.
Definition: multiKeyMap.h:68
KeyPairValueMap::const_iterator const_iterator
The type definition for the map.
Definition: multiKeyMap.h:29
DtMultiKeyMap allows storage of a value with two unique keys of different types.
Definition: multiKeyMap.h:21
std::pair< Key1, Key2 > KeyPair
The type definition for the map.
Definition: multiKeyMap.h:26
Value & operator[](const Key1 &key1)
Access value via Key1;.
std::map< KeyPair, Value > KeyPairValueMap
The type definition for the map.
Definition: multiKeyMap.h:27
DtMultiKeyMap< Key1, Key2, Value > & operator=(const DtMultiKeyMap< Key1, Key2, Value > &)
Assignement operator.
iterator find(const Key1 &key1)
Search for the position by Key1.

Document ID: Generated on Thu Jul 14 15:45:33 EDT 2022 from SVN revision 244827
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)