cmakepp_lang/object/serialize

Defines functions for serializing and printing a CMakePPLang Object.

cmakepp_lang/object/serialize._cpp_object_serialize(this result)

Serializes an object into JSON format.

This function is the default implementation for serializing an object. Derived classes are free to override it with their own implementations. This implementation simply treats the object as a map with a single key-value pair comprised of the “this” pointer (as the key) and the serialized state of the object as the value.

Parameters:
  • this (obj) – The object we are serializing.

  • result (desc) – Name for the identifier which will hold the serialized value.

Returns:

result will be set to the JSON serialized representation of this.

Variables:

CMAKEPP_LANG_DEBUG_MODE (bool) – Used to determine if CMakePP is being run in debug mode or not.

Error Checking

If CMakePP is run in debug mode (and only if it is) this function will assert that the caller has provided exactly two arguments and that those arguments have the correct types. If any assertion fails an error is raised.

cmakepp_lang/object/serialize._cpp_object_print(this)

Prints an object to standard out.

This function is code factorization for serializing an object and printing the serialized form to standard out.

Parameters:

this (obj) – The object we are printing to standard out.

Error Checking

If CMakePP is run in debug mode (and only if it is) this function will ensure that it was called with a single argument and that the argument is implicitly convertible to an Object. If either of these assertions fail an error will be raised.

var CMAKEPP_LANG_DEBUG_MODE:

Used to determine if CMakePP is being run in debug mode or not.

vartype CMAKEPP_LANG_DEBUG_MODE:

bool