simple way to register timeout functions in ORBit's-mainloop ?



Hi,

it would be nice to have a simpler way to register timeout-functions
with the GContext used by ORBit2, mainly to check some stop-conditions.

By now, it is necessary to copy g_timeout_add() and g_timeout_add_full()
from glib and modify it to attach the source to the linc-context.

Similar to linc_main_idle_add() i would recommend the name
linc_main_timeout_add(), as the first alternative.

Another one would be to have sth. like g_timeout_add_to() in glib with
the destination GContext as another argument, and move the function
declaration of linc_main_get_context() from private to public header
to avoid g_main_loop_get_context(linc_main_get_loop()) combination.

Or, a third alternative would be to have sth. like ORBit_timeout_add()
to hide usage of linc/glib.

What do you think about this ?

I would implement one of these three ways, preferring the first one
with linc_main_timeout_add(), but i'm not sure if it fits in ORBit2's
abstraction-plan as i found linc moved into ORBit2 as linc2 in current
CVS-sources.

Regards,
   Michael Haubenwallner
-- 
Michael Haubenwallner                    SALOMON Automation GmbH
Forschung & Entwicklung                  A-8114 Friesach bei Graz
T +43 3127 200 308                       F +43 3127 200 22
mailto:michael.haubenwallner@salomon.at  http://www.salomon.at




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]