WPILibC++ 2024.3.2
|
Database of protobuf dynamic messages. More...
#include <wpi/protobuf/ProtobufMessageDatabase.h>
Public Member Functions | |
bool | Add (std::string_view filename, std::span< const uint8_t > data) |
Adds a file descriptor to the database. More... | |
google::protobuf::Message * | Find (std::string_view name) const |
Finds a message in the database by name. More... | |
google::protobuf::MessageFactory * | GetMessageFactory () |
Gets message factory. More... | |
Database of protobuf dynamic messages.
Unlike the protobuf descriptor pools and databases, this gracefully handles adding descriptors out of order and descriptors being replaced.
bool wpi::ProtobufMessageDatabase::Add | ( | std::string_view | filename, |
std::span< const uint8_t > | data | ||
) |
Adds a file descriptor to the database.
If the file references other files that have not yet been added, no messages in that file will be available until those files are added. Replaces any existing file with the same name.
filename | filename |
data | FileDescriptorProto serialized data |
google::protobuf::Message * wpi::ProtobufMessageDatabase::Find | ( | std::string_view | name | ) | const |
Finds a message in the database by name.
name | type name |
|
inline |
Gets message factory.