]> git.donarmstrong.com Git - mothur.git/blob - groupmap.h
added read.shared, broke up globaldata a bit
[mothur.git] / groupmap.h
1 #ifndef GROUPMAP_H
2 #define GROUPMAP_H
3 /*
4  *  groupmap.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 12/1/08.
8  *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include <map>
13 #include <string>
14 #include <iostream>
15 #include <fstream>
16 #include "utilities.hpp"
17
18 /* This class is a representation of the groupfile.  It is used by all the shared commands to determine what group a 
19         certain sequence belongs to. */
20
21 class GroupMap {
22 public:
23         GroupMap() {};
24         GroupMap(string);
25         ~GroupMap();
26         void readMap();
27         int getNumGroups();
28         string getGroup(string);
29         void setGroup(string, string);
30         vector<string> namesOfGroups;
31         map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays.
32                 
33 private:
34         ifstream fileHandle;
35         string groupFileName;
36         int index;
37         map<string, string>::iterator it;
38         void setNamesOfGroups(string); 
39         map<string, string> groupmap; //sequence name and groupname
40 };
41
42 #endif