eis/eqpm/eqpm.cc

33 lines
921 B
C++
Raw Normal View History

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