Echelon ISI User Manual
Page 68
ISI Programmer’s Guide
66
in order to simplify development; however, most developers will tailor the ISI
implementation by overriding the default implementations. You cannot replace
the functions that indicate they cannot be overridden in Appendix B.
The C language has no concept of overloaded functions, so an overridden function
can no longer call the default implementation: as both have the same name,
calling the function with the same name will result in a recursive function call.
The following illustrates the standard C library case: a library provides a utility
“IsiFoo(),” which an application may call:
Standard Library Case
Overloading the utility function with an application-specific implementation
prevents accessing the implementation provided with the library:
Overridden Library Function
You can use a
forwarder
to override an ISI function and call its default
implementation at the same time. You can choose not to use the default
implementation, or you can provide additional functionality and continue to call
the default implementation. Every ISI function that supports forwarding has a
sister function with the same definition that starts with a lower-case “i”. For
example, IsiFoo()
has a sister function called isiFoo(). The API is defined as the
plain function (i.e. Isi
*
()). If you choose to override this function, your override
code may still call the isiFoo() function to benefit from the default
implementation: