NaviTrack Tutorial:Integrating:Callback Module
Overview of CallbackModule
In the previous pages, we have implemented data transfer using NaviTrack into our own programs. The problem here is that they need to poll MyTutorialModule frequently to check if new data have arrived. This couldn't be a serious problem in case of seding small piece of data such as coordinate values, but might cause a waste of CPU time when the data is large.
We can do the almost same thing by using CallbackModule instead of polling. This module offers callback mechanism to process recieved data on its arrival. All we need to do is to define a callback function to process recieved data, and register it to CallbackModule. Once a callback function has been registered, it is invoked every after events arrive at a corresponding node in NaviTrack data flow, which is defined in a configulation XML file.