Skip to main content

ReadSource Class

Lightweight handle for reading messages from a TypeIndexedDoubleBuffer. More...

Declaration

class helios::core::buffer::TypeIndexedDoubleBuffer::ReadSource { ... }

Public Constructors Index

ReadSource (TypeIndexedDoubleBuffer &db) noexcept

Constructs a ReadSource from a TypeIndexedDoubleBuffer reference. More...

Public Member Functions Index

template <typename E>
auto read () const noexcept -> std::span< const E >

Returns a read-only view of messages of type E. More...

Private Member Attributes Index

TypeIndexedDoubleBuffer *db_ = nullptr

Non-owning pointer to the parent buffer. More...

Description

Lightweight handle for reading messages from a TypeIndexedDoubleBuffer.

ReadSource provides a focused interface for message consumers that only need read access. It holds a non-owning pointer to a TypeIndexedDoubleBuffer and exposes only the read() operation.

This class is useful for dependency injection where systems should be able to consume messages without having access to buffer management operations.

Definition at line 266 of file TypeIndexedDoubleBuffer.ixx.

Public Constructors

ReadSource()

helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::ReadSource::ReadSource (TypeIndexedDoubleBuffer & db)
inline explicit noexcept

Constructs a ReadSource from a TypeIndexedDoubleBuffer reference.

Parameters
db

The buffer to read from. Must remain valid for the lifetime of this source.

Definition at line 280 of file TypeIndexedDoubleBuffer.ixx.

280 explicit ReadSource(TypeIndexedDoubleBuffer& db) noexcept : db_(&db) {}

Reference helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::TypeIndexedDoubleBuffer.

Public Member Functions

read()

template <typename E>
std::span< const E > helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::ReadSource::read ()
inline noexcept

Returns a read-only view of messages of type E.

Template Parameters
E

The message type to read.

Returns

A span over all messages of type E in the read buffer.

Definition at line 290 of file TypeIndexedDoubleBuffer.ixx.

290 std::span<const E> read() const noexcept {
291 return db_->template read<E>();
292 }

Reference helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::ReadSource::read.

Referenced by helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::ReadSource::read.

Private Member Attributes

db_

TypeIndexedDoubleBuffer* helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::ReadSource::db_ = nullptr

Non-owning pointer to the parent buffer.

Definition at line 271 of file TypeIndexedDoubleBuffer.ixx.

271 TypeIndexedDoubleBuffer* db_ = nullptr;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.