WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Struct.hpp File Reference
#include <stdint.h>
#include <concepts>
#include <memory>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>
#include <fmt/format.h>
#include "wpi/util/Endian.hpp"
#include "wpi/util/array.hpp"
#include "wpi/util/bit.hpp"
#include "wpi/util/ct_string.hpp"
#include "wpi/util/function_ref.hpp"
#include "wpi/util/mutex.hpp"
#include "wpi/util/type_traits.hpp"

Go to the source code of this file.

Classes

struct  wpi::util::Struct< T, I >
 Struct serialization template. More...
class  wpi::util::StructArrayBuffer< T, I >
struct  wpi::util::Struct< std::array< T, N >, I... >
 Raw struct support for fixed-size arrays of other structs. More...
struct  wpi::util::Struct< bool >
 Raw struct support for boolean values. More...
struct  wpi::util::Struct< uint8_t >
 Raw struct support for uint8_t values. More...
struct  wpi::util::Struct< int8_t >
 Raw struct support for int8_t values. More...
struct  wpi::util::Struct< uint16_t >
 Raw struct support for uint16_t values. More...
struct  wpi::util::Struct< int16_t >
 Raw struct support for int16_t values. More...
struct  wpi::util::Struct< uint32_t >
 Raw struct support for uint32_t values. More...
struct  wpi::util::Struct< int32_t >
 Raw struct support for int32_t values. More...
struct  wpi::util::Struct< uint64_t >
 Raw struct support for uint64_t values. More...
struct  wpi::util::Struct< int64_t >
 Raw struct support for int64_t values. More...
struct  wpi::util::Struct< float >
 Raw struct support for float values. More...
struct  wpi::util::Struct< double >
 Raw struct support for double values. More...

Namespaces

namespace  wpi
namespace  wpi::util

Concepts

concept  wpi::util::StructSerializable
 Specifies that a type is capable of raw struct serialization and deserialization.
concept  wpi::util::MutableStructSerializable
 Specifies that a type is capable of in-place raw struct deserialization.
concept  wpi::util::HasNestedStruct
 Specifies that a struct type has nested struct declarations.

Functions

template<typename T, typename... I>
requires StructSerializable<T, I...>
wpi::util::UnpackStruct (std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct.
template<typename T, size_t Offset, typename... I>
requires StructSerializable<T, I...>
wpi::util::UnpackStruct (std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct starting at a given offset within the data.
template<StructSerializable T, size_t Offset, size_t N>
wpi::util::array< T, N > wpi::util::UnpackStructArray (std::span< const uint8_t > data)
 Unpack a serialized struct array starting at a given offset within the data.
template<typename T, typename... I>
requires StructSerializable<T, I...>
void wpi::util::PackStruct (std::span< uint8_t > data, T &&value, const I &... info)
 Pack a serialized struct.
template<size_t Offset, typename T, typename... I>
requires StructSerializable<T, I...>
void wpi::util::PackStruct (std::span< uint8_t > data, T &&value, const I &... info)
 Pack a serialized struct starting at a given offset within the data.
template<size_t Offset, size_t N, StructSerializable T>
void wpi::util::PackStructArray (std::span< uint8_t > data, const wpi::util::array< T, N > &arr)
 Pack a serialized struct array starting at a given offset within the data.
template<typename T, typename... I>
requires StructSerializable<T, I...>
void wpi::util::UnpackStructInto (T *out, std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct into an existing object, overwriting its contents.
template<size_t Offset, typename T, typename... I>
requires StructSerializable<T, I...>
void wpi::util::UnpackStructInto (T *out, std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct into an existing object, overwriting its contents, and starting at a given offset within the data.
template<typename T, typename... I>
requires StructSerializable<T, I...>
constexpr auto wpi::util::GetStructTypeName (const I &... info)
 Get the type name for a raw struct serializable type.
template<typename T, typename... I>
requires StructSerializable<T, I...>
constexpr auto wpi::util::GetStructTypeString (const I &... info)
 Get the type string for a raw struct serializable type.
template<typename T, typename... I>
requires StructSerializable<T, I...>
constexpr size_t wpi::util::GetStructSize (const I &... info)
 Get the size for a raw struct serializable type.
template<typename T, size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto wpi::util::MakeStructArrayTypeName (const I &... info)
template<typename T, size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto wpi::util::MakeStructArrayTypeString (const I &... info)
template<typename T, size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto wpi::util::MakeStructArraySchema (const I &... info)
template<typename T, typename... I>
requires StructSerializable<T, I...>
constexpr std::string_view wpi::util::GetStructSchema (const I &... info)
template<typename T, typename... I>
requires StructSerializable<T, I...>
constexpr std::span< const uint8_t > wpi::util::GetStructSchemaBytes (const I &... info)
template<typename T, typename... I>
requires StructSerializable<T, I...>
void wpi::util::ForEachStructSchema (std::invocable< std::string_view, std::string_view > auto fn, const I &... info)