OpenDaVINCI  4.16.0
odcore::reflection::MessageToVisitableVisitor Class Reference

#include <MessageToVisitableVisitor.h>

Inheritance diagram for odcore::reflection::MessageToVisitableVisitor:
Inheritance graph

Public Member Functions

 MessageToVisitableVisitor (const Message &m)
 
virtual ~MessageToVisitableVisitor ()
 
virtual void beginVisit (const int32_t &id, const string &shortName, const string &longName)
 
virtual void endVisit ()
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, odcore::serialization::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)
 
virtual void visit (const uint32_t &id, const string &longName, const string &shortName, void *data, const uint32_t &count, const odcore::TYPE_ &t)
 

Detailed Description

This class is a Visitor setting values in a visitable class from a generic Message representation.

Constructor & Destructor Documentation

odcore::reflection::MessageToVisitableVisitor::MessageToVisitableVisitor ( const Message m)
odcore::reflection::MessageToVisitableVisitor::~MessageToVisitableVisitor ( )
virtual

Member Function Documentation

void odcore::reflection::MessageToVisitableVisitor::beginVisit ( const int32_t &  id,
const string &  shortName,
const string &  longName 
)
virtual

This method is called from a Visitable before the first visit(...) call.

Parameters
idIdentifier of the visitable; typically the ID() of the visited message.
shortNameof the visited message.
longNameof the visited message.

Implements odcore::base::Visitor.

void odcore::reflection::MessageToVisitableVisitor::endVisit ( )
virtual

This method is called from a Visitable after the last visit(...) call.

Implements odcore::base::Visitor.

void odcore::reflection::MessageToVisitableVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
odcore::serialization::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.

References odcore::base::Visitable::accept(), odcore::reflection::Message::getFieldByIdentifier(), and odcore::reflection::Field< T >::getValue().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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::reflection::Message::getFieldByIdentifier().

void odcore::reflection::MessageToVisitableVisitor::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.

References odcore::reflection::Message::getFieldByIdentifier(), and odcore::reflection::Field< T >::getValue().

void odcore::reflection::MessageToVisitableVisitor::visit ( const uint32_t &  id,
const string &  longName,
const string &  shortName,
void *  data,
const uint32_t &  count,
const odcore::TYPE_ t 
)
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.
countNumber of elements in the fixed-sized array.
tData type for an element.

Implements odcore::base::Visitor.