libgpiod
Loading...
Searching...
No Matches
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
18namespace gpiod {
19
23class GPIOD_CXX_API chip_closed final : public ::std::logic_error
24{
25public:
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
60};
61
65class GPIOD_CXX_API request_released final : public ::std::logic_error
66{
67public:
68
73 explicit request_released(const ::std::string& what);
74
79 request_released(const request_released& other) noexcept;
80
86
93
100
102};
103
108class GPIOD_CXX_API bad_mapping final : public ::std::runtime_error
109{
110public:
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
143
145};
146
147} /* namespace gpiod */
148
149#endif /* __LIBGPIOD_CXX_EXCEPTION_HPP__ */
Exception thrown when the core C library returns an invalid value for any of the line_info properties...
Definition exception.hpp:109
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:24
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:66
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.
Definition chip-info.hpp:18