]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
fixed catchall PATH variable bug added trimera to chimera.slayer
[mothur.git] / engine.hpp
1 #ifndef ENGINE_HPP
2 #define ENGINE_HPP
3
4 /*
5  *  engine.hpp
6  *  
7  *
8  *  Created by Pat Schloss on 8/15/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  */
12  
13
14
15 #include "mothur.h"
16 #include "globaldata.hpp"
17 #include "commandoptionparser.hpp"
18 #include "command.hpp"
19 #include "commandfactory.hpp"
20 #include "mothurout.h"
21
22 class GlobalData;
23
24 class Engine {
25 public:
26         Engine(); 
27         virtual ~Engine(){}
28         virtual bool getInput() = 0;
29         virtual string getCommand();
30         virtual string getOutputDir()                   {       return cFactory->getOutputDir();        }
31         virtual string getLogFileName()                 {       return cFactory->getLogfileName();      }
32         virtual bool getAppend()                                {       return cFactory->getAppend();           }
33
34         vector<string> getOptions()             {       return options;         }
35 protected:
36         vector<string> options;
37         CommandFactory* cFactory;
38         MothurOut* mout;
39         string findMothursPath();
40 };
41
42
43
44 class BatchEngine : public Engine {
45 public:
46         BatchEngine(string, string);
47         ~BatchEngine();
48         virtual bool getInput();
49         int openedBatch;
50 private:
51         GlobalData* globaldata;
52         ifstream inputBatchFile;
53         string getNextCommand(ifstream&);
54
55 };
56
57
58
59 class InteractEngine : public Engine {
60 public:
61         InteractEngine(string);
62         ~InteractEngine();
63         virtual bool getInput();
64 private:
65         GlobalData* globaldata;
66 };
67
68
69 class ScriptEngine : public Engine {
70 public:
71         ScriptEngine(string, string);
72         ~ScriptEngine();
73         virtual bool getInput();
74         int openedBatch;
75 private:
76         GlobalData* globaldata;
77         string listOfCommands;
78         string getNextCommand(string&);
79
80 };
81
82
83 #endif