AERA
Public Member Functions | Protected Attributes | Friends | List of all members
tcp_io_device::MetaData Class Reference

#include <utils.h>

Public Member Functions

 MetaData (const VariableDescription *meta_data)
 
 MetaData (int entity_id, int name_id, VariableDescription_DataType t, std::vector< uint64_t > dimensions, std::string opcode_handle="")
 
int getEntityID ()
 
int getID ()
 
uint64_t getDataLength ()
 
uint64_t getDataSize ()
 
std::vector< uint64_t > getDimensions ()
 
VariableDescription_DataType getType ()
 
std::string getOpCodeHandle ()
 
void setMetaData (int entity_id, int id, VariableDescription_DataType t, std::vector< uint64_t > d, std::string opcode_handle="")
 
VariableDescription toVariableDescription ()
 
void toMutableVariableDescription (VariableDescription *mutable_variable_description)
 

Protected Attributes

int entity_id_
 
int id_
 
VariableDescription_DataType type_
 
size_t type_size_
 
uint64_t data_size_ = 0
 
uint64_t data_length_ = 0
 
std::vector< uint64_t > dimensions_
 
std::string opcode_handle_
 

Friends

class MsgData
 
std::ostream & operator<< (std::ostream &output, const MetaData &meta_data)
 

Detailed Description

MetaData is a class to store the meta-data of messages. Especially used for storing of available commands and their descriptions. Additionally gives access to convenience funtions, like VariableDescription message parsing.

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

Constructor & Destructor Documentation

◆ MetaData() [1/2]

tcp_io_device::MetaData::MetaData ( const VariableDescription meta_data)
inline

Constructor for MetaData objects. Converts the passed VariableDescription message and creates a MetaData object from it.

Parameters
meta_dataThe VariableDescription used to convert to a MetaData object.

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

◆ MetaData() [2/2]

tcp_io_device::MetaData::MetaData ( int  entity_id,
int  name_id,
VariableDescription_DataType  t,
std::vector< uint64_t >  dimensions,
std::string  opcode_handle = "" 
)
inline

Constructor for MetaData objects. Best only used to create the objects when first initializing the communicaiton. To parse incoming messages please see the other constructor.

Parameters
entityAn identifier describing the entity to which this MetaData objects is related.
nameAn identifier for the name of the data.
tThe VariableDescription_DataType of the data.
dimensionsThe dimensionality of the data associated with this MetaData object.

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

Member Function Documentation

◆ getDataLength()

uint64_t tcp_io_device::MetaData::getDataLength ( )
inline

Returns the full length of the data assigned to this MetaData object Number of data parts (e.g. double values) * the data size of each part (e.g. 8)

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

◆ getDataSize()

uint64_t tcp_io_device::MetaData::getDataSize ( )
inline

Returns the number of bytes used to store a data object (e.g. 8 for double)

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

◆ getDimensions()

std::vector<uint64_t> tcp_io_device::MetaData::getDimensions ( )
inline

Returns the dimensions of the data. E.g. [1920, 1080] for a full HD image.

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

◆ getEntityID()

int tcp_io_device::MetaData::getEntityID ( )
inline

Returns the id of the entity for which this description is used.

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

◆ getID()

int tcp_io_device::MetaData::getID ( )
inline

Returns the id of the property for which this description is used.

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

◆ getOpCodeHandle()

std::string tcp_io_device::MetaData::getOpCodeHandle ( )
inline

Returns the opcode handle of the corresponding message.

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

◆ getType()

VariableDescription_DataType tcp_io_device::MetaData::getType ( )
inline

Returns the type of the corresponding message.

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

◆ setMetaData()

void tcp_io_device::MetaData::setMetaData ( int  entity_id,
int  id,
VariableDescription_DataType  t,
std::vector< uint64_t >  d,
std::string  opcode_handle = "" 
)
inline

Sets the fields of the MetaData object.

Parameters
entity_idThe id of the entity as received in the setup message.
idThe id of the property as received in the setup message.
tThe data type of the data (e.g. DOUBLE, INT, or similar).
dThe dimensions of the data.

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


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