libgpiod  2.1.3
chip-info.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /* SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl> */
3 
8 #ifndef __LIBGPIOD_CXX_CHIP_INFO_HPP__
9 #define __LIBGPIOD_CXX_CHIP_INFO_HPP__
10 
11 #if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12 #error "Only gpiod.hpp can be included directly."
13 #endif
14 
15 #include <memory>
16 #include <ostream>
17 
18 namespace gpiod {
19 
20 class chip;
21 
30 class chip_info final
31 {
32 public:
33 
38  chip_info(const chip_info& other);
39 
44  chip_info(chip_info&& other) noexcept;
45 
46  ~chip_info();
47 
53  chip_info& operator=(const chip_info& other);
54 
60  chip_info& operator=(chip_info&& other) noexcept;
61 
66  ::std::string name() const noexcept;
67 
72  ::std::string label() const noexcept;
73 
78  ::std::size_t num_lines() const noexcept;
79 
80 private:
81 
82  chip_info();
83 
84  struct impl;
85 
86  ::std::shared_ptr<impl> _m_priv;
87 
88  friend chip;
89 };
90 
97 ::std::ostream& operator<<(::std::ostream& out, const chip_info& chip);
98 
103 } /* namespace gpiod */
104 
105 #endif /* __LIBGPIOD_CXX_CHIP_INFO_HPP__ */
Represents an immutable snapshot of GPIO chip information.
Definition: chip-info.hpp:31
::std::size_t num_lines() const noexcept
Return the number of lines exposed by this chip.
::std::string label() const noexcept
Get the label of this GPIO chip.
chip_info & operator=(chip_info &&other) noexcept
Move assignment operator.
chip_info(chip_info &&other) noexcept
Move constructor.
chip_info & operator=(const chip_info &other)
Assignment operator.
chip_info(const chip_info &other)
Copy constructor.
::std::string name() const noexcept
Get the name of this GPIO chip.
Represents a GPIO chip.
Definition: chip.hpp:42