X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=engine.hpp;h=460e245bf5312d81f5b15d70387cf9ec63d472f6;hb=a0f1fca79d2ddfa7ad36b4485039c68b5704fe8d;hp=c04cd4ed69306116f7eb72e64bf5fd2e01d92015;hpb=bfbc55964f1977da72c2cea984288a427d370a59;p=mothur.git diff --git a/engine.hpp b/engine.hpp index c04cd4e..460e245 100644 --- a/engine.hpp +++ b/engine.hpp @@ -13,33 +13,39 @@ #include "mothur.h" - -using namespace std; - -class GlobalData; +#include "commandoptionparser.hpp" +#include "command.hpp" +#include "commandfactory.hpp" +#include "mothurout.h" class Engine { public: - virtual ~Engine(){}; + Engine(); + virtual ~Engine(){} virtual bool getInput() = 0; -// string getCommand() { return command; } - vector getOptions() { return options; } + virtual string getCommand(); + virtual string getOutputDir() { return cFactory->getOutputDir(); } + virtual string getLogFileName() { return cFactory->getLogfileName(); } + virtual bool getAppend() { return cFactory->getAppend(); } + + vector getOptions() { return options; } protected: -// string command; vector options; + CommandFactory* cFactory; + MothurOut* mout; }; class BatchEngine : public Engine { public: - BatchEngine(string); + BatchEngine(string, string); ~BatchEngine(); virtual bool getInput(); int openedBatch; private: - GlobalData* globaldata; ifstream inputBatchFile; + string getNextCommand(ifstream&); }; @@ -47,11 +53,24 @@ private: class InteractEngine : public Engine { public: - InteractEngine(); + InteractEngine(string); ~InteractEngine(); virtual bool getInput(); private: - GlobalData* globaldata; + +}; + + +class ScriptEngine : public Engine { +public: + ScriptEngine(string, string); + ~ScriptEngine(); + virtual bool getInput(); + int openedBatch; +private: + string listOfCommands; + string getNextCommand(string&); + };