OpenDaVINCI  4.15.3
odcore::serialization::ProtoKeyValue Class Reference

#include <ProtoDeserializer.h>

Public Member Functions

 ProtoKeyValue ()
 
 ProtoKeyValue (const uint32_t &key, const ProtoSerializer::PROTOBUF_TYPE &type, const uint64_t &length)
 
 ProtoKeyValue (const uint32_t &key, const ProtoSerializer::PROTOBUF_TYPE &type, const uint64_t &length, const vector< char > &value)
 
 ProtoKeyValue (const uint32_t &key, const uint64_t &value)
 
uint32_t getKey () const
 
ProtoSerializer::PROTOBUF_TYPE getType () const
 
uint64_t getLength () const
 
uint64_t getValueAsVarInt () const
 
float getValueAsFloat () const
 
double getValueAsDouble () const
 
string getValueAsString () const
 
const vector< char > & getValue () const
 
vector< char > & getRawBuffer ()
 

Detailed Description

This class represents an entry for the hash map used by ProtoDeserializer.

Constructor & Destructor Documentation

odcore::serialization::ProtoKeyValue::ProtoKeyValue ( )
odcore::serialization::ProtoKeyValue::ProtoKeyValue ( const uint32_t &  key,
const ProtoSerializer::PROTOBUF_TYPE type,
const uint64_t &  length 
)

Constructor.

Parameters
keyAssociated Proto key.
typeAssociated Proto type.
lengthLength of the contained value.
odcore::serialization::ProtoKeyValue::ProtoKeyValue ( const uint32_t &  key,
const ProtoSerializer::PROTOBUF_TYPE type,
const uint64_t &  length,
const vector< char > &  value 
)

Constructor.

Parameters
keyAssociated Proto key.
typeAssociated Proto type.
lengthLength of the contained value.
vValue.
odcore::serialization::ProtoKeyValue::ProtoKeyValue ( const uint32_t &  key,
const uint64_t &  value 
)

Constructor.

Parameters
keyAssociated Proto key.
typeAssociated Proto type.
lengthLength of the contained value.
valueActual VaInt value.

Member Function Documentation

uint32_t odcore::serialization::ProtoKeyValue::getKey ( ) const
uint64_t odcore::serialization::ProtoKeyValue::getLength ( ) const
vector< char > & odcore::serialization::ProtoKeyValue::getRawBuffer ( )

This method returns a reference to the contained buffer.

Returns
value as reference.

Referenced by odcore::serialization::ProtoDeserializer::deserializeDataFrom().

ProtoSerializer::PROTOBUF_TYPE odcore::serialization::ProtoKeyValue::getType ( ) const
const vector< char > & odcore::serialization::ProtoKeyValue::getValue ( ) const

This method returns a reference to the contained value.

Returns
value as reference.
double odcore::serialization::ProtoKeyValue::getValueAsDouble ( ) const

This method returns the contained value as double.

Returns
value as double.

References odcore::serialization::ProtoSerializer::EIGHT_BYTES.

float odcore::serialization::ProtoKeyValue::getValueAsFloat ( ) const

This method returns the contained value as float.

Returns
value as float.

References odcore::serialization::ProtoSerializer::FOUR_BYTES.

string odcore::serialization::ProtoKeyValue::getValueAsString ( ) const

This method returns the contained value as string.

Returns
value as string.

References odcore::serialization::ProtoSerializer::LENGTH_DELIMITED.

uint64_t odcore::serialization::ProtoKeyValue::getValueAsVarInt ( ) const

This method returns the contained value as uint64_t (base type for VarInt).

Returns
value as uint64_t.

References odcore::serialization::ProtoSerializer::VARINT.