OpenDaVINCI  4.15.3
odcore::serialization::LCMDeserializerVisitor Class Reference

#include <LCMDeserializerVisitor.h>

Inheritance diagram for odcore::serialization::LCMDeserializerVisitor:
Inheritance graph

Public Member Functions

 LCMDeserializerVisitor ()
 
virtual ~LCMDeserializerVisitor ()
 
virtual void deserializeDataFrom (istream &in)
 
const string getChannelName () const
 
int64_t getDecodedHash () const
 
int64_t getCalculatedHash () const
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, Serializable &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, bool &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, char &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, unsigned char &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, int8_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, int16_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, uint16_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, int32_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, uint32_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, int64_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, uint64_t &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, float &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, double &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, string &v)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, void *data, const uint32_t &size)
 

Static Public Member Functions

static float ntohf (float f)
 
static double ntohd (double d)
 
static uint64_t __ntohll (uint64_t ui)
 
static int64_t __ntohll (int64_t i)
 

Detailed Description

This class provides a deserialization visitor to decode data encoded in LCM format (cf. https://github.com/lcm-proj/lcm).

Constructor & Destructor Documentation

odcore::serialization::LCMDeserializerVisitor::LCMDeserializerVisitor ( )
odcore::serialization::LCMDeserializerVisitor::~LCMDeserializerVisitor ( )
virtual

Member Function Documentation

uint64_t odcore::serialization::Deserializer::__ntohll ( uint64_t  ui)
staticinherited

This method converts a uint64_t from network byte order to host byte order.

Parameters
uiuint64_t to be converted.
Returns
ui in HBO.

References odcore::wrapper::IS_BIG_ENDIAN.

Referenced by deserializeDataFrom(), and odcore::serialization::QueryableNetstringsDeserializerAACF::readValue().

int64_t odcore::serialization::Deserializer::__ntohll ( int64_t  i)
staticinherited

This method converts an int64_t from network byte order to host byte order.

Parameters
iint64_t to be converted.
Returns
i in HBO.

References odcore::wrapper::IS_BIG_ENDIAN.

void odcore::serialization::LCMDeserializerVisitor::deserializeDataFrom ( istream &  in)
virtual

The method sets the istream from which the data shall be deserialized. Any existing deserialized data will be reset.

Parameters
inInput stream containing the data.

Implements odcore::serialization::Deserializer.

References odcore::serialization::Deserializer::__ntohll().

int64_t odcore::serialization::LCMDeserializerVisitor::getCalculatedHash ( ) const

This method returns the calculated hash value.

Returns
Calculated hash.
const string odcore::serialization::LCMDeserializerVisitor::getChannelName ( ) const

This method returns the channel name under which the payload of in the stream was serialized.

Returns
Channel name.
int64_t odcore::serialization::LCMDeserializerVisitor::getDecodedHash ( ) const

This method returns the decoded hash value.

Returns
Decoded hash.
double odcore::serialization::Deserializer::ntohd ( double  d)
staticinherited

This method converts a double from network byte order to host byte order.

Parameters
ddouble to be converted.
Returns
d in HBO.

References odcore::wrapper::IS_BIG_ENDIAN.

Referenced by odcore::serialization::QueryableNetstringsDeserializerAACF::readValue(), and odcore::serialization::QueryableNetstringsDeserializerABCF::readValue().

float odcore::serialization::Deserializer::ntohf ( float  f)
staticinherited

This method converts a float from network byte order to host byte order.

Parameters
ffloat to be converted.
Returns
f in HBO.

References odcore::wrapper::IS_BIG_ENDIAN.

Referenced by odcore::serialization::QueryableNetstringsDeserializerAACF::readValue(), and odcore::serialization::QueryableNetstringsDeserializerABCF::readValue().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
Serializable v 
)
virtual

This method visits a Serializable.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vSerializable to be serialized.

Implements odcore::base::Visitor.

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
bool &  v 
)
virtual

This method visits a bool.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vBool to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
char &  v 
)
virtual

This method visits a char.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vChar to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
unsigned char &  v 
)
virtual

This method visits an unsigned char.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vUnsigned char to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
int8_t &  v 
)
virtual

This method visits an int8_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
iint8_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
int16_t &  v 
)
virtual

This method visits an int16_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
iint16_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
uint16_t &  v 
)
virtual

This method visits an uint16_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vuint16_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
int32_t &  v 
)
virtual

This method visits an int32_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
iint32_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
uint32_t &  v 
)
virtual

This method visits an uint32_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vuint32_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
int64_t &  v 
)
virtual

This method visits an int64_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
iint64_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
uint64_t &  v 
)
virtual

This method visits an uint64_t.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vuint64_t to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
float &  v 
)
virtual

This method visits a float.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vFloat to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
double &  v 
)
virtual

This method visits a double.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vDouble to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
string &  v 
)
virtual

This method visits a string.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
vString to be serialized.

Implements odcore::base::Visitor.

References odcore::serialization::LCMSerializerVisitor::calculateHash().

void odcore::serialization::LCMDeserializerVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
void *  data,
const uint32_t &  size 
)
virtual

This method visits undefined data of length size.

Parameters
ididentifier for the v to be serialized.
longNameLong identifier (ie. with package name) for the v to be serialized.
shortNameShort identifier for the v to be serialized.
dataData to be serialized.
sizeLength of the data to be serialized.

Implements odcore::base::Visitor.