Can you expand on what's wrong with initHooks?
Couldn't you create a linked list of the device private structures for your devices with a file-static pointer to the list -- then the initHooks routine could traverse this list at whatever points you need during IOC initialization.
On Mar 6, 2013, at 7:53 PM, Zenon Szalata <[email protected]> wrote:
Hi Mark,
I am wondering if there is functionality in asynPortDriver or asyn as such for having a callback routine be called at various stages of the DB initialization. I would like to use something like the EPICS initHookFunction. The problem with it is that it is a static function with no mechanism that I see to pass to it a pointer to my device driver class object, so that from the callback routine the correct instance of the device driver can be called. I have a situation where I have a few identical VME ADC boards and for each of these boards I create an object of the class (derived from asynPortDriver).
I have klugged this as a function which I invoke from st.cmd file after IOC initialization is done. This works fine unless I need to have a bit more control when the routine is called, like after some phase of the DB init other than after all initialization is done.
Sorry for bugging you about this,
Zen