1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-23 00:00:01 +01:00
VILLASnode/common/include/villas/kernel/devices/ip_device.hpp
Pascal Bauer 22a5f54428 add from_directory method
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2025-01-28 17:49:54 +01:00

39 lines
994 B
C++

/* Linux/Unix device which represents an IP component of a FPGA.
*
* Author: Pascal Bauer <pascal.bauer@rwth-aachen.de>
*
* SPDX-FileCopyrightText: 2023-2024 Pascal Bauer <pascal.bauer@rwth-aachen.de>
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <filesystem>
#include <villas/kernel/devices/platform_device.hpp>
namespace villas {
namespace kernel {
namespace devices {
class IpDevice : public PlatformDevice {
public:
static IpDevice from(const std::filesystem::path unsafe_path);
static bool is_path_valid(const std::filesystem::path unsafe_path);
private:
IpDevice() = delete;
IpDevice(
const std::filesystem::path valid_path) //! Dont allow unvalidated paths
: PlatformDevice(valid_path){};
public:
size_t addr() const;
std::string ip_name() const;
static std::vector<villas::kernel::devices::IpDevice>
from_directory(std::filesystem::path devices_directory);
};
} // namespace devices
} // namespace kernel
} // namespace villas