mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现策略配置功能
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "Communicator.h"
|
||||
#include "CommEntity.h"
|
||||
#include "TcpEntity.h"
|
||||
|
||||
std::shared_ptr<CommEntity> Communicator::createEntity(Fields& data)
|
||||
std::shared_ptr<CommEntity> CommEntity::create(Fields& data)
|
||||
{
|
||||
std::string commType = data.value("commType");
|
||||
std::string ip = data.value("ip");
|
||||
@@ -11,6 +11,8 @@ public:
|
||||
CommEntity() {}
|
||||
CommEntity(std::string type) : type(type) {}
|
||||
|
||||
static std::shared_ptr<CommEntity> create(Fields& data);
|
||||
|
||||
void setType(std::string type) { this->type = type; }
|
||||
|
||||
// 启动通讯连接
|
||||
@@ -30,10 +32,3 @@ public:
|
||||
bool isCloseRequest_ = false;
|
||||
std::string type;
|
||||
};
|
||||
|
||||
|
||||
class Communicator
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<CommEntity> createEntity(Fields& data);
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
#include "Communicator.h"
|
||||
#include "CommEntity.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user