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
18namespace gpiod {
19
28class GPIOD_CXX_API chip_closed final : public ::std::logic_error
29{
30public:
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
65};
66
70class GPIOD_CXX_API request_released final : public ::std::logic_error
71{
72public:
73
78 explicit request_released(const ::std::string& what);
79
84 request_released(const request_released& other) noexcept;
85
91
98
105
107};
108
113class GPIOD_CXX_API bad_mapping final : public ::std::runtime_error
114{
115public:
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
148
149 ~bad_mapping();
150};
151
156} /* namespace gpiod */
157
158#endif /* __LIBGPIOD_CXX_EXCEPTION_HPP__ */
Exception thrown when the core C library returns an invalid value for any of the line_info properties...
bad_mapping(const bad_mapping &other) noexcept
Copy constructor.
bad_mapping & operator=(const bad_mapping &other) noexcept
Assignment operator.
bad_mapping(const ::std::string &what)
Constructor.
bad_mapping & operator=(bad_mapping &&other) noexcept
Move assignment operator.
bad_mapping(bad_mapping &&other) noexcept
Move constructor.
Exception thrown when an already closed chip is used.
Definition exception.hpp:29
chip_closed & operator=(const chip_closed &other) noexcept
Assignment operator.
chip_closed & operator=(chip_closed &&other) noexcept
Move assignment operator.
chip_closed(const chip_closed &other) noexcept
Copy constructor.
chip_closed(chip_closed &&other) noexcept
Move constructor.
chip_closed(const ::std::string &what)
Constructor.
Exception thrown when an already released line request is used.
Definition exception.hpp:71
request_released(const ::std::string &what)
Constructor.
request_released(const request_released &other) noexcept
Copy constructor.
request_released & operator=(const request_released &other) noexcept
Assignment operator.
request_released(request_released &&other) noexcept
Move constructor.
request_released & operator=(request_released &&other) noexcept
Move assignment operator.