DeviceHandlerFactory.cpp 761 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "stdafx.h"
  2. #include "DeviceHandlerFactory.h"
  3. #include "CollimatorHandler.h"
  4. using namespace DIOS::Dev::Detail::MachineryECOM;
  5. DeviceHandlerFactory *DeviceHandlerFactory::m_instance = nullptr;
  6. DeviceHandlerFactory::DeviceHandlerFactory()
  7. {
  8. }
  9. DeviceHandlerFactory::~DeviceHandlerFactory()
  10. {
  11. }
  12. DeviceHandlerFactory *DeviceHandlerFactory::Instance()
  13. {
  14. if (m_instance == nullptr)
  15. {
  16. m_instance = new DeviceHandlerFactory();
  17. }
  18. return m_instance;
  19. }
  20. IDeviceHandler *DeviceHandlerFactory::CreateDeviceHandler(DEVICE_HANDLER_TYPE type)
  21. {
  22. IDeviceHandler *ret = nullptr;
  23. switch (type)
  24. {
  25. case DEVICE_HANDLER_TYPE_COLLIMATOR:
  26. ret = new CollimatorHandler();
  27. break;
  28. default:
  29. break;
  30. }
  31. return ret;
  32. }