Hooking to containers
You can hook a callback function to changes in a container using MbufHookFunction. You can choose to hook to either the container itself, or to all components of the container individually (including components allocated in the future). For more information about hook-handler functions in general, see Event handling in Aurora Imaging Library with hook-handler functions.
If you hook to the container itself, the callback function will be called after any Aurora Imaging Library function that modifies at least one of its components, adds or removes a component, or uses the container as a destination (even if the container is not modified). Using MbufGetHookInfowith M_MODIFIED_BUFFERwithin the callback function will return the identifier of the container. The callback function will never be called more than once for a single Aurora Imaging Library function call.
If you hook to all components of the container (by specifyingM_ON_COMPONENT), the callback function will be called after any Aurora Imaging Library function that modifies one of those components (including allocating or freeing the component). Using MbufHookFunctionwith M_MODIFIED_BUFFERwithin the callback function will return the identifier of the component. If a single function modifies multiple components of the container (for example, if the container is a destination for a 3D processing function that modifies or frees multiple components), the callback function will be called once for each modified component.
If you manually specify that a container has been modified (using MbufControlContainer with M_MODIFIED), Aurora Imaging Library will also call functions hooked to the container's components. If you do this for a child container, Aurora Imaging Library will also call functions hooked to the parent container(s).