DUECA/DUSIME
Loading...
Searching...
No Matches
Functions
DCOtypeJSON.hxx File Reference

Conversion routines to code DCO type information into JSON. More...

Include dependency graph for DCOtypeJSON.hxx:

Functions

void dueca::DCOtypeJSON (rapidjson::Writer< rapidjson::StringBuffer > &writer, const char *dcoclass)
 Print the type information on a DCO defined type to JSON.
 
void dueca::DCOtypeJSON (rapidjson::StringBuffer &doc, const char *dcoclass)
 Print the type information on a DCO defined type to JSON.
 

Detailed Description

Conversion routines to code DCO type information into JSON.

Function Documentation

◆ DCOtypeJSON() [1/2]

void dueca::DCOtypeJSON ( rapidjson::Writer< rapidjson::StringBuffer > & writer,
const char * dcoclass )

Print the type information on a DCO defined type to JSON.

Parameters
writerWriter object
dcoclassDCO type class name

The JSON struct has the following format:

  • "class", with a string giving the class name of the object.
  • "type", here this is always "object".
  • "members", for a non-primitive type, array of data/structure members.

The data members array has the following contents for each entry:

  • "name", a string giving the member name
  • "class", as above for the object
  • "type", may be "object" as above, to indicate a nested object, or alternatively "primitive" (c/c++ type, or common std types like std::string) or "enum", in which case data are string values representing enumeration items.
  • "enumvalues" (only with enum), a nested object with keys representing enum writing mapping to the integer represenation of the enums.
  • "enumclass" (only with enum), integer class representing enum
  • "size" (optional), an integer indicating array size if the size of the arrays is fixed.
  • "container" (optional), "array" if the member is a list, array, vector or the like, "map" if the member is a mapped type. In this case also the variable "key_class" is present.

◆ DCOtypeJSON() [2/2]

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

Print the type information on a DCO defined type to JSON.

Parameters
docStringbuffer
dcoclassDCO type class name