Device Manager

std::shared_ptr<DeviceManager> xdaq::get_device_manager(const std::filesystem::path &path)

Loads a device manager from a shared library file.

Parameters:

path – Path to the shared library.

Returns:

std::shared_ptr<DeviceManager> Shared pointer to the loaded manager.

struct DeviceManager : public std::enable_shared_from_this<DeviceManager>

Interface for managing devices through dynamically loaded managers.

A device manager is a shared library that can be loaded at runtime to manage different types of devices.

Public Functions

std::unique_ptr<Device> manage_device(std::unique_ptr<Device> dev, const std::string &config_json)

Wrap a device created by the manager.

virtual std::string info() const noexcept = 0

Provides information about the manager in JSON format.

Returns:

std::string JSON string describing the manager.

virtual std::filesystem::path location() const = 0

Returns the file system path to the shared library containing the manager.

Returns:

std::filesystem::path Path to the manager’s shared library.

virtual std::string list_devices() const = 0

Lists available devices managed by the manager.

Returns:

std::string JSON string listing the available devices.

virtual std::string get_device_options() const noexcept = 0

Returns the JSON schema for device configuration options.

Returns:

std::string JSON schema for configuring devices.

virtual std::unique_ptr<Device> create_device(const std::string &config) = 0

Creates a device using the manager.

Parameters:

config – JSON string describing the device configuration.

Returns:

std::unique_ptr<Device> Unique pointer to the created device.