Lean
$LEAN_TAG$
|
Set of helper methods to invoke Python methods with runtime checks for return values and out parameter's conversions. More...
Static Public Member Functions | |
static TResult | InvokeMethod< TResult > (PyObject method, string pythonMethodName, params object[] args) |
Invokes method method and converts the returned value to type TResult More... | |
static IEnumerable< TItem > | InvokeMethodAndEnumerate< TItem > (PyObject method, string pythonMethodName, params object[] args) |
Invokes method method , expecting an enumerable or generator as return value, converting each item to type TItem on demand. More... | |
static Dictionary< TKey, TValue > | InvokeMethodAndGetDictionary< TKey, TValue > (PyObject method, string pythonMethodName, params object[] args) |
Invokes method method , expecting a dictionary as return value, which then will be converted to a managed dictionary, with type checking on each item conversion. More... | |
static TResult | InvokeMethodAndWrapResult< TResult > (PyObject method, string pythonMethodName, Func< PyObject, TResult > wrapResult, params object[] args) |
Invokes method method and tries to convert the returned value to type TResult . If conversion is not possible, the returned PyObject is passed to the provided wrapResult method, which should try to do the proper conversion, wrapping or handling of the PyObject. More... | |
static TResult | InvokeMethodAndGetOutParameters< TResult > (PyObject method, string pythonMethodName, Type[] outParametersTypes, out object[] outParameters, params object[] args) |
Invokes method method and converts the returned value to type TResult . It also makes sure the Python method returns values for the out parameters, converting them into the expected types in outParametersTypes and placing them in the outParameters array. More... | |
static T | Convert< T > (PyObject pyObject, string pythonName, bool isMethod=true) |
Converts the given PyObject into the provided T type, generating an exception with a user-friendly message if conversion is not possible. More... | |
static T | ConvertAndDispose< T > (PyObject pyObject, string pythonName, bool isMethod=true) |
Converts the given PyObject into the provided T type, generating an exception with a user-friendly message if conversion is not possible. It will dispose of the source PyObject. More... | |
Set of helper methods to invoke Python methods with runtime checks for return values and out parameter's conversions.
Definition at line 336 of file BasePythonWrapper.cs.
|
static |
Invokes method method and converts the returned value to type TResult
Definition at line 341 of file BasePythonWrapper.cs.
|
static |
Invokes method method , expecting an enumerable or generator as return value, converting each item to type TItem on demand.
Definition at line 353 of file BasePythonWrapper.cs.
|
static |
Invokes method method , expecting a dictionary as return value, which then will be converted to a managed dictionary, with type checking on each item conversion.
Definition at line 370 of file BasePythonWrapper.cs.
|
static |
Invokes method method and tries to convert the returned value to type TResult . If conversion is not possible, the returned PyObject is passed to the provided wrapResult method, which should try to do the proper conversion, wrapping or handling of the PyObject.
Definition at line 409 of file BasePythonWrapper.cs.
|
static |
Invokes method method and converts the returned value to type TResult . It also makes sure the Python method returns values for the out parameters, converting them into the expected types in outParametersTypes and placing them in the outParameters array.
Definition at line 429 of file BasePythonWrapper.cs.
|
static |
Converts the given PyObject into the provided T type, generating an exception with a user-friendly message if conversion is not possible.
Definition at line 474 of file BasePythonWrapper.cs.
|
static |
Converts the given PyObject into the provided T type, generating an exception with a user-friendly message if conversion is not possible. It will dispose of the source PyObject.
Definition at line 502 of file BasePythonWrapper.cs.