]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
working on pam
[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 "commandoptionparser.hpp"
17 #include "command.hpp"
18 #include "commandfactory.hpp"
19 #include "mothurout.h"
20
21 class Engine {
22 public:
23         Engine(); 
24         virtual ~Engine(){}
25         virtual bool getInput() = 0;
26         virtual string getCommand();
27         virtual string getOutputDir()                   {       return cFactory->getOutputDir();        }
28         virtual string getLogFileName()                 {       return cFactory->getLogfileName();      }
29         virtual bool getAppend()                                {       return cFactory->getAppend();           }
30
31         vector<string> getOptions()             {       return options;         }
32 protected:
33         vector<string> options;
34         CommandFactory* cFactory;
35         MothurOut* mout;
36 };
37
38
39
40 class BatchEngine : public Engine {
41 public:
42         BatchEngine(string, string);
43         ~BatchEngine();
44         virtual bool getInput();
45         int openedBatch;
46 private:
47         ifstream inputBatchFile;
48         string getNextCommand(ifstream&);
49
50 };
51
52
53
54 class InteractEngine : public Engine {
55 public:
56         InteractEngine(string);
57         ~InteractEngine();
58         virtual bool getInput();
59 private:
60         
61 };
62
63
64 class ScriptEngine : public Engine {
65 public:
66         ScriptEngine(string, string);
67         ~ScriptEngine();
68         virtual bool getInput();
69         int openedBatch;
70 private:
71         string listOfCommands;
72         string getNextCommand(string&);
73
74 };
75
76
77 #endif