Initial check in of c++ short read programming library. These classes give functional...
[htsworkflow.git] / htswanalysis / src / SRLib / chrom_list.h
1 /* chrom_list:
2  * Class used to store a mapping of chromosome name (as a string), to the corresponding file.
3  */
4
5 #include <ext/hash_map>
6
7 #ifndef CHROMLIST_H
8 #define CHROMLIST_H
9
10 using namespace std;
11 using namespace __gnu_cxx;
12
13 struct eq_str {
14   bool operator() (const string& a, const string& b) const {
15     return(strcmp(a.c_str(), b.c_str()) == 0);
16   }
17 };
18
19 struct hash_str {
20   size_t operator() (const string& a) const {
21     hash<const char*> h; 
22     return(h(a.c_str())); 
23   }
24 };
25
26 class ChromList : public hash_map<string, string, hash_str, eq_str> {
27   public:
28     ChromList(char* filename);
29 };
30
31 #endif