libgpiod
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 
25 class chip_info final
26 {
27 public:
28 
33  chip_info(const chip_info& other);
34 
39  chip_info(chip_info&& other) noexcept;
40 
41  ~chip_info();
42 
48  chip_info& operator=(const chip_info& other);
49 
55  chip_info& operator=(chip_info&& other) noexcept;
56 
61  ::std::string name() const noexcept;
62 
67  ::std::string label() const noexcept;
68 
73  ::std::size_t num_lines() const noexcept;
74 
75 private:
76 
77  chip_info();
78 
79  struct impl;
80 
81  ::std::shared_ptr<impl> _m_priv;
82 
83  friend chip;
84 };
85 
92 ::std::ostream& operator<<(::std::ostream& out, const chip_info& chip);
93 
94 } /* namespace gpiod */
95 
96 #endif /* __LIBGPIOD_CXX_CHIP_INFO_HPP__ */
Definition: chip-info.hpp:18
Represents an immutable snapshot of GPIO chip information.
Definition: chip-info.hpp:25
::std::ostream & operator<<(::std::ostream &out, const chip_info &chip)
Stream insertion operator for GPIO chip objects.
chip_info & operator=(const chip_info &other)
Assignment operator.
::std::size_t num_lines() const noexcept
Return the number of lines exposed by this chip.
Represents a GPIO chip.
Definition: chip.hpp:36
::std::string label() const noexcept
Get the label of this GPIO chip.
::std::string name() const noexcept
Get the name of this GPIO chip.