28 #ifndef NIDAS_CORE_LOOPER_H
29 #define NIDAS_CORE_LOOPER_H
39 #include <sys/select.h>
44 namespace nidas {
namespace core {
66 unsigned int msecOffset)
82 static int gcd(
unsigned int a,
unsigned int b);
nidas::util::Mutex _clientMutex
Definition: Looper.h:88
Interface of a client of Looper.
Definition: LooperClient.h:38
void setupClientMaps()
Definition: Looper.cc:97
virtual int run()
Thread function.
Definition: Looper.cc:156
Looper is a Thread that periodically loops, calling the LooperClient::looperNotify() method of Looper...
Definition: Looper.h:51
static int gcd(unsigned int a, unsigned int b)
Utility function for finding greatest common divisor.
Definition: Looper.cc:91
void removeClient(LooperClient *clnt)
Remove a client from the Looper.
Definition: Looper.cc:65
unsigned int _sleepMsec
Definition: Looper.h:98
std::map< LooperClient *, unsigned int > _clientOffsets
Definition: Looper.h:93
std::map< LooperClient *, unsigned int > _clientPeriods
Definition: Looper.h:92
Definition: Exception.h:35
std::map< LooperClient *, unsigned int > _clientMods
Definition: Looper.h:96
Looper()
Definition: Looper.cc:36
void addClient(LooperClient *clnt, unsigned int msecPeriod, unsigned int msecOffset)
Add a client to the Looper whose LooperClient::looperNotify() method should be called every msec numb...
Definition: Looper.cc:45
std::list< LooperClient * > _clients
Definition: Looper.h:90
A C++ wrapper for a POSIX mutex.
Definition: ThreadSupport.h:154
std::map< LooperClient *, unsigned int > _clientDivs
Definition: Looper.h:95
Definition: InvalidParameterException.h:35