Template Function yasmin::pybind11_utils::add_call_operator

Function Documentation

template<typename ClassType, typename StateType>
inline void yasmin::pybind11_utils::add_call_operator(ClassType &cls)

Helper to define the standard call method for State classes.

This template function adds a call method that:

  1. Accepts an optional Python blackboard object

  2. Converts it to a C++ Blackboard using convert_blackboard_from_python

  3. Releases the GIL to allow C++ threads to run

  4. Calls the C++ operator() with the converted blackboard

  5. Reacquires the GIL before returning to Python

Template Parameters:
Parameters:

cls – The pybind11 class definition