Loading...
Searching...
No Matches
edge-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_EDGE_EVENT_HPP__
#define __LIBGPIOD_CXX_EDGE_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 edge_event_buffer;
class edge_event final
{
public:
enum class event_type
{
RISING_EDGE = 1,
FALLING_EDGE,
};
edge_event(const edge_event& other);
edge_event(edge_event&& other) noexcept;
~edge_event();
edge_event& operator=(const edge_event& other);
edge_event& operator=(edge_event&& other) noexcept;
event_type type() const;
timestamp timestamp_ns() const noexcept;
line::offset line_offset() const noexcept;
unsigned long global_seqno() const noexcept;
unsigned long line_seqno() const noexcept;
private:
edge_event();
struct impl;
struct impl_managed;
struct impl_external;
::std::shared_ptr<impl> _m_priv;
friend edge_event_buffer;
};
::std::ostream& operator<<(::std::ostream& out, const edge_event& event);
} /* namespace gpiod */
#endif /* __LIBGPIOD_CXX_EDGE_EVENT_HPP__ */
gpiod::edge_event_buffer
Object into which edge events are read for better performance.
Definition edge-event-buffer.hpp:33
gpiod::edge_event
Immutable object containing data about a single edge event.
Definition edge-event.hpp:29
gpiod::edge_event::edge_event
edge_event(edge_event &&other) noexcept
Move constructor.
gpiod::edge_event::line_offset
line::offset line_offset() const noexcept
Read the offset of the line on which this event was registered.
gpiod::edge_event::line_seqno
unsigned long line_seqno() const noexcept
Get the event sequence number specific to the concerned line.
gpiod::edge_event::edge_event
edge_event(const edge_event &other)
Copy constructor.
gpiod::edge_event::event_type
event_type
Edge event types.
Definition edge-event.hpp:36
gpiod::edge_event::event_type::FALLING_EDGE
@ FALLING_EDGE
Definition edge-event.hpp:39
gpiod::edge_event::event_type::RISING_EDGE
@ RISING_EDGE
Definition edge-event.hpp:37
gpiod::edge_event::operator=
edge_event & operator=(edge_event &&other) noexcept
Move assignment operator.
gpiod::edge_event::type
event_type type() const
Retrieve the event type.
gpiod::edge_event::global_seqno
unsigned long global_seqno() const noexcept
Get the global sequence number of this event.
gpiod::edge_event::timestamp_ns
timestamp timestamp_ns() const noexcept
Retrieve the event time-stamp.
gpiod::edge_event::operator=
edge_event & operator=(const edge_event &other)
Copy assignment operator.
gpiod::edge_event::~edge_event
~edge_event()
gpiod::timestamp
Stores the edge and info event timestamps as returned by the kernel and allows to convert them to std...
Definition timestamp.hpp:25
gpiod::line
Namespace containing various type definitions for GPIO lines.
Definition line.hpp:24
gpiod
Definition chip-info.hpp:18
timestamp.hpp