libgpiod 2.1.3
line-config.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_LINE_CONFIG_HPP__
9#define __LIBGPIOD_CXX_LINE_CONFIG_HPP__
10
11#if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12#error "Only gpiod.hpp can be included directly."
13#endif
14
15#include <map>
16#include <memory>
17
18namespace gpiod {
19
20class chip;
21class line_request;
22class line_settings;
23
33class line_config final
34{
35public:
36
37
39
40 line_config(const line_config& other) = delete;
41
46 line_config(line_config&& other) noexcept;
47
49
55 line_config& operator=(line_config&& other) noexcept;
56
61 line_config& reset() noexcept;
62
69 line_config& add_line_settings(line::offset offset, const line_settings& settings);
70
77 line_config& add_line_settings(const line::offsets& offsets, const line_settings& settings);
78
84 line_config& set_output_values(const line::values& values);
85
92 ::std::map<line::offset, line_settings> get_line_settings() const;
93
94private:
95
96 struct impl;
97
98 ::std::shared_ptr<impl> _m_priv;
99
100 line_config& operator=(const line_config& other);
101
102 friend line_request;
103 friend request_builder;
104};
105
112::std::ostream& operator<<(::std::ostream& out, const line_config& config);
113
118} /* namespace gpiod */
119
120#endif /* __LIBGPIOD_CXX_LINE_CONFIG_HPP__ */
Contains a set of line config options used in line requests and reconfiguration.
line_config(line_config &&other) noexcept
Move constructor.
line_config & reset() noexcept
Reset the line config object.
::std::map< line::offset, line_settings > get_line_settings() const
Get a mapping of offsets to line settings stored by this object.
line_config & add_line_settings(line::offset offset, const line_settings &settings)
Add line settings for a single offset.
line_config & operator=(line_config &&other) noexcept
Move assignment operator.
line_config & set_output_values(const line::values &values)
Set output values for a number of lines.
Stores the context of a set of requested GPIO lines.
Stores GPIO line settings.
Intermediate object storing the configuration for a line request.