Voyant API 0.16.0
Loading...
Searching...
No Matches
VoyantFrameWrapper Class Reference

Wrapper for VoyantFrame messages. More...

#include <voyant_frame_wrapper.hpp>

Inheritance diagram for VoyantFrameWrapper:
CapnpWrapper< VoyantFrame >

Public Member Functions

 ~VoyantFrameWrapper () override
 Destructor.
void fromProto (VoyantFrame::Reader reader) override
 Update wrapper fields from a reader.
void toProto (VoyantFrame::Builder &builder) const override
 Write wrapper fields to a builder.
void debugString (std::ostream &os) const override
 Generate a debug string representation.
const VoyantHeaderWrapperheader () const
 Get the common header.
VoyantHeaderWrapperheaderMut ()
 Get mutable access to the common header.
const VoyantSdlConfigWrapperconfig () const
 Get the configuration.
VoyantSdlConfigWrapperconfigMut ()
 Get mutable access to the configuration.
const std::vector< PointDataWrapper > & points () const
 Get the vector of points.
std::vector< PointDataWrapper > & pointsMut ()
 Get mutable access to the vector of points.
void fromBuffer (const uint8_t *buffer, size_t size)
 Update wrapper fields from a serialized message buffer.
size_t toBuffer (uint8_t *buffer, size_t buffer_size) const
 Serialize this wrapper to a buffer using Cap'n Proto format.

Private Attributes

VoyantHeaderWrapper header_
 Common Voyant message header.
VoyantSdlConfigWrapper config_
 Configuration (may be empty in current implementation).
std::vector< PointDataWrapperpoints_
 Vector of point data.

Detailed Description

Wrapper for VoyantFrame messages.

Contains a complete frame of point data with a dynamic number of points, along with header information and configuration.

Constructor & Destructor Documentation

◆ ~VoyantFrameWrapper()

VoyantFrameWrapper::~VoyantFrameWrapper ( )
override

Destructor.

Member Function Documentation

◆ config()

const VoyantSdlConfigWrapper & VoyantFrameWrapper::config ( ) const
inline

Get the configuration.

Returns
Const reference to the configuration
Note
The configuration field may be empty in the current implementation

◆ configMut()

VoyantSdlConfigWrapper & VoyantFrameWrapper::configMut ( )
inline

Get mutable access to the configuration.

Returns
Reference to the configuration
Note
The configuration field may be empty in the current implementation

◆ debugString()

void VoyantFrameWrapper::debugString ( std::ostream & os) const
overridevirtual

Generate a debug string representation.

Parameters
osThe output stream to write to

Implements CapnpWrapper< VoyantFrame >.

◆ fromBuffer()

void CapnpWrapper< VoyantFrame >::fromBuffer ( const uint8_t * buffer,
size_t size )
inlineinherited

Update wrapper fields from a serialized message buffer.

Parameters
bufferPointer to the buffer containing serialized Cap'n Proto data
sizeSize of the buffer in bytes

◆ fromProto()

void VoyantFrameWrapper::fromProto ( VoyantFrame::Reader reader)
overridevirtual

Update wrapper fields from a reader.

Parameters
readerThe VoyantFrame reader to extract data from

Implements CapnpWrapper< VoyantFrame >.

◆ header()

const VoyantHeaderWrapper & VoyantFrameWrapper::header ( ) const
inline

Get the common header.

Returns
Const reference to the Voyant header

◆ headerMut()

VoyantHeaderWrapper & VoyantFrameWrapper::headerMut ( )
inline

Get mutable access to the common header.

Returns
Reference to the Voyant header

◆ points()

const std::vector< PointDataWrapper > & VoyantFrameWrapper::points ( ) const
inline

Get the vector of points.

Returns
Const reference to the vector of point data

◆ pointsMut()

std::vector< PointDataWrapper > & VoyantFrameWrapper::pointsMut ( )
inline

Get mutable access to the vector of points.

Returns
Reference to the vector of point data

◆ toBuffer()

size_t CapnpWrapper< VoyantFrame >::toBuffer ( uint8_t * buffer,
size_t buffer_size ) const
inlineinherited

Serialize this wrapper to a buffer using Cap'n Proto format.

Parameters
bufferPointer to the buffer to write serialized data to
buffer_sizeSize of the buffer in bytes
Returns
The number of bytes written to the buffer
Exceptions
std::runtime_errorif the buffer is too small

◆ toProto()

void VoyantFrameWrapper::toProto ( VoyantFrame::Builder & builder) const
overridevirtual

Write wrapper fields to a builder.

Parameters
builderThe VoyantFrame builder to write data to

Implements CapnpWrapper< VoyantFrame >.

Member Data Documentation

◆ config_

VoyantSdlConfigWrapper VoyantFrameWrapper::config_
private

Configuration (may be empty in current implementation).

◆ header_

VoyantHeaderWrapper VoyantFrameWrapper::header_
private

Common Voyant message header.

◆ points_

std::vector<PointDataWrapper> VoyantFrameWrapper::points_
private

Vector of point data.


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