GPIO edge event buffer
-
class edge_event_buffer
Object into which edge events are read for better performance.
The edge_event_buffer allows reading edge_event objects into an existing buffer which improves the performance by avoiding needless memory allocations.
Public Types
-
using const_iterator = ::std::vector<edge_event>::const_iterator
Constant iterator for iterating over edge events stored in the buffer.
Public Functions
-
explicit edge_event_buffer(::std::size_t capacity = 64)
Constructor. Creates a new edge event buffer with given capacity.
- Parameters:
capacity – Capacity of the new buffer.
-
edge_event_buffer(edge_event_buffer &&other) noexcept
Move constructor.
- Parameters:
other – Object to move.
-
edge_event_buffer &operator=(edge_event_buffer &&other) noexcept
Move assignment operator.
- Parameters:
other – Object to move.
- Returns:
Reference to self.
-
const edge_event &get_event(unsigned int index) const
Get the constant reference to the edge event at given index.
- Parameters:
index – Index of the event in the buffer.
- Returns:
Constant reference to the edge event.
-
::std::size_t num_events() const
Get the number of edge events currently stored in the buffer.
- Returns:
Number of edge events in the buffer.
-
::std::size_t capacity() const noexcept
Maximum capacity of the buffer.
- Returns:
Buffer capacity.
-
const_iterator begin() const noexcept
Get a constant iterator to the first edge event currently stored in the buffer.
- Returns:
Constant iterator to the first element.
-
const_iterator end() const noexcept
Get a constant iterator to the element after the last edge event in the buffer.
- Returns:
Constant iterator to the element after the last edge event.
-
using const_iterator = ::std::vector<edge_event>::const_iterator