WPILibC++ 2024.3.2
|
Owning wrapper (ala std::unique_ptr) for google::protobuf::Message* that does not require the protobuf headers be included. More...
#include <wpi/protobuf/Protobuf.h>
Public Member Functions | |
ProtobufMessage (google::protobuf::Arena *arena=nullptr) | |
~ProtobufMessage () | |
ProtobufMessage (const ProtobufMessage &)=delete | |
ProtobufMessage & | operator= (const ProtobufMessage &)=delete |
ProtobufMessage (ProtobufMessage &&rhs) | |
ProtobufMessage & | operator= (ProtobufMessage &&rhs) |
google::protobuf::Message * | GetMessage () |
Gets the stored message object. More... | |
const google::protobuf::Message * | GetMessage () const |
std::optional< T > | Unpack (std::span< const uint8_t > data) |
Unpacks from a byte array. More... | |
bool | UnpackInto (T *out, std::span< const uint8_t > data) |
Unpacks from a byte array into an existing object. More... | |
bool | Pack (wpi::SmallVectorImpl< uint8_t > &out, const T &value) |
Packs object into a SmallVector. More... | |
bool | Pack (std::vector< uint8_t > &out, const T &value) |
Packs object into a std::vector. More... | |
std::string | GetTypeString () const |
Gets the type string for the message. More... | |
void | ForEachProtobufDescriptor (function_ref< bool(std::string_view filename)> exists, function_ref< void(std::string_view filename, std::span< const uint8_t > descriptor)> fn) |
Loops over all protobuf descriptors including nested/referenced descriptors. More... | |
Owning wrapper (ala std::unique_ptr) for google::protobuf::Message* that does not require the protobuf headers be included.
Note this object is not thread safe; users of this object are required to provide any necessary thread safety.
T | serialized object type |
|
inlineexplicit |
|
inline |
|
delete |
|
inline |
|
inline |
Loops over all protobuf descriptors including nested/referenced descriptors.
exists | function that returns false if fn should be called for the given type string |
fn | function to call for each descriptor |
|
inline |
Gets the stored message object.
|
inline |
|
inline |
Gets the type string for the message.
|
delete |
|
inline |
|
inline |
Packs object into a std::vector.
[out] | out | output bytes |
[in] | value | value |
|
inline |
Packs object into a SmallVector.
[out] | out | output bytes |
[in] | value | value |
|
inline |
Unpacks from a byte array.
data | byte array |
|
inline |
Unpacks from a byte array into an existing object.
[out] | out | output object |
[in] | data | byte array |