]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
d3f156e533a6a759bab014250dd1d54ad1726c7b
[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
21 class GlobalData;
22
23 class Engine {
24 public:
25         Engine(); 
26         virtual ~Engine(){}
27         virtual bool getInput() = 0;
28         virtual string getCommand();
29         vector<string> getOptions() {   return options;         }
30 protected:
31         vector<string> options;
32         CommandFactory* cFactory;
33 };
34
35
36
37 class BatchEngine : public Engine {
38 public:
39         BatchEngine(string, string);
40         ~BatchEngine();
41         virtual bool getInput();
42         int openedBatch;
43 private:
44         GlobalData* globaldata;
45         ifstream inputBatchFile;
46
47 };
48
49
50
51 class InteractEngine : public Engine {
52 public:
53         InteractEngine(string);
54         ~InteractEngine();
55         virtual bool getInput();
56 private:
57         GlobalData* globaldata;
58 };
59
60
61 class ScriptEngine : public Engine {
62 public:
63         ScriptEngine(string, string);
64         ~ScriptEngine();
65         virtual bool getInput();
66         int openedBatch;
67 private:
68         GlobalData* globaldata;
69         string listOfCommands;
70         string getNextCommand(string&);
71
72 };
73
74
75 #endif