To run a Ufunc program from KF (Knowledge Fusion) you will need to wrap the Ufunc in a KF function. Example:
~~~~~~
Defun: myLayerControl( Integer $layer, String $status; String ($lib; "my_kf_layer");
String ($func_name; "MY_KF_set_layer" ))
@{ CFunc("UF_KF_invoke_user_function"; "libufun"); } Boolean;
~~~~~~~
First line defines a KF function called myLayerControl. The kf function takes an integer and a string, the next string sets the library attribute to the library compiled name "my_kf_layer", then the next string defines the function name in the library "MY_KF_set_layer".
Then the expression block calls the method UFunc with the first parameter of "UF_KF_invoke_user_function" and that it is a "libufun", and all this returns a Boolean.
So you now have a KF method or function that calls a ufunc with the library name of my_kf_layer that has a function name MY_KF_set_layer and passing it two parameters of type integer and string.
The CPP code prototype looks like:
void MY_KF_set_layer( UF_KF_value_t *data, int num,
UF_KF_value_t *returnValue )
{
You need to map the KF values to C types. Ufunc provides type to do this. UF_KF_ask_integer, and UF_KF_ask_string, plus others.
PLM Exchange