Commits

Des Small authored 81410945d61 Merge
Merge branch 'master' into feature/CAS-12036

code/alma/apps/asdm2MS/AnyValueMap.hpp

Modified
7 7
8 8 // Only used by parasdm2MS, could possibly be replaced by a casacore::Record?
9 9 // boost::any is in c++17
10 10
11 11 #ifndef ANYVALUEMAP_HPP_
12 12 #define ANYVALUEMAP_HPP_
13 13
14 14 #include <map>
15 15 #include <boost/any.hpp>
16 16
17 -// only used by
18 -
19 -using namespace std;
20 -
21 17 template <class T>
22 18 class AnyValueMap {
23 19
24 20 public:
25 21 AnyValueMap(){}
26 22
27 23 virtual ~AnyValueMap(){}
28 24
29 25 private:
30 - map<T, boost::any> container_;
26 + std::map<T, boost::any> container_;
31 27
32 - typedef typename map<T, boost::any>::iterator map_iterator;
33 - typedef typename map<T, boost::any>::const_iterator map_const_iterator;
28 + typedef typename std::map<T, boost::any>::iterator map_iterator;
29 + typedef typename std::map<T, boost::any>::const_iterator map_const_iterator;
34 30
35 31 public:
36 32
37 33 bool containsKey(const T key) const
38 34 {
39 35 return container_.find(key) != container_.end();
40 36 }
41 37
42 38 bool remove(const T key)
43 39 {
44 - map_iterator it = container_.find(key);
40 + std::map_iterator it = container_.find(key);
45 41 if(it != container_.end())
46 42 {
47 43 container_.erase(it);
48 44 return true;
49 45 }
50 46 return false;
51 47 }
52 48
53 49 template <class V>
54 50 V getValue(const T key, const V defaultValue) const
55 51 {
56 - map_const_iterator it = container_.find(key);
52 + std::map_const_iterator it = container_.find(key);
57 53 if(it != container_.end())
58 54 {
59 55 return boost::any_cast<V>(it->second);
60 56 }
61 57 return defaultValue;
62 58 }
63 59
64 60 template <class V>
65 61 V getValue(const T key) const
66 62 {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut