X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=commandfactory.hpp;h=36e8f462b146fc7846ee6cf9ead1eb42e9757a36;hp=e3eea41cd73e3583e57f5f2ce503233b54a02d55;hb=a8e2df1b96a57f5f29576b08361b86a96a8eff4f;hpb=0470f6d037aacb3563c3f7010708120a4a67d4e6 diff --git a/commandfactory.hpp b/commandfactory.hpp index e3eea41..36e8f46 100644 --- a/commandfactory.hpp +++ b/commandfactory.hpp @@ -1,27 +1,62 @@ -#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" - -class Command; - -class CommandFactory { -public: - CommandFactory(); - ~CommandFactory(); - Command* getCommand(string, string); -private: - Command* command; - -}; - -#endif +#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 printCommandsCategories(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