Speaker
Till Straumann
(PSI)
Description
Wrapping of functions to be called from iocsh
requires writing a significant amount of boiler-plate code. We present a set of C++ templates which automates this tedious task and let the user wrap and register simple functions in a single line.
In more complex cases the templates can be extended/specialized, e.g., to convert user-defined function argument types. While the templates require c++ the wrapped function may be a plain C function. E.g., assume you want to wrap hello()
:
extern "C" void hello(const char *world);
#include <iocshDeclWrapper.h>
// add the following line to some iocsh registrar
IOCSH_FUNC_WRAP( hello );
Talk duration | 15 minutes + questions |
---|
Primary author
Till Straumann
(PSI)