]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
created mothurOut class to handle logfiles
[mothur.git] / engine.hpp
1 #ifndef ENGINE_HPP
2 #define ENGINE_HPP
3
4 /*
5  *  engine.hpp
6  *  
7  *
8  *  Created by Pat Schloss on 8/15/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  */
12  
13
14
15 #include "mothur.h"
16 #include "globaldata.hpp"
17 #include "commandoptionparser.hpp"
18 #include "command.hpp"
19 #include "commandfactory.hpp"
20 #include "mothurout.h"
21
22 class GlobalData;
23
24 class Engine {
25 public:
26         Engine(); 
27         virtual ~Engine(){}
28         virtual bool getInput() = 0;
29         virtual string getCommand();
30         virtual string getOutputDir()   {       return cFactory->getOutputDir();  }
31         vector<string> getOptions()             {       return options;         }
32 protected:
33         vector<string> options;
34         CommandFactory* cFactory;
35         MothurOut* mout;
36 };
37
38
39
40 class BatchEngine : public Engine {
41 public:
42         BatchEngine(string, string);
43         ~BatchEngine();
44         virtual bool getInput();
45         int openedBatch;
46 private:
47         GlobalData* globaldata;
48         ifstream inputBatchFile;
49
50 };
51
52
53
54 class InteractEngine : public Engine {
55 public:
56         InteractEngine(string);
57         ~InteractEngine();
58         virtual bool getInput();
59 private:
60         GlobalData* globaldata;
61 };
62
63
64 class ScriptEngine : public Engine {
65 public:
66         ScriptEngine(string, string);
67         ~ScriptEngine();
68         virtual bool getInput();
69         int openedBatch;
70 private:
71         GlobalData* globaldata;
72         string listOfCommands;
73         string getNextCommand(string&);
74
75 };
76
77
78 #endif