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

Field proto. More...

#include <types.h>

Public Member Functions

 Field (std::string name, T &value)
 Constructor for a field, a form of data to be sent to the debug board.
const std::string & get_name () const
 Gets the name of the field.
const T & get_value () const
 Gets the value currently stored by the field.
const TypeId get_type () const
 Gets the type of the field in the form of a TypeId enum.
VDP::Packet serialize_schema () const
 Serializes the field's schema in the form of a VDP::Packet.
VDP::Packet serialize_data () const
 Serializes the field's data in the form of a VDP::Packet.
size_t apply_update (const VDP::PacketSpan packet_in)
 Deserializes a packet's data and applies it to the field.
std::string data_to_string (std::size_t depth=0) const
 Gets the field's data as a string.
std::string schema_to_string (std::size_t depth=0) const
 Gets the field's schema as a string.

Detailed Description

template<typename T>
class VDP::Field< T >

Field proto.

A field is a named value that can be serialized and sent to the debug board.

Constructor & Destructor Documentation

◆ Field()

template<typename T>
VDP::Field< T >::Field ( std::string name,
T & value )
inline

Constructor for a field, a form of data to be sent to the debug board.

Parameters
namename for the Field
valuevalue for the Field to hold; its C++ type determines the VDP Type

Member Function Documentation

◆ apply_update()

template<typename T>
size_t VDP::Field< T >::apply_update ( const VDP::PacketSpan packet_in)
inline

Deserializes a packet's data and applies it to the field.

Returns
the number of bytes read in the packet

◆ serialize_data()

template<typename T>
VDP::Packet VDP::Field< T >::serialize_data ( ) const
inline

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

Returns
the serialized data

◆ serialize_schema()

template<typename T>
VDP::Packet VDP::Field< T >::serialize_schema ( ) const
inline

Serializes the field's schema in the form of a VDP::Packet.

Returns
the serialized schema

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