1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef DATACLOUD_DEVICE_FACTORY_H
- #define DATACLOUD_DEVICE_FACTORY_H
- #include "device_base.hpp"
- #include "rslidar/rslidar_driver.h"
- class DeviceFactory {
- public:
- enum LIDAR_DEVICE_TYPE {
- LIDAR_RSLIDAR = 0,
- LIDAR_WANJI
- };
- public:
- static LidarDevice* createLidar(LIDAR_DEVICE_TYPE type) {
- return getLidar(type);
- }
- protected:
- DeviceFactory() {};
- virtual ~DeviceFactory() {};
- private:
- static LidarDevice* getLidar(LIDAR_DEVICE_TYPE &type) {
- LidarDevice* device = nullptr;
- switch (type)
- {
- case LIDAR_RSLIDAR:
- device = new RS_lidar_device;
- break;
-
- default:
- break;
- }
- device->init();
- return device;
- }
- };
- #endif
|