IMP  2.0.1
The Integrative Modeling Platform
map.h
Go to the documentation of this file.
1 /**
2  * \file IMP/base/map.h
3  * \brief Declare an efficient stl-compatible map
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPBASE_BASE_MAP_H
9 #define IMPBASE_BASE_MAP_H
10 
11 #include <IMP/base/base_config.h>
12 #include <boost/version.hpp>
13 // creates warnings in clang and we only use clang for diagnostics anyway
14 
15 #include <boost/unordered_map.hpp>
16 #include "hash.h"
17 
18 
19 IMPBASE_BEGIN_NAMESPACE
20 
21 /** This class chooses the best of STL compatible non-ordered
22  map available. This will, in general, be a hash map if it
23  is available or std::map if it is not.
24 */
25 template <class Key, class Data>
26 class map:
27  public boost::unordered_map<Key, Data>
28 {
29  typedef boost::unordered_map<Key, Data> P;
30 public:
31  map(){}
32  template <class It>
33  map(It b, It e): P(b,e){}
34 };
35 
36 IMPBASE_END_NAMESPACE
37 
38 #endif /* IMPBASE_BASE_MAP_H */