]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
modified sequence class to read fasta files with comments. this required modification...
[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 //      string getCommand()                     {       return command;         }
29         vector<string> getOptions() {   return options;         }
30         virtual void terminateCommand(int);
31 protected:
32 //      string command;
33         vector<string> options;
34         CommandFactory* cFactory;
35 };
36
37
38
39 class BatchEngine : public Engine {
40 public:
41         BatchEngine(string, string);
42         ~BatchEngine();
43         virtual bool getInput();
44         int openedBatch;
45 private:
46         GlobalData* globaldata;
47         ifstream inputBatchFile;
48
49 };
50
51
52
53 class InteractEngine : public Engine {
54 public:
55         InteractEngine(string);
56         ~InteractEngine();
57         virtual bool getInput();
58 private:
59         GlobalData* globaldata;
60         vector<string> previousInputs; //this is used to make the arrow keys work
61         
62 };
63
64
65 class ScriptEngine : public Engine {
66 public:
67         ScriptEngine(string, string);
68         ~ScriptEngine();
69         virtual bool getInput();
70         int openedBatch;
71 private:
72         GlobalData* globaldata;
73         string listOfCommands;
74         string getNextCommand(string&);
75
76 };
77
78
79 #endif