Class CBufferPayloadWriter

Inheritance Relationships

Base Type

Class Documentation

class CBufferPayloadWriter : public eCAL::CPayloadWriter

Payload writer class that wraps a classic (void*, size_t) interface.

This class is a payload writer that wraps a classic interface using void* and size_t arguments. It inherits from the base class CPayloadWriter, allowing zero-copy memory operations.

Public Functions

inline CBufferPayloadWriter(const void *const buffer_, size_t size_)

Constructor for CBufferPayloadWriter.

Parameters:
  • buffer_ – Pointer to the buffer containing the data to be written.

  • size_ – Size of the data to be written.

inline virtual bool WriteFull(void *buffer_, size_t size_) override

Make a dump memory copy of the stored buffer.

This function performs a dump memory copy of the stored buffer to the provided memory location (buffer_) with the specified size (size_). The size of the provided memory buffer should be equal to or greater than the stored buffer size to avoid memory corruption.

Parameters:
  • buffer_ – Pointer to the target buffer where the data will be copied.

  • size_ – Size of the target buffer.

Returns:

True if the copy operation is successful, false otherwise.

inline virtual size_t GetSize() override

Get the size of the memory that needs to be copied.

This function returns the size of the memory buffer that needs to be copied during the write operation. It is used by the base class CPayloadWriter to allocate the required memory for eCAL.

Returns:

The size of the memory that needs to be copied.