Skip to content

Allow initializing a HarpMessage object from Span<T> #106

@glopesdev

Description

@glopesdev

It is currently not possible to specify a conversion from an existing struct to a Harp message object without allocating an intermediate payload buffer. The following overloads would remove this need by directly working with Span<byte> objects, which can be created from any value type.

Proposed overloads:

HarpMessage FromPayload(int address, MessageType messageType, PayloadType payloadType, Span<byte> payload)

HarpMessage FromPayload(int address, int port, MessageType messageType, PayloadType payloadType, Span<byte> payload)

HarpMessage FromPayload(int address, double timestamp, MessageType messageType, PayloadType payloadType, Span<byte> payload)

HarpMessage FromPayload(int address, int port, double timestamp, MessageType messageType, PayloadType payloadType, Span<byte> payload)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew planned feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions