DUECA/DUSIME
Loading...
Searching...
No Matches
Macros | Functions
DCOtoJSON.hxx File Reference

Conversion routines for DCO to JSON. More...

Include dependency graph for DCOtoJSON.hxx:

Macros

#define RAPIDJSON_WRITE_DEFAULT_FLAGS   kWriteNanAndInfFlag
 Define relaxed acceptance of NaN and Inf.
 

Functions

void dueca::DCOtoJSONcompact (rapidjson::Writer< rapidjson::OStreamWrapper > &writer, const CommObjectReader &reader)
 Convert the data from a DCO object to a JSON stringbuffer.
 
void dueca::DCOtoJSONcompact (rapidjson::Writer< rapidjson::StringBuffer > &writer, const CommObjectReader &reader)
 Convert the data from a DCO object to a JSON stringbuffer.
 
void dueca::DCOtoJSONcompact (rapidjson::StringBuffer &doc, const char *dcoclass, const void *object)
 Convert the data from a DCO object to a JSON stringbuffer.
 
void dueca::DCOtoJSONstrict (rapidjson::Writer< rapidjson::StringBuffer > &writer, const CommObjectReader &reader)
 Convert the data from a DCO object to a JSON stringbuffer.
 
void dueca::DCOtoJSONstrict (rapidjson::Writer< rapidjson::OStreamWrapper > &writer, const CommObjectReader &reader)
 Convert the data from a DCO object to a JSON stringbuffer.
 
void dueca::DCOtoJSONstrict (rapidjson::StringBuffer &doc, const char *dcoclass, const void *object)
 Convert the data from a DCO object to a JSON stringbuffer.
 
template<typename T >
const chardueca::getclassname ()
 classname function, should exist for DCO objects
 
template<class WR , class DCO >
void dueca::dco_to_json (WR &writer, const DCO &object)
 Convert the data from a DCO object into a JSON writer Templated version, directly access the (known) object.
 

Detailed Description

Conversion routines for DCO to JSON.

Function Documentation

◆ DCOtoJSONcompact() [1/3]

void dueca::DCOtoJSONcompact ( rapidjson::Writer< rapidjson::OStreamWrapper > & writer,
const CommObjectReader & reader )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Also "extended" JSON, codes NaN, Infinite and -Infinite. Used internally in DUECA, careful about use with external clients.

Parameters
writerRapidJSON writer object
readerChannel access object.

◆ DCOtoJSONcompact() [2/3]

void dueca::DCOtoJSONcompact ( rapidjson::Writer< rapidjson::StringBuffer > & writer,
const CommObjectReader & reader )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Also "extended" JSON, codes NaN, Infinite and -Infinite. Used internally in DUECA, careful about use with external clients.

Parameters
writerRapidJSON writer object
readerChannel access object.

◆ DCOtoJSONcompact() [3/3]

void dueca::DCOtoJSONcompact ( rapidjson::StringBuffer & doc,
const char * dcoclass,
const void * object )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Also "extended" JSON, codes NaN, Infinite and -Infinite. Used internally in DUECA, careful about use with external clients.

Parameters
docStringbuffer
dcoclassType name of the DCO object
objectVoid pointer to the object with the data.

◆ DCOtoJSONstrict() [1/3]

void dueca::DCOtoJSONstrict ( rapidjson::Writer< rapidjson::StringBuffer > & writer,
const CommObjectReader & reader )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Stricter version, +Infinity and -Infinity are converted to large floats, NaN is converted to NULL.

Parameters
writerRapidJSON writer object
readerChannel access object.

◆ DCOtoJSONstrict() [2/3]

void dueca::DCOtoJSONstrict ( rapidjson::Writer< rapidjson::OStreamWrapper > & writer,
const CommObjectReader & reader )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Stricter version, +Infinity and -Infinity are converted to large floats, NaN is converted to NULL.

Parameters
writerRapidJSON writer object
readerChannel access object.

◆ DCOtoJSONstrict() [3/3]

void dueca::DCOtoJSONstrict ( rapidjson::StringBuffer & doc,
const char * dcoclass,
const void * object )

Convert the data from a DCO object to a JSON stringbuffer.

Compact variant, does not code DCO type information, so you need to be sure of the DCO type to interpret this data. Stricter version, +Infinity and -Infinity are converted to large floats, NaN is converted to NULL.

Parameters
docStringbuffer
dcoclassType name of the DCO object
objectVoid pointer to the object with the data.

◆ getclassname()

template<typename T >
const char * dueca::getclassname ( )

classname function, should exist for DCO objects

classname function, default for DCO objects

◆ dco_to_json()

template<class WR , class DCO >
void dueca::dco_to_json ( WR & writer,
const DCO & object )

Convert the data from a DCO object into a JSON writer Templated version, directly access the (known) object.

Parameters
writerJSON writer object.
objectObject to be read.
Template Parameters
WRCompatible type for JSON writing
DCOClass of the DCO object