mapry.cpp.generate

Generate the C++ code to parse and serialize a mapry object graph.

mapry.cpp.generate.types_header

Generate the code that defines the types of the object graph.

mapry.cpp.generate.types_header.generate(graph, cpp)

Generate the header file that defines the types of the object graph.

Parameters
  • graph (Graph) – definition of the object graph

  • cpp (Cpp) – C++ settings

Return type

str

Returns

content of the header file

Ensures
  • result.endswith('\n')

mapry.cpp.generate.parse_header

Generate the header of the general parsing structures.

mapry.cpp.generate.parse_header.generate(cpp)

Generate the header file defining the parsing structures.

Parameters

cpp (Cpp) – C++ settings

Return type

str

Returns

content of the header file

Ensures
  • result.endswith('\n')

mapry.cpp.generate.parse_impl

Generate the code implementing the general parse structures.

mapry.cpp.generate.parse_impl.generate(cpp, parse_header_path)

Generate the implementation file of the parsing structures.

Parameters
  • cpp (Cpp) – C++ settings

  • parse_header_path (str) – path to the header file that defines the general parsing structures

Return type

str

Returns

content of the implementation file

Ensures
  • result.endswith('\n')

mapry.cpp.generate.jsoncpp_header

Generate the header for de/serialization from/to Jsoncpp values.

mapry.cpp.generate.jsoncpp_header.generate(graph, cpp, types_header_path, parse_header_path)

Generate the header file for de/serialization from/to Jsoncpp.

Parameters
  • graph (Graph) – definition of the object graph

  • cpp (Cpp) – C++ settings

  • types_header_path (str) – path to the header file that defines the types of the object graph

  • parse_header_path (str) – path to the header file that defines the general parsing structures

Return type

str

Returns

content of the header file

Ensures
  • result.endswith('\n')

mapry.cpp.generate.jsoncpp_impl

Generate the implementation of de/serialization from/to Jsoncpp values.

mapry.cpp.generate.jsoncpp_impl.generate(graph, cpp, types_header_path, parse_header_path, jsoncpp_header_path)

Generate the implementation file for de/serialization from/to Jsoncpp.

Parameters
  • graph (Graph) – definition of the object graph

  • cpp (Cpp) – C++ settings

  • types_header_path (str) – defines the types of the object graph

  • parse_header_path (str) – defines the general parsing structures

  • jsoncpp_header_path (str) – defines parsing and serializing functions from/to Jsoncpp

Return type

str

Returns

content of the implementation file

Ensures
  • result.endswith('\n')