Guest User

Untitled

a guest
Aug 2nd, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #ifndef HASHMAP_H_
  2. #define HASHMAP_H_
  3.  
  4. #include <unordered_map>
  5. #include <boost/variant/get.hpp>
  6. #include <boost/functional/hash.hpp>
  7.  
  8. #include "LookupTable.h"
  9.  
  10. using namespace std;
  11.  
  12. namespace lookup {
  13.  
  14. class HashMap: public lookup::LookupTable {
  15. public:
  16.     HashMap(string table_name, string col_name) :
  17.             lookup::LookupTable { table_name, col_name } {
  18.     }
  19.     virtual ~HashMap();
  20.  
  21.     void add_value(short agent_id, lut_value value);
  22.     vector<short> lookup(lut_value value);
  23.  
  24.     int size();
  25. private:
  26.     unordered_map<lut_value, short, boost::hash<lut_value>> table;
  27. };
  28.  
  29. }
  30.  
  31. #endif /* HASHMAP_H_ */
Advertisement
Add Comment
Please, Sign In to add comment