Skip to main content

WriteSink Class

Lightweight handle for pushing messages to a TypeIndexedDoubleBuffer. More...

Declaration

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

Public Constructors Index

WriteSink (TypeIndexedDoubleBuffer &db) noexcept

Constructs a WriteSink from a TypeIndexedDoubleBuffer reference. More...

Public Member Functions Index

template <typename E, typename... Args>
voidpush (Args &&... args) noexcept

Constructs and pushes a message of type E to the buffer. More...

Private Member Attributes Index

TypeIndexedDoubleBuffer *db_ = nullptr

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

Description

Lightweight handle for pushing messages to a TypeIndexedDoubleBuffer.

WriteSink provides a focused interface for message producers that only need write access. It holds a non-owning pointer to a TypeIndexedDoubleBuffer and exposes only the push() operation.

This class is useful for dependency injection where systems should be able to publish messages without having access to buffer management operations like swapBuffers() or clearReadBuffers().

Definition at line 225 of file TypeIndexedDoubleBuffer.ixx.

Public Constructors

WriteSink()

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

Constructs a WriteSink from a TypeIndexedDoubleBuffer reference.

Parameters
db

The buffer to write to. Must remain valid for the lifetime of this sink.

Definition at line 239 of file TypeIndexedDoubleBuffer.ixx.

239 explicit WriteSink(TypeIndexedDoubleBuffer& db) noexcept : db_(&db) {}

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

Public Member Functions

push()

template <typename E, typename... Args>
void helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::WriteSink::push (Args &&... args)
inline noexcept

Constructs and pushes a message of type E to the buffer.

Template Parameters
E

The message type.

Args

Constructor argument types for E.

Parameters
args

Arguments forwarded to E's constructor.

Definition at line 250 of file TypeIndexedDoubleBuffer.ixx.

250 void push(Args&&... args) noexcept {
251 db_->template push <E>(std::forward<Args>(args)...);
252 }

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

Referenced by helios::core::buffer::TypeIndexedDoubleBuffer< Indexer >::WriteSink::push.

Private Member Attributes

db_

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

Non-owning pointer to the parent buffer.

Definition at line 230 of file TypeIndexedDoubleBuffer.ixx.

230 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.