AERA
All Classes Functions Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
tcp_io_device::MsgData Class Reference

#include <utils.h>

Public Member Functions

 MsgData (const ProtoVariable *msg)
 
void setData (const std::string &d)
 
template<typename T >
void setData (const std::vector< T > &data)
 
MetaData getMetaData ()
 
std::string _data ()
 
template<typename T >
std::vector< T > getData ()
 
void toMutableProtoVariable (ProtoVariable *var)
 
bool isValid ()
 

Static Public Member Functions

template<typename T >
static MsgData createNewMsgData (MetaData meta_data, std::vector< T > data)
 
static MsgData createNewMsgData (MetaData meta_data, std::string data)
 
static MsgData createNewMsgData (MetaData meta_data)
 
static MsgData invalidMsgData ()
 

Friends

std::ostream & operator<< (std::ostream &output, const MsgData &msg_data)
 

Detailed Description

Class to store a DataMessage including a MetaData object and a string for the bytes of data.

Definition at line 225 of file AERA/IODevices/TCP/AERA_Protobuf/utils.h.

Constructor & Destructor Documentation

◆ MsgData()

tcp_io_device::MsgData::MsgData ( const ProtoVariable msg)
inline

Constructor for MsgData objects. Converts a ProtoVariable message to a MsgData object.

Parameters
msgThe message used to convert and create a MsgData object from.

Definition at line 237 of file AERA/IODevices/TCP/AERA_Protobuf/utils.h.

Member Function Documentation

◆ getData()

template<typename T >
std::vector<T> tcp_io_device::MsgData::getData ( )
inline

Casts the data from the byte representation stored as a string to the template type.

Todo:
: Check for dimensionality.

Definition at line 304 of file AERA/IODevices/TCP/AERA_Protobuf/utils.h.

◆ getMetaData()

MetaData tcp_io_device::MsgData::getMetaData ( )
inline

Returns the MetaData object corresponding to this MsgData.

Definition at line 295 of file AERA/IODevices/TCP/AERA_Protobuf/utils.h.

◆ setData()

void tcp_io_device::MsgData::setData ( const std::string &  d)
inline

Setter for the data of the message. Data is stored as a byte representation in form of a std::string.

Parameters
dThe byte representation of the data in form of a std::string.

Definition at line 276 of file AERA/IODevices/TCP/AERA_Protobuf/utils.h.


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