OpenDaVINCI  4.16.0
odcore::reflection::CSVFromVisitableVisitor Class Reference

#include <CSVFromVisitableVisitor.h>

Inheritance diagram for odcore::reflection::CSVFromVisitableVisitor:
Inheritance graph

Public Member Functions

 CSVFromVisitableVisitor ()
 
 CSVFromVisitableVisitor (ostream &out, const bool &header=true, const char &delimiter= ',', const string &headerPrefix="")
 
virtual ~CSVFromVisitableVisitor ()
 
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)
 
string getHeader () const
 
string getEntry () const
 

Detailed Description

This class transforms a Visitable into a character separated output.

Constructor & Destructor Documentation

odcore::reflection::CSVFromVisitableVisitor::CSVFromVisitableVisitor ( )
odcore::reflection::CSVFromVisitableVisitor::CSVFromVisitableVisitor ( ostream &  out,
const bool &  header = true,
const char &  delimiter = ',',
const string &  headerPrefix = "" 
)

Constructor.

Parameters
outBuffer for the output.
headerAdd human-readable header.
delimiterDelimiter.
headerPrefixPrefix to prepend the actual header.
odcore::reflection::CSVFromVisitableVisitor::~CSVFromVisitableVisitor ( )
virtual

Member Function Documentation

void odcore::reflection::CSVFromVisitableVisitor::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::CSVFromVisitableVisitor::endVisit ( )
virtual

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

Implements odcore::base::Visitor.

string odcore::reflection::CSVFromVisitableVisitor::getEntry ( ) const

This method returns the entry line for this transformed Visitable.

Returns
Entry line.

Referenced by visit().

string odcore::reflection::CSVFromVisitableVisitor::getHeader ( ) const

This method returns the (optional) header line for this transformed Visitable.

Returns
Header line.

Referenced by visit().

void odcore::reflection::CSVFromVisitableVisitor::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(), getEntry(), and getHeader().

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References odcore::CHAR_T, odcore::DOUBLE_T, odcore::FLOAT_T, odcore::INT16_T, odcore::INT32_T, odcore::INT64_T, odcore::INT8_T, odcore::UCHAR_T, odcore::UINT16_T, odcore::UINT32_T, odcore::UINT64_T, and odcore::UINT8_T.