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