1 #ifndef COMMANDFACTORY_HPP
\r
2 #define COMMANDFACTORY_HPP
\r
8 * Created by Pat Schloss on 10/25/08.
\r
9 * Copyright 2008 Patrick D. Schloss. All rights reserved.
\r
14 #include "mothurout.h"
\r
15 #include "currentfile.h"
\r
19 class CommandFactory {
\r
21 static CommandFactory* getInstance();
\r
22 Command* getCommand(string, string, string);
\r
23 Command* getCommand(string, string);
\r
24 Command* getCommand(string);
\r
25 //Command* getCommand();
\r
26 bool isValidCommand(string);
\r
27 bool isValidCommand(string, string);
\r
28 void printCommands(ostream&);
\r
29 void printCommandsCategories(ostream&);
\r
30 void setOutputDirectory(string o) { outputDir = o; m->setOutputDir(o); }
\r
31 void setInputDirectory(string i) { inputDir = i; }
\r
32 void setLogfileName(string n, bool a) { logFileName = n; append = a; }
\r
33 string getLogfileName() { return logFileName; }
\r
34 bool getAppend() { return append; }
\r
35 string getOutputDir() { return outputDir; }
\r
36 bool MPIEnabled(string);
\r
37 map<string, string> getListCommands() { return commands; }
\r
41 Command* shellcommand;
\r
42 Command* pipecommand;
\r
45 CurrentFile* currentFile;
\r
47 map<string, string> commands;
\r
48 map<string, string>::iterator it;
\r
49 string outputDir, inputDir, logFileName;
\r
52 int checkForRedirects(string);
\r
54 static CommandFactory* _uniqueInstance;
\r
55 CommandFactory( const CommandFactory& ); // Disable copy constructor
\r
56 void operator=( const CommandFactory& ); // Disable assignment operator
\r