NRP Core  1.4.1
json_converter Namespace Reference

Functions

PyObject * convertJsonToPyObject (const nlohmann::json &json)
 Converts given JSON object into a python object. More...
 
nlohmann::json convertNumpyArrayToJson (PyObject *value)
 
nlohmann::json convertPyObjectToJson (PyObject *value)
 Converts given python object into a JSON object. More...
 
void initNumpy ()
 Initializes numpy array API for this module. More...
 

Function Documentation

◆ convertJsonToPyObject()

PyObject * json_converter::convertJsonToPyObject ( const nlohmann::json json)

Converts given JSON object into a python object.

◆ convertNumpyArrayToJson()

nlohmann::json json_converter::convertNumpyArrayToJson ( PyObject *  value)

◆ convertPyObjectToJson()

nlohmann::json json_converter::convertPyObjectToJson ( PyObject *  value)

Converts given python object into a JSON object.

◆ initNumpy()

void json_converter::initNumpy ( )

Initializes numpy array API for this module.

The function must be called before using the module. If it's not done, some of the other functions in the module may fail with an exception. The function must be called after Py_Initialize().