cmvr-es/include/device_manager/device_factory.h

44 lines
1.4 KiB
C
Raw Permalink Normal View History

//
// Created by xtkuang on 2025/5/13.
//
#ifndef CMVR_ES_DEVICE_FACTORY_H
#define CMVR_ES_DEVICE_FACTORY_H
#pragma once
#include "devices/abstract_agv.h"
#include "devices/abstract_battery.h"
#include "devices/abstract_camera.h"
#include "devices/abstract_dexhand.h"
#include "devices/abstract_gripper.h"
#include "devices/abstract_robot.h"
#include "devices/abstract_microphone.h"
#include "devices/abstract_speaker.h"
#include "devices/abstract_biohead.h"
namespace cmvr::device {
class DeviceFactory {
public:
DeviceFactory() = default;
template <typename DeviceType>
std::shared_ptr<DeviceType> create(const XmlNode& cfg);
private:
std::shared_ptr<AbstractAGV> create_agv_(const XmlNode& cfg);
std::shared_ptr<AbstractBattery> create_battery_(const XmlNode& cfg);
std::shared_ptr<AbstractCamera> create_camera_(const XmlNode& cfg);
std::shared_ptr<AbstractDexHand> create_dexhand_(const XmlNode& cfg);
std::shared_ptr<AbstractGripper> create_gripper_(const XmlNode& cfg);
std::shared_ptr<AbstractMicrophone> create_mic_(const XmlNode& cfg);
std::shared_ptr<AbstractRobot> create_robot_(const XmlNode& cfg);
std::shared_ptr<AbstractSpeaker> create_speaker_(const XmlNode& cfg);
std::shared_ptr<AbstractBiohead> create_biohead_(const XmlNode& cfg);
2025-11-10 16:54:06 +08:00
};
}
#endif //CMVR_ES_DEVICE_FACTORY_H