Loading...
Searching...
No Matches
info-event.hpp
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl> */
#ifndef __LIBGPIOD_CXX_INFO_EVENT_HPP__
#define __LIBGPIOD_CXX_INFO_EVENT_HPP__
#if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
#error "Only gpiod.hpp can be included directly."
#endif
#include <cstdint>
#include <iostream>
#include <memory>
#include "timestamp.hpp"
namespace gpiod {
class chip;
class line_info;
class info_event final
{
public:
enum class event_type
{
LINE_REQUESTED = 1,
LINE_RELEASED,
LINE_CONFIG_CHANGED,
};
info_event(const info_event& other);
info_event(info_event&& other) noexcept;
~info_event();
info_event& operator=(const info_event& other);
info_event& operator=(info_event&& other) noexcept;
event_type type() const;
::std::uint64_t timestamp_ns() const noexcept;
const line_info& get_line_info() const noexcept;
private:
info_event();
struct impl;
::std::shared_ptr<impl> _m_priv;
friend chip;
};
::std::ostream& operator<<(::std::ostream& out, const info_event& event);
} /* namespace gpiod */
#endif /* __LIBGPIOD_CXX_INFO_EVENT_HPP__ */
gpiod::chip
Represents a GPIO chip.
Definition chip.hpp:37
gpiod::info_event
Immutable object containing data about a single line info event.
Definition info-event.hpp:30
gpiod::info_event::operator=
info_event & operator=(const info_event &other)
Copy assignment operator.
gpiod::info_event::info_event
info_event(info_event &&other) noexcept
Move constructor.
gpiod::info_event::~info_event
~info_event()
gpiod::info_event::type
event_type type() const
Type of this event.
gpiod::info_event::operator=
info_event & operator=(info_event &&other) noexcept
Move assignment operator.
gpiod::info_event::get_line_info
const line_info & get_line_info() const noexcept
Get the new line information.
gpiod::info_event::info_event
info_event(const info_event &other)
Copy constructor.
gpiod::info_event::event_type
event_type
Types of info events.
Definition info-event.hpp:37
gpiod::info_event::event_type::LINE_REQUESTED
@ LINE_REQUESTED
Definition info-event.hpp:38
gpiod::info_event::event_type::LINE_RELEASED
@ LINE_RELEASED
Definition info-event.hpp:40
gpiod::info_event::event_type::LINE_CONFIG_CHANGED
@ LINE_CONFIG_CHANGED
Definition info-event.hpp:42
gpiod::info_event::timestamp_ns
::std::uint64_t timestamp_ns() const noexcept
Timestamp of the event as returned by the kernel.
gpiod::line_info
Contains an immutable snapshot of the line's state at the time when the object of this class was inst...
Definition line-info.hpp:30
gpiod
Definition chip-info.hpp:18
timestamp.hpp