libgpiod  2.1
exception.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later */
2 /* SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl> */
3 
8 #ifndef __LIBGPIOD_CXX_EXCEPTION_HPP__
9 #define __LIBGPIOD_CXX_EXCEPTION_HPP__
10 
11 #if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12 #error "Only gpiod.hpp can be included directly."
13 #endif
14 
15 #include <stdexcept>
16 #include <string>
17 
18 namespace gpiod {
19 
28 class GPIOD_CXX_API chip_closed final : public ::std::logic_error
29 {
30 public:
31 
36  explicit chip_closed(const ::std::string& what);
37 
42  chip_closed(const chip_closed& other) noexcept;
43 
48  chip_closed(chip_closed&& other) noexcept;
49 
55  chip_closed& operator=(const chip_closed& other) noexcept;
56 
62  chip_closed& operator=(chip_closed&& other) noexcept;
63 
64  ~chip_closed();
65 };
66 
70 class GPIOD_CXX_API request_released final : public ::std::logic_error
71 {
72 public:
73 
78  explicit request_released(const ::std::string& what);
79 
84  request_released(const request_released& other) noexcept;
85 
90  request_released(request_released&& other) noexcept;
91 
97  request_released& operator=(const request_released& other) noexcept;
98 
104  request_released& operator=(request_released&& other) noexcept;
105 
106  ~request_released();
107 };
108 
113 class GPIOD_CXX_API bad_mapping final : public ::std::runtime_error
114 {
115 public:
116 
121  explicit bad_mapping(const ::std::string& what);
122 
127  bad_mapping(const bad_mapping& other) noexcept;
128 
133  bad_mapping(bad_mapping&& other) noexcept;
134 
140  bad_mapping& operator=(const bad_mapping& other) noexcept;
141 
147  bad_mapping& operator=(bad_mapping&& other) noexcept;
148 
149  ~bad_mapping();
150 };
151 
156 } /* namespace gpiod */
157 
158 #endif /* __LIBGPIOD_CXX_EXCEPTION_HPP__ */
Exception thrown when an already released line request is used.
Definition: exception.hpp:70
Exception thrown when the core C library returns an invalid value for any of the line_info properties...
Definition: exception.hpp:113
Exception thrown when an already closed chip is used.
Definition: exception.hpp:28