libgpiod  2.1.3
request-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_REQUEST_CONFIG_HPP__
9 #define __LIBGPIOD_CXX_REQUEST_CONFIG_HPP__
10 
11 #if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12 #error "Only gpiod.hpp can be included directly."
13 #endif
14 
15 #include <cstddef>
16 #include <iostream>
17 #include <memory>
18 #include <string>
19 
20 #include "line.hpp"
21 
22 namespace gpiod {
23 
24 class chip;
25 
35 class request_config final
36 {
37 public:
38 
43 
44  request_config(const request_config& other) = delete;
45 
50  request_config(request_config&& other) noexcept;
51 
52  ~request_config();
53 
60 
66  request_config& set_consumer(const ::std::string& consumer) noexcept;
67 
72  ::std::string consumer() const noexcept;
73 
82 
87  ::std::size_t event_buffer_size() const noexcept;
88 
89 private:
90 
91  struct impl;
92 
93  ::std::shared_ptr<impl> _m_priv;
94 
95  request_config& operator=(const request_config& other);
96 
97  friend request_builder;
98 };
99 
106 ::std::ostream& operator<<(::std::ostream& out, const request_config& config);
107 
112 } /* namespace gpiod */
113 
114 #endif /* __LIBGPIOD_CXX_REQUEST_CONFIG_HPP__ */
Intermediate object storing the configuration for a line request.
Stores a set of options passed to the kernel when making a line request.
request_config & operator=(request_config &&other) noexcept
Move assignment operator.
::std::string consumer() const noexcept
Get the consumer name.
request_config()
Constructor.
request_config(request_config &&other) noexcept
Move constructor.
request_config & set_event_buffer_size(::std::size_t event_buffer_size) noexcept
Set the size of the kernel event buffer.
request_config & set_consumer(const ::std::string &consumer) noexcept
Set the consumer name.
::std::size_t event_buffer_size() const noexcept
Get the edge event buffer size from this request config.