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