6 /***********************************************************************/
12 virtual ~FileOutput(){};
14 virtual void initFile(string) = 0;
15 virtual void initFile(string, vector<string>) = 0;
16 virtual void output(int, vector<double>) = 0;
17 virtual void output(vector<double>) = 0;
18 virtual void resetFile() = 0;
19 virtual string getFileName() = 0;
26 /***********************************************************************/
28 class ThreeColumnFile : public FileOutput {
31 ThreeColumnFile(string n) : FileOutput(), inName(n), counter(0), outName(getPathName(n) + ".temp") { };
33 void initFile(string);
34 void output(int, vector<double>);
36 string getFileName() { return inName; };
38 void initFile(string, vector<string>){};
39 void output(vector<double>) {};
50 /***********************************************************************/
51 class OneColumnFile : public FileOutput {
55 OneColumnFile(string n) : inName(n), counter(0), outName(getPathName(n) + ".temp") {};
57 void output(int, vector<double>);
58 void initFile(string);
60 string getFileName() { return inName; };
62 void initFile(string, vector<string>) {};
63 void output(vector<double>) {};
74 /***********************************************************************/
75 class SharedOneColumnFile : public FileOutput {
79 SharedOneColumnFile(string n) : inName(n), counter(0), outName(getPathName(n) + ".temp") {};
80 ~SharedOneColumnFile();
81 void output(int, vector<double>);
82 void initFile(string);
84 string getFileName() { return inName; };
86 void initFile(string, vector<string>) {};
87 void output(vector<double>) {};
99 /***********************************************************************/
101 class SharedThreeColumnFile : public FileOutput {
104 SharedThreeColumnFile(string n, string groups) : FileOutput(), groupLabel(groups), inName(n), counter(0), numGroup(1), outName(getPathName(n) + ".temp") { };
105 ~SharedThreeColumnFile();
106 void initFile(string);
107 void output(int, vector<double>);
109 string getFileName() { return inName; };
112 void initFile(string, vector<string>) {};
113 void output(vector<double>) {};
116 string inName, groupLabel;
120 int counter, numGroup;
123 /***********************************************************************/
124 //used by parsimony, unifrac.weighted and unifrac.unweighted
125 class ColumnFile : public FileOutput {
128 ColumnFile(string n, string i) : FileOutput(), iters(i), inName(n), counter(0), outName(getPathName(n) + ".temp") {};
131 //to make compatible with parent class
132 void output(int, vector<double>){};
133 void initFile(string){};
135 void initFile(string, vector<string>);
136 void output(vector<double>);
138 string getFileName() { return inName; };