]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
Initial revision
[mothur.git] / globaldata.hpp
1 #ifndef GLOBALDATA_HPP
2 #define GLOBALDATA_HPP
3
4 #include <string>
5 #include <vector>
6 #include <set>
7 #include "groupmap.h"
8
9 using namespace std;
10
11 class ListVector;
12 class SparseMatrix;
13 class OrderVector;
14 class InputData;
15 class GroupMap;
16 class SAbundVector;
17
18 class GlobalData {
19 public:
20         static GlobalData* getInstance();
21         ListVector* getListVector();
22         SparseMatrix* getSparseMatrix();
23         InputData* ginput;
24         OrderVector* gorder;
25         ListVector* glist;
26         SAbundVector* sabund;
27         GroupMap* gGroupmap;
28         string inputFileName, helpRequest, commandName;
29         bool allLines;
30         vector<string> singleEstimators, summaryEstimators, sharedEstimators, rareEstimators, sharedRareEstimators, sharedSummaryEstimators; //holds estimators to be used
31         set<int> lines; //hold lines to be used
32         set<string> labels; //holds labels to be used
33         
34         string getDistFile();
35         string getListFile();
36         string getRabundFile();
37         string getSabundFile();
38         string getNameFile();
39         string getGroupFile();
40         string getOrderFile();
41         string getCutOff();
42         string getFormat();
43         string getPrecision();
44         string getMethod();
45         string getFileRoot();
46         string getIters();
47         string getJumble();
48         string getFreq();
49         void setListFile(string);
50         void setDistFile(string);
51         void setNameFile(string);
52         void setRabundFile(string);
53         void setSabundFile(string);
54         void setFormat(string);
55
56         
57         void setListVector(ListVector*);
58         void setSparseMatrix(SparseMatrix*);
59         void clear(); 
60         
61         void parseGlobalData(string, string);
62         void splitAtEquals(string&, string&);
63         void splitAtComma(string&, string&);
64         void splitAtDash(string&, vector<string>&);
65         void splitAtDash(string&, set<int>&);
66         void splitAtDash(string&, set<string>&);
67         
68 private:
69         string distfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, line, label;
70         string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
71         static GlobalData* _uniqueInstance;
72         GlobalData( const GlobalData& ); // Disable copy constructor
73         void operator=( const GlobalData& ); // Disable assignment operator
74         GlobalData();
75         ~GlobalData();
76         ListVector* gListVector;
77         SparseMatrix* gSparseMatrix;
78         void setReadFormat(string);
79         
80         };
81
82 //**********************************************************************************************************************
83
84 #endif