I hope this will help you. The lack of documentation really hurts in
this instance.
class TimeoutHandler
{
public:
void onTimeout(DBus::SimpleTimeout& t)
{
cout << "onTimeout called!" << endl;
}
};
int main(int argc, char* argv[])
{
TimeoutHandler timeoutHandler;
DBus::SimpleTimeout timer(250 /*msec*/, true /*repeat*/,
&DBus::DefaultDispatcher::instance);
timer.expired =
new DBus::Callback<TimeoutHandler, void,
DBus::SimpleTimeout &>(&timeoutHandler,
&TimeoutHandler::onTimeout);
// Enter the global dispatch loop
DBus::DefaultDispatcher::instance.enter();
// The timer should repeatedly fire every ~250 msec
}
|