EPICS Base
7.0.7.0
|
Facility to call functions during iocInit() More...
#include "libComAPI.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | initHookFunction )(initHookState state) |
Type for application callback functions. More... | |
Functions | |
LIBCOM_API int | initHookRegister (initHookFunction func) |
Register a function for initHook notifications. More... | |
LIBCOM_API void | initHookAnnounce (initHookState state) |
Routine called by iocInit() to trigger notifications. More... | |
LIBCOM_API const char * | initHookName (int state) |
Returns printable representation of state . More... | |
LIBCOM_API void | initHookFree (void) |
Forget all registered application functions. More... | |
The initHooks facility allows application functions to be called at various stages/states during IOC initialization, pausing, restart and shutdown.
All registered application functions will be called whenever the IOC initialization, pause/resume or shutdown process reaches a new state.
The following C++ example shows how to use this facility:
An arbitrary number of functions can be registered.
Definition in file initHooks.h.
typedef void(* initHookFunction)(initHookState state) |
Application callback functions must match this typdef.
state | initHook enumeration value |
Definition at line 114 of file initHooks.h.
enum initHookState |
The enum states must agree with the names in the initHookName() function. New states may be added in the future if extra facilities get incorporated into the IOC. The numerical value of any state enum may change between EPICS releases; states are not guaranteed to appear in numerical order.
Some states were deprecated when iocPause() and iocRun() were added, but are still provided for backwards compatibility. These deprecated states are announced at the same point they were before, but will not be repeated if the IOC is later paused and restarted.
Definition at line 71 of file initHooks.h.
LIBCOM_API int initHookRegister | ( | initHookFunction | func | ) |
Registers func
for initHook notifications
func | Pointer to application's notification function. |
LIBCOM_API void initHookAnnounce | ( | initHookState | state | ) |
Calls registered callbacks announcing state
state | initHook enumeration value |
LIBCOM_API const char* initHookName | ( | int | state | ) |
Static string representation of state
for printing
state | enum value of an initHook |
LIBCOM_API void initHookFree | ( | void | ) |
This cleanup routine is called by unit test programs between IOC runs.