WPILibC++ 2024.1.1-beta-4
|
Specifies that a type is capable of protobuf serialization and deserialization. More...
#include <wpi/protobuf/Protobuf.h>
Specifies that a type is capable of protobuf serialization and deserialization.
This is designed for serializing complex flexible data structures using code generated from a .proto file. Serialization consists of writing values into a mutable protobuf Message and deserialization consists of reading values from an immutable protobuf Message.
Implementations must define a template specialization for wpi::Protobuf with T being the type that is being serialized/deserialized, with the following static members (as enforced by this concept):
To avoid pulling in the protobuf headers, these functions use google::protobuf::Message instead of a more specific type; implementations will need to static_cast to the correct type as created by New().
Additionally: In a static block, call StructRegistry.registerClass() to register the class