Skip to content

Add a MAX_SERIALIZED_SIZE constant for message types #84

@T-Bakker

Description

@T-Bakker

Hi,

I am using embedded proto to encode a payload of mostly booleans, enum and a couple integer fields into a fixed size transmission buffer. I want to static_assert that the generated protobuf types will fit in that buffer and avoid that a certain set of values may cause a serialization error due to the buffer being too small.

However, I do cannot find such a constant as Field::serialized_size() const is not constexpr (as it actually takes the current values into account). I therefore would like to have a uint32_t MAX_SERIALIZED_SIZE constant added if possible.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions