> I am writing a timer class that I want to be able to get to notify me (via
> a callback func), when a specified interval has elapsed. I have most of
> the timer functionality figured - however, I need to spawn a new thread to
> carry out the "time watch" - and I need to do this in a cross platform
> (Well Linux/Windows) way ...
I can't help you with the cross platform issues except to mention that there
are libraries that try to smooth over the platform differences like this one
http://www.cs.wustl.edu/~schmidt/ACE.html
and this one
http://www.roguewave.com/products/enterprise/
and this one
http://www.boost.org/doc/html/threads.html
On the Win32 side, it should be a no-brainer to wrap a class around the
multimedia function timeSetEvent() which dispatches callbacks at a future
time and which manages the lifetime of the thread on which the callbacks
occur.
Regards,
Will
Alfonso Morra - 19 Jul 2005 09:22 GMT
>>I am writing a timer class that I want to be able to get to notify me (via
>>a callback func), when a specified interval has elapsed. I have most of
[quoted text clipped - 22 lines]
> Regards,
> Will
Thanks Will for the post. I think to keep things simple for now, I'll
just use conditional compilation and branch the logic accross the
platforms. Would you be so kind as to get me started with the
timeSetEvent() wrapper, I'm currently reading up on the function notes
and I'm sure I'll be able to follow up on an example that you provide.
MTIA