WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Protobuf.hpp File Reference
#include <stdint.h>
#include <concepts>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "pb.h"
#include "pb_decode.h"
#include "pb_encode.h"
#include "wpi/util/array.hpp"
#include "wpi/util/function_ref.hpp"

Go to the source code of this file.

Classes

struct  wpi::util::Protobuf< T >
 Protobuf serialization template. More...
class  wpi::util::ProtoInputStream< T >
 Class for wrapping a nanopb istream. More...
class  wpi::util::ProtoOutputStream< T >
 Class for wrapping a nanopb ostream. More...
class  wpi::util::ProtobufMessage< T >
 Ease of use wrapper to make nanopb streams more opaque to the user. More...

Namespaces

namespace  wpi
namespace  wpi::util
namespace  wpi::util::detail
 These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi::util:all_of, wpi::util::none_of, etc.

Concepts

concept  wpi::util::ProtobufSerializable
 Specifies that a type is capable of protobuf serialization and deserialization.
concept  wpi::util::MutableProtobufSerializable
 Specifies that a type is capable of in-place protobuf deserialization.

Typedefs

using wpi::util::detail::SmallVectorType = wpi::util::SmallVectorImpl<uint8_t>
using wpi::util::detail::StdVectorType = std::vector<uint8_t>

Functions

bool wpi::util::detail::WriteFromSmallVector (pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
bool wpi::util::detail::WriteFromStdVector (pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
bool wpi::util::detail::WriteSubmessage (pb_ostream_t *stream, const pb_msgdesc_t *desc, const void *msg)
std::string wpi::util::detail::GetTypeString (const pb_msgdesc_t *msg)
void wpi::util::detail::ForEachProtobufDescriptor (const pb_msgdesc_t *msg, function_ref< bool(std::string_view filename)> wants, function_ref< void(std::string_view filename, std::span< const uint8_t > descriptor)> fn)