libgpiod
exception.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-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 
23 class GPIOD_CXX_API chip_closed final : public ::std::logic_error
24 {
25 public:
26 
31  explicit chip_closed(const ::std::string& what);
32 
37  chip_closed(const chip_closed& other) noexcept;
38 
43  chip_closed(chip_closed&& other) noexcept;
44 
50  chip_closed& operator=(const chip_closed& other) noexcept;
51 
57  chip_closed& operator=(chip_closed&& other) noexcept;
58 
59  ~chip_closed();
60 };
61 
65 class GPIOD_CXX_API request_released final : public ::std::logic_error
66 {
67 public:
68 
73  explicit request_released(const ::std::string& what);
74 
79  request_released(const request_released& other) noexcept;
80 
85  request_released(request_released&& other) noexcept;
86 
92  request_released& operator=(const request_released& other) noexcept;
93 
99  request_released& operator=(request_released&& other) noexcept;
100 
101  ~request_released();
102 };
103 
108 class GPIOD_CXX_API bad_mapping final : public ::std::runtime_error
109 {
110 public:
111 
116  explicit bad_mapping(const ::std::string& what);
117 
122  bad_mapping(const bad_mapping& other) noexcept;
123 
128  bad_mapping(bad_mapping&& other) noexcept;
129 
135  bad_mapping& operator=(const bad_mapping& other) noexcept;
136 
142  bad_mapping& operator=(bad_mapping&& other) noexcept;
143 
144  ~bad_mapping();
145 };
146 
147 } /* namespace gpiod */
148 
149 #endif /* __LIBGPIOD_CXX_EXCEPTION_HPP__ */
Definition: chip-info.hpp:18
Exception thrown when an already released line request is used.
Definition: exception.hpp:65
Exception thrown when the core C library returns an invalid value for any of the line_info properties...
Definition: exception.hpp:108
Exception thrown when an already closed chip is used.
Definition: exception.hpp:23