peary/device/DeviceManager.hpp

Peary Device Manager Class. More…

Namespaces

Name
peary
peary::device

Classes

Name
class peary::device::DeviceManager Peary Device Manager.

Detailed Description

Peary Device Manager Class.

Copyright: Copyright (c) 2016-2025 CERN and the Peary Caribou authors. This software is distributed under the terms of the LGPL-3.0-only License, copied verbatim in the file “LICENSE.md”. SPDX-License-Identifier: LGPL-3.0-only

Source code

  
#pragma once

#include <cstdint>
#include <string>
#include <string_view>
#include <vector>

#include "Device.hpp"

namespace peary::device {

    class DeviceManager {

    public:
        DeviceManager();

        ~DeviceManager();

        bool hasDevice(std::string_view name) const;

        Device* getDevice(size_t id);

        Device* getDevice(std::string_view name);

        std::vector<std::pair<std::string, Device*>> getDevices();

        size_t addDevice(std::string_view name, std::string_view type, const config::Configuration& config);

        void clearDevices();

    private:
        std::map<std::string, void*> _deviceLibraries;

        std::vector<std::pair<std::string, Device*>> _deviceList;

    }; // class DeviceManager

} // namespace peary::device
  

Updated on 2026-01-30 at 22:01:05 +0100