Defined in File ecal_payload_writer.h
Base payload writer class to allow zero copy memory operations.
This class serves as the base class for payload writers, allowing zero-copy memory operations. The
WriteModifiedcalls may operate on the target memory file directly in zero-copy mode.
A partial writing / modification of the memory file is only possible when zero-copy mode is activated. If zero-copy is not enabled, the
WriteModifiedmethod is ignored and the
WriteFullmethod is always executed (see CPublisher::ShmEnableZeroCopy)
virtual bool WriteFull(void *buffer_, size_t size_) = 0#
Perform a full write operation on uninitialized memory.
This virtual function allows derived classes to perform a full write operation when the provisioned memory is uninitialized. Typically, this is the case when a memory file had to be recreated or its size had to be changed.
buffer_ – Pointer to the buffer containing the data to be written.
size_ – Size of the data to be written.
True if the write operation is successful, false otherwise.
inline virtual bool WriteModified(void *buffer_, size_t size_)#
Perform a partial write operation to modify existing data.
This virtual function allows derived classes to modify existing data when the provisioned memory is already initialized by a WriteFull call (i.e. contains the data from that full write operation).
The memory can be partially modified and does not have to be completely rewritten, which leads to significantly higher performance (lower latency).
If not implemented (by default), this operation will just call the
buffer_ – Pointer to the buffer containing the data to be modified.
size_ – Size of the data to be modified.
True if the write/update operation is successful, false otherwise.
virtual size_t GetSize() = 0#
Get the size of the required memory.
This virtual function allows derived classes to provide the size of the memory that eCAL needs to allocate.
The size of the required memory.
- virtual bool WriteFull(void *buffer_, size_t size_) = 0#