ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
DeviceFile.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#pragma once
4
5#include <boost/core/noncopyable.hpp>
6
7#include <string>
8
9namespace ChimeraTK {
10
11 // Simple RAII wrapper for a device file
12 class DeviceFile : private boost::noncopyable {
13 private:
14 std::string _strerror(const std::string& msg) const;
15 const std::string _path;
16 int _fd;
17
18 public:
19 DeviceFile() = delete;
20 DeviceFile(const std::string& filePath, int flags);
22 virtual ~DeviceFile();
23
24 operator int() const;
25 std::string name() const;
26 bool goodState() const;
27 };
28
29} // namespace ChimeraTK
bool goodState() const
Definition DeviceFile.cc:52
std::string name() const
Definition DeviceFile.cc:48