#include "CommEntity.h" #include "TcpEntity.h" std::shared_ptr CommEntity::create(Fields& data) { std::string commType = data.value("commType"); std::string ip = data.value("ip"); int port = data.get("port"); int isclient = data.get("isclient"); if (commType == "TCP") { auto entity = std::make_shared(); entity->setHost(ip, port, isclient); return entity; } else if (commType == "MODBUS") { } else if (commType == "ACTIVEX") { } else if (commType == "SDK") { } return nullptr; }