IMP  2.1.1
The Integrative Modeling Platform
base/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 IMPBASE_BEGIN_NAMESPACE
19 /** This class chooses the best of STL compatible
20  non-ordered
21  map available. This will, in general, be a hash map
22  if it
23  is available or std::map if it is not.
24  */
25 template <class Key, class Data>
26 class map : public boost::unordered_map<Key, Data> {
27  typedef boost::unordered_map<Key, Data> P;
28 
29  public:
30  map() {}
31  template <class It>
32  map(It b, It e)
33  : P(b, e) {}
34 };
35 
36 IMPBASE_END_NAMESPACE
37 
38 #endif /* IMPBASE_BASE_MAP_H */
IO support.