6–9 Jul 2021
Online
GMT timezone
July 6th - 9th

Automatic Wrapping of Functions for IOCSH

7 Jul 2021, 15:20
15m
Online

Online

EPICS - Invited Talk EPICS - Invited EPICS - General

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

Presentation materials