//====================================================================================================== // Copyright 2016, NaturalPoint Inc. //====================================================================================================== #pragma once #include #include "AnalogSystemBuildConfig.h" namespace AnalogSystem { class IDevice; /// /// IDeviceFactory creates a specific instance of a device. /// class ANALOGSYSTEM_API IDeviceFactory { public: virtual ~IDeviceFactory() = default; ///Returns factory name virtual const char* Name() const = 0; ///Returns device instance name virtual const char* DeviceName() const = 0; ///Creates a new instance of the device. virtual std::unique_ptr Create() const = 0; }; /// /// Base implementation for a Plugin Device factory. /// See Plugin Device SDK for example implementation /// /// class ANALOGSYSTEM_API PluginDeviceFactory : public IDeviceFactory { public: PluginDeviceFactory( const char* deviceName ) { strcpy_s( mDeviceName, deviceName ); } PluginDeviceFactory( const PluginDeviceFactory& ) = delete; PluginDeviceFactory& operator=( const PluginDeviceFactory& ) = delete; virtual ~PluginDeviceFactory() = default; const char* DeviceName() const override { return mDeviceName; } private: char mDeviceName[255]; }; }