libgpiod
Loading...
Searching...
No Matches
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
18namespace gpiod {
19
20class chip;
21
25class chip_info final
26{
27public:
28
33 chip_info(const chip_info& other);
34
39 chip_info(chip_info&& other) noexcept;
40
42
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
75private:
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__ */
Represents an immutable snapshot of GPIO chip information.
Definition chip-info.hpp:26
::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=(const chip_info &other)
Assignment operator.
chip_info(chip_info &&other) noexcept
Move constructor.
chip_info & operator=(chip_info &&other) noexcept
Move 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:37
Definition chip-info.hpp:18