#include "stdafx.h" #include "CommunicateEntityFactory.h" #include "DIOSBoardCommunicateEntity.h" using namespace DIOS::Dev::Detail::MachineryECOM; CommunicateEntityFactory *CommunicateEntityFactory::m_instance = nullptr; CommunicateEntityFactory::CommunicateEntityFactory() { } CommunicateEntityFactory::~CommunicateEntityFactory() { } CommunicateEntityFactory *CommunicateEntityFactory::Instance() { if (m_instance == nullptr) { m_instance = new CommunicateEntityFactory(); } return m_instance; } ICommunicateEntity *CommunicateEntityFactory::CreateSingleton(const std::string &typeName) { if (m_communicates.find(typeName) == m_communicates.end()) { if (typeName == COMMUNICATE_ENTITY_DIOSBOARD) { m_communicates[typeName] = new DIOSBoardCommunicateEntity(); } } return m_communicates[typeName]; }