]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
31a63b67adad73bd7e46487a4849cee6135f6ede
[mothur.git] / globaldata.hpp
1 #ifndef GLOBALDATA_HPP
2 #define GLOBALDATA_HPP
3
4 #include <string>
5 #include <vector>
6 #include <set>
7 #include <iostream>
8 #include <iomanip>
9 #include <map>
10 #include <sstream>
11 #include <stdexcept>
12 #include <exception>
13
14 #include "groupmap.h"
15 #include "treemap.h"
16
17 using namespace std;
18
19 class ListVector;
20 class SharedListVector;
21 class SparseMatrix;
22 class Tree;
23 class OrderVector;
24 class InputData;
25 class GroupMap;
26 class TreeMap;
27 class SAbundVector;
28
29 class GlobalData {
30 public:
31         static GlobalData* getInstance();
32         ListVector* getListVector();
33         SparseMatrix* getSparseMatrix();
34         InputData* ginput;
35         OrderVector* gorder;
36         ListVector* glist;
37         vector<Tree*> gTree;
38         SharedListVector* gSharedList;
39         SAbundVector* sabund;
40         GroupMap* gGroupmap;
41         TreeMap* gTreemap;
42         string inputFileName, helpRequest, commandName;
43         bool allLines;
44         vector<string>  Estimators, Groups; //holds estimators to be used
45         set<int> lines; //hold lines to be used
46         set<string> labels; //holds labels to be used
47         
48         string getPhylipFile();
49         string getColumnFile();
50         string getListFile();
51         string getRabundFile();
52         string getSabundFile();
53         string getNameFile();
54         string getGroupFile();
55         string getOrderFile();
56         string getFastaFile();
57         string getTreeFile();
58         string getSharedFile();
59         string getCutOff();
60         string getFormat();
61         string getPrecision();
62         string getMethod();
63         string getFileRoot();
64         string getIters();
65         string getJumble();
66         string getFreq();
67         string getAbund();
68         string getRandomTree();
69
70         void setListFile(string);
71         void setPhylipFile(string);
72         void setColumnFile(string);
73         void setNameFile(string);
74         void setRabundFile(string);
75         void setSabundFile(string);
76         void setFormat(string);
77         void setRandomTree(string);
78         void setCalc(string);
79
80         
81         void setListVector(ListVector*);
82         void setSparseMatrix(SparseMatrix*);
83         void clear(); 
84         void clearLabels();
85         void clearAbund();
86         
87         void parseGlobalData(string, string);
88                 
89 private:
90         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, sharedfile, line, label, randomtree, groups;
91         string cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund;
92
93         static GlobalData* _uniqueInstance;
94         GlobalData( const GlobalData& ); // Disable copy constructor
95         void operator=( const GlobalData& ); // Disable assignment operator
96         GlobalData();
97         ~GlobalData();
98         ListVector* gListVector;
99         SparseMatrix* gSparseMatrix;
100         void reset();   //clears all non filename parameters
101         
102         
103         
104 };
105
106 #endif