RIT VEXU Core API
Loading...
Searching...
No Matches
VDP::Record< Fields > Class Template Reference

Record proto. More...

#include <types.h>

Public Member Functions

 Record (std::string name, Fields &... fields)
 Constructs a Record, a field that contains a tuple of other fields.
const std::string & get_name () const
 Gets the name of the record.
TypeId get_type () const
 Gets the TypeId of the record.
const auto & get_value () const
 Gets the value stored by the record.
template<std::size_t I>
const auto & get () const
 Gets the field at a specified index of the held tuple.
VDP::Packet serialize_schema () const
 Serializes the record's schema in the form of a VDP::Packet.
VDP::Packet serialize_data () const
 Serializes the record's data in the form of a VDP::Packet.
size_t apply_update (VDP::PacketSpan pac_in)
 Deserializes a packet of data and applies it to the Record's fields.
std::string data_to_string (std::size_t depth=0) const
 Converts a record's held data to a human readable string.
std::string schema_to_string (std::size_t depth=0) const
 converts a record's schema to a human readable string

Static Public Member Functions

static constexpr std::size_t size ()
 Getsthe size of the held tuple.

Detailed Description

template<typename... Fields>
class VDP::Record< Fields >

Record proto.

Defines a record A record owns a tuple of references to existing fields or records.

Constructor & Destructor Documentation

◆ Record()

template<typename... Fields>
VDP::Record< Fields >::Record ( std::string name,
Fields &... fields )
inlineexplicit

Constructs a Record, a field that contains a tuple of other fields.

Parameters
namethe name for the Record
Fieldsa list of fields for the record to hold

Member Function Documentation

◆ data_to_string()

template<typename... Fields>
std::string VDP::Record< Fields >::data_to_string ( std::size_t depth = 0) const
inline

Converts a record's held data to a human readable string.

Returns
a string representation of the record's held data

◆ schema_to_string()

template<typename... Fields>
std::string VDP::Record< Fields >::schema_to_string ( std::size_t depth = 0) const
inline

converts a record's schema to a human readable string

Returns
a string representation of the record's schema

◆ serialize_data()

template<typename... Fields>
VDP::Packet VDP::Record< Fields >::serialize_data ( ) const
inline

Serializes the record's data in the form of a VDP::Packet.

Returns
the serialized data

The documentation for this class was generated from the following file: