#include "mothur.h"
-
-using namespace std;
+#include "globaldata.hpp"
+#include "commandoptionparser.hpp"
+#include "command.hpp"
+#include "commandfactory.hpp"
class GlobalData;
class Engine {
public:
- virtual ~Engine(){};
+ Engine() { cFactory = new CommandFactory(); }
+ virtual ~Engine(){ delete cFactory; }
virtual bool getInput() = 0;
-// string getCommand() { return command; }
+ virtual string getCommand();
vector<string> getOptions() { return options; }
+ virtual void terminateCommand(int);
protected:
-// string command;
vector<string> options;
+ CommandFactory* cFactory;
};
class BatchEngine : public Engine {
public:
- BatchEngine(string);
+ BatchEngine(string, string);
~BatchEngine();
virtual bool getInput();
int openedBatch;
class InteractEngine : public Engine {
public:
- InteractEngine();
+ InteractEngine(string);
~InteractEngine();
virtual bool getInput();
private:
};
+class ScriptEngine : public Engine {
+public:
+ ScriptEngine(string, string);
+ ~ScriptEngine();
+ virtual bool getInput();
+ int openedBatch;
+private:
+ GlobalData* globaldata;
+ string listOfCommands;
+ string getNextCommand(string&);
+
+};
+
+
#endif