ChimeraTK-DeviceAccess  03.18.00
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 
9 namespace 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
ChimeraTK::DeviceFile::DeviceFile
DeviceFile()=delete
ChimeraTK::DeviceFile::goodState
bool goodState() const
Definition: DeviceFile.cc:50
ChimeraTK::DeviceFile::name
std::string name() const
Definition: DeviceFile.cc:46
ChimeraTK::DeviceFile
Definition: DeviceFile.h:12
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::DeviceFile::~DeviceFile
virtual ~DeviceFile()
Definition: DeviceFile.cc:28