]> git.donarmstrong.com Git - mothur.git/blob - commandfactory.hpp
update .gitignore
[mothur.git] / commandfactory.hpp
1 #ifndef COMMANDFACTORY_HPP\r
2 #define COMMANDFACTORY_HPP\r
3 \r
4 /*\r
5  *  commandfactory.h\r
6  *  \r
7  *\r
8  *  Created by Pat Schloss on 10/25/08.\r
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.\r
10  *\r
11  */\r
12 \r
13 #include "mothur.h"\r
14 #include "mothurout.h"\r
15 #include "currentfile.h"\r
16 \r
17 class Command;\r
18 \r
19 class CommandFactory {\r
20 public:\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)               {       if(m->dirCheck(o) || (o == "")) {  outputDir = o; m->setOutputDir(o); } }\r
31         void setInputDirectory(string i)                {       if(m->dirCheck(i) || (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     string getInputDir()                                        {       return inputDir;                }\r
37         bool MPIEnabled(string);\r
38         map<string, string> getListCommands()   {       return commands;                }\r
39         \r
40 private:\r
41         Command* command;\r
42         Command* shellcommand;\r
43         Command* pipecommand;\r
44         \r
45         MothurOut* m;\r
46         CurrentFile* currentFile;\r
47         \r
48         map<string, string> commands;\r
49         map<string, string>::iterator it;\r
50         string outputDir, inputDir, logFileName;\r
51         bool append;\r
52         \r
53     int checkForRedirects(string);\r
54     \r
55         static CommandFactory* _uniqueInstance;\r
56         CommandFactory( const CommandFactory& ); // Disable copy constructor\r
57         void operator=( const CommandFactory& ); // Disable assignment operator\r
58         CommandFactory();\r
59         ~CommandFactory();\r
60 \r
61 };\r
62 \r
63 #endif\r