Skip to content

Extend C++ API to support receive with retain of resuable samples #16

@MarkSchmitt

Description

@MarkSchmitt

As discussed in the Rust API workshop https://github.com/orgs/eclipse-score/discussions/1076 the C++ API needs to be extended to support the following receive mechanism:

  • If there are less than max_samples in the communication buffer, the method will reuse samples contained in the provided sample container, beginning from the last, going backwards.

  • If the input container is empty on call, it will exclusively be filled with new samples.

  • If the input container contains more samples than max_samples before the call, it will contain max_samples samples, potentially removing samples from the container, even if no new samples were added.

Returns the updated buffer and the number of newly added samples. All new samples are added to the back of the buffer, with the last sample being the newest. If less than max_samples could be added to the buffer, the samples that had been inside the buffer are retained, with the first samples getting removed as new samples are added to the back of the buffer.

This also depends on #13 to sort samples in the container

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    No status

    Status

    No status

    Status

    No status

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions