Template Function Karana::Models::addToDSMethod

Template Function Karana::Models::addToDSMethod#

Function Documentation#

template<class ModelClass>
void Karana::Models::addToDSMethod(auto &cls, std::string_view model_class_name, const std::string &model_ds_module_name, const std::string &model_ds_class_name)#

Add a toDS method to the given model class.

You MUST call the ADD_TO_DS_METHOD_CASTER before calling this.

To provide some extra information for the params below. Suppose we have a model called MyModel and an associated DataStruct class located at MyPackage.MyModule.MyModelDS, then the params below will be: model_class_name - MyModel model_ds_module_name - MyPackage.MyModule model_ds_class_name - MyModelDS

Parameters:
  • The – pybind11::class_ to add the toDS method to.

  • model_class_name – The name of the model class in Python.

  • model_ds_module_name – The full name of the module that contains the associated DataStruct for the Python class.

  • model_ds_class_name – The name of the associated DataStruct class in Python.