]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
a2b91738e15d29d02ccdc87559b3e4441c5349db
[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 getPhylipFile();
35         string getColumnFile();
36         string getListFile();
37         string getRabundFile();
38         string getSabundFile();
39         string getNameFile();
40         string getGroupFile();
41         string getOrderFile();
42         string getFastaFile();
43         string getCutOff();
44         string getFormat();
45         string getPrecision();
46         string getMethod();
47         string getFileRoot();
48         string getIters();
49         string getJumble();
50         string getFreq();
51         void setListFile(string);
52         void setPhylipFile(string);
53         void setColumnFile(string);
54         void setNameFile(string);
55         void setRabundFile(string);
56         void setSabundFile(string);
57         void setFormat(string);
58
59         
60         void setListVector(ListVector*);
61         void setSparseMatrix(SparseMatrix*);
62         void clear(); 
63         
64         void parseGlobalData(string, string);
65         void splitAtEquals(string&, string&);
66         void splitAtComma(string&, string&);
67         void splitAtDash(string&, vector<string>&);
68         void splitAtDash(string&, set<int>&);
69         void splitAtDash(string&, set<string>&);
70         
71 private:
72         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile,line, label;
73         string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
74         static GlobalData* _uniqueInstance;
75         GlobalData( const GlobalData& ); // Disable copy constructor
76         void operator=( const GlobalData& ); // Disable assignment operator
77         GlobalData();
78         ~GlobalData();
79         ListVector* gListVector;
80         SparseMatrix* gSparseMatrix;
81         
82 };
83
84 //**********************************************************************************************************************
85
86 #endif