提交 911765bacde3bf5cfd7c21e8259f6fb5e67e2d05

作者 LJH 李佳桓
1 个父辈 f26a55a4

add

正在显示 1 个修改的文件 包含 52 行增加0 行删除
  1 +/**************************************************************************
  2 +* file: dmpserviceregistry.h
  3 +
  4 +* Author: wanzhongping
  5 +* Date: 2020-12-31 17:16:25
  6 +* Email: zhongpingw@chinadci.com
  7 +* copyright: 广州城市信息研究所有限公司
  8 +***************************************************************************/
  9 +
  10 +#ifndef __dmpserviceregistry_h__
  11 +#define __dmpserviceregistry_h__
  12 +
  13 +#include <iostream>
  14 +#include <string>
  15 +#include <map>
  16 +#include <memory>
  17 +
  18 +#include "dmpservicenativeloader.h"
  19 +
  20 +
  21 +class DmpService;
  22 +class SERVER_EXPORT DmpServiceRegistry
  23 +{
  24 +
  25 + public:
  26 +
  27 + DmpServiceRegistry() = default;
  28 +
  29 + ~DmpServiceRegistry();
  30 +
  31 + void RegisterService(std::shared_ptr<DmpService> service);
  32 +
  33 + int UnregisterService(const std::string &name, const std::string &version = std::string());
  34 +
  35 + std::shared_ptr<DmpService> GetService(const std::string &name, const std::string &version);
  36 +
  37 + void Init( const boost::filesystem::path &module_path);
  38 +
  39 + void CleanUp();
  40 +
  41 + private:
  42 + typedef std::map<std::string, std::shared_ptr<DmpService> > ServiceMap;
  43 + typedef std::map<std::string, std::pair<std::string, std::string> > VersionMap;
  44 +
  45 + DmpServiceNativeLoader nativeLoader_;
  46 + ServiceMap services_;
  47 + VersionMap serviceVersions_;
  48 +
  49 +};
  50 +
  51 +
  52 +#endif // __dmpserviceregistry_h__
... ...
注册登录 后发表评论