Publishing methods

- Procedure to publish methods

Synopsis
FUNCTIONADDR (*call)(OBJECT *object); gl_publish_function(CLASS *oclass, const char *name, FUNCTIONADDR call); FUNCTIONADDR gl_get_function(OBJECT *obj, const char *name);

Remarks
Classes may expose methods to other classes using the gl_publish_function API call. The function address can then be looked up and called as needed. The argument list is not specified and thus cannot be verified when the method is called.

Example

 * Target class

EXPORT void* my_function(OBJECT *obj, ...) {  va_list ptr; va_start(ptr,obj); // TODO implement your function here va_end(ptr); return NULL; // TODO return data pointer }
 * 1) include 
 * 2) include "gridlabd.h"


 * Calling class

gld_object *target = get_object("target_object_name"); FUNCTIONADDR my_function = target->get_function("my_function"); void *result = my_function(target->my); // TODO add arguments to call
 * 1) include "gridlabd.h"

Issues

 * As of : Methods cannot be called from other instances of GridLAB-D.