eis/dsm/dsm.cc

33 lines
903 B
C++
Raw Normal View History

#include <dsm/dsm.h>
#include <dsm/dsm_icei.h>
#include <glob/GlobDefine.h>
#include <utility/IniProperty.h>
#include <memory>
#include <string>
#include "mix_cc/debug/pre_define.h"
using namespace baosight;
dsm::dsm() { logger_ = std::make_unique<LOG>("dsm"); }
dsm::~dsm() { logger_->Info() << "-------dsm::end-------" << std::endl; }
int dsm::start() {
logger_->Info() << "-------dsm::start-------" << std::endl;
con_mag_ = std::make_shared<ConnectionMag>();
con_mag_->dbLogin();
try {
auto module_name = name();
dsm_server = new dsmICEI();
this->add(string("baosight/") + name(), dsm_server);
} catch (::Ice::LocalException& e) {
logger_->Error() << "Can not add baosight/dsm, error: " << e << endl;
return (-1);
}
return 0;
}
// PACE_SERVER_INSTALL(dsm) //应用程序主入口,传入参数为定义的类名
PACE_PLATFORM_SERVER_INSTALL(dsm, APPVERSION);