Methods are accessed using the method_finder. The method_finder is implemented in the ds__method - _finder() function. The method_finder lies at the heart of the OIC methodology. It searches the objects class structure for a specifed method. If it doesn't find the method in the objects class it searches the methods_list of the object's superclass. If it can't find the method there it searches the superclass of the superclass and so on until it reaches the root class ( devServerClass). The function pointer for the first method found which matches the desired method is returned and can be executed. It is up to the calling routine to know and specify the correct syntax. The present implementation of the ds__method_finder() does an exit() if no matching method is found.
The method finder has following calling syntax -
DevMethodFunction ds__method_finder(DevServer ds, DevMethod method);DevMethodFunction is defined as a pointer to function i.e.
typedef long int (*DevMethodFunction)();The returned function pointer points to the function implementing the desired method which was found by the method_finder. It is then necessary to call the function. An example of using the method finder to search for and execute the object_initialise method is -
ds__method_finder(ds_list[i],DevMethodInitialise)(ds_list[i],error)