summaryrefslogtreecommitdiff
path: root/project2/console/consoleAppEngine.h
blob: b40ef8aa467634dc0477bf3138415a51c8460111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef CGIAPPENGINE_H
#define CGIAPPENGINE_H

#include "../appEngine.h"
#include "../task.h"
#include "../paramChecker.h"
#include "../presenter.h"
#include <boost/intrusive_ptr.hpp>
#include <boost/filesystem/path.hpp>
#include <libxml++/document.h>
#include <libxml++/parsers/domparser.h>

class ConsoleEnvironment;

class ConsoleApplicationEngine : public ApplicationEngine {
	public:
		ConsoleApplicationEngine(const ConsoleEnvironment *, const boost::filesystem::path &);
		virtual ~ConsoleApplicationEngine();

		void process() const;
		const Environment * env() const;
		SessionPtr session() const;
		PresenterPtr getPresenter(const std::string & group, const std::string & id) const;
	protected:
		const ConsoleEnvironment * _env;
	private:
		class ConsolePresenter : public Presenter {
			public:
				ConsolePresenter(const ConsoleApplicationEngine *, const std::string & id);
				ConsolePresenter(const ConsoleApplicationEngine *, const std::string & group, const std::string & id);
				virtual ~ConsolePresenter();
			protected:
				XmlDocumentPtr getDataDocument() const;
		};
		OrderedParamCheckers parameterChecks;
		NoOutputExecutes tasks;
		SessionPtr runtime;
};

#endif