Where/how I can get a Looper according to the C++ standard or C++ standard libraries ?
I need to design my own callback system and, of course, I need this one to manage my queue and my components.
A looper is something that given a frequency does 1 simple thing, it just runs a queue at each clock, if you set a 10 ms looper, every 10ms the looper will fire the event/events in the queue.
This is basically a looper, most of the time is usually tied to the kernel, the hardware clock or something really low-level.
QTimer does what you want — “single-shot”, or as in your case, fires repeatedly at a given (millisecond) frequency.
You might also google for “watch-dog-timer”, as I think that may be a more common term than “looper”.
If you want to go more lower-level, some systems (like Windows) have a “system-clock” (typically at millisecond resolution), and another higher-performance clock like a “multi-media-clock” (typically at nanosecond resolution) if performance is important.
[EDIT], Ok, so I watched the video on “what-is-a-looper”. This looks like a standard event-processing-queue. GUI events trigger messages-added-to-the-queue, and the “looper” clears/executes-the-message-queue periodically. A special case is that the “looper” also handles “local-service-calls” (on Android, which was the topic of the video). So, it seems you merely need:
The video notes:
So, interesting, but doesn’t look particulary difficult to implement. This is a well-tread pattern.
So, in this context, my suggestion of
QTimerwould only be a part of the solution. Sounds like you want the library for the message queue to go with it.