正在显示
1 个修改的文件
包含
65 行增加
和
0 行删除
src/server/services/wms/dmpwms.cpp
0 → 100644
1 | +/************************************************************************** | ||
2 | +* file: dmpwms.cpp | ||
3 | + | ||
4 | +* Author: wanzhongping | ||
5 | +* Date: 2021-01-29 09:00:53 | ||
6 | +* Email: zhongpingw@chinadci.com | ||
7 | +* copyright: 广州城市信息研究所有限公司 | ||
8 | +***************************************************************************/ | ||
9 | + | ||
10 | +#include <string> | ||
11 | +#include "dmpmodule.h" | ||
12 | +#include <boost/dll/alias.hpp> // for BOOST_DLL_ALIAS | ||
13 | +#include <boost/filesystem.hpp> | ||
14 | +#include <boost/function.hpp> | ||
15 | +#include <boost/make_shared.hpp> | ||
16 | +using namespace std; | ||
17 | + | ||
18 | +namespace DmpWms | ||
19 | +{ | ||
20 | + class Service : public DmpService | ||
21 | + { | ||
22 | + public: | ||
23 | + Service() { | ||
24 | + std::cout << "Constructing WmsService" << std::endl; | ||
25 | + } | ||
26 | + | ||
27 | + ~Service() { | ||
28 | + std::cout << "Destructing WmsService" << std::endl; | ||
29 | + } | ||
30 | + | ||
31 | + string Name() const override { return string("WMS"); } | ||
32 | + string Version() const override { return string("1.0.0"); } | ||
33 | + | ||
34 | + bool AllowMethod() const override | ||
35 | + { | ||
36 | + return true; | ||
37 | + } | ||
38 | + | ||
39 | + void ExecuteRequest(const DmpServerRequest &request, DmpServerResponse &response) override | ||
40 | + { | ||
41 | + std::string url = request.url(); | ||
42 | + | ||
43 | + response.Write("hello, wms"); | ||
44 | + } | ||
45 | + | ||
46 | + }; | ||
47 | + | ||
48 | + | ||
49 | + class DmpWmsModule : public DmpServiceModule | ||
50 | + { | ||
51 | + public: | ||
52 | + | ||
53 | + void RegisterSelf(DmpServiceRegistry ®istry) override | ||
54 | + { | ||
55 | + cout<<"WMSModule::registerSelf called" <<endl; | ||
56 | + registry.RegisterService(make_shared<DmpWms::Service>()); | ||
57 | + } | ||
58 | + }; | ||
59 | + | ||
60 | + shared_ptr<DmpServiceModule> Create() | ||
61 | + { | ||
62 | + return make_shared<DmpWmsModule>(); | ||
63 | + } | ||
64 | +} | ||
65 | +BOOST_DLL_ALIAS(DmpWms::Create, service_module) |
请
注册
或
登录
后发表评论