X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=commandfactory.hpp;fp=commandfactory.hpp;h=e95db8016a4149c9c2defdbb9e7933ff6ee3905a;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/commandfactory.hpp b/commandfactory.hpp new file mode 100644 index 0000000..e95db80 --- /dev/null +++ b/commandfactory.hpp @@ -0,0 +1,61 @@ +#ifndef COMMANDFACTORY_HPP +#define COMMANDFACTORY_HPP + +/* + * commandfactory.h + * + * + * Created by Pat Schloss on 10/25/08. + * Copyright 2008 Patrick D. Schloss. All rights reserved. + * + */ + +#include "mothur.h" +#include "mothurout.h" +#include "currentfile.h" + +class Command; + +class CommandFactory { +public: + static CommandFactory* getInstance(); + Command* getCommand(string, string, string); + Command* getCommand(string, string); + Command* getCommand(string); + //Command* getCommand(); + bool isValidCommand(string); + bool isValidCommand(string, string); + void printCommands(ostream&); + void setOutputDirectory(string o) { outputDir = o; m->setOutputDir(o); } + void setInputDirectory(string i) { inputDir = i; } + void setLogfileName(string n, bool a) { logFileName = n; append = a; } + string getLogfileName() { return logFileName; } + bool getAppend() { return append; } + string getOutputDir() { return outputDir; } + bool MPIEnabled(string); + map getListCommands() { return commands; } + +private: + Command* command; + Command* shellcommand; + Command* pipecommand; + + MothurOut* m; + CurrentFile* currentFile; + + map commands; + map::iterator it; + string outputDir, inputDir, logFileName; + bool append; + + int checkForRedirects(string); + + static CommandFactory* _uniqueInstance; + CommandFactory( const CommandFactory& ); // Disable copy constructor + void operator=( const CommandFactory& ); // Disable assignment operator + CommandFactory(); + ~CommandFactory(); + +}; + +#endif