提交 541413313f0e7aa6cd63ab91a4e7f8c12eafe5c1

作者 LJH 李佳桓
1 个父辈 df76ec95

add

正在显示 1 个修改的文件 包含 65 行增加0 行删除
  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 &registry) 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)
... ...
注册登录 后发表评论