]> git.donarmstrong.com Git - mothur.git/blob - engine.hpp
added set.logfile command
[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 };
40
41
42
43 class BatchEngine : public Engine {
44 public:
45         BatchEngine(string, string);
46         ~BatchEngine();
47         virtual bool getInput();
48         int openedBatch;
49 private:
50         GlobalData* globaldata;
51         ifstream inputBatchFile;
52
53 };
54
55
56
57 class InteractEngine : public Engine {
58 public:
59         InteractEngine(string);
60         ~InteractEngine();
61         virtual bool getInput();
62 private:
63         GlobalData* globaldata;
64 };
65
66
67 class ScriptEngine : public Engine {
68 public:
69         ScriptEngine(string, string);
70         ~ScriptEngine();
71         virtual bool getInput();
72         int openedBatch;
73 private:
74         GlobalData* globaldata;
75         string listOfCommands;
76         string getNextCommand(string&);
77
78 };
79
80
81 #endif