Brief description of class still missing. More...
#include <Timer.h>
Classes | |
class | QueueItem |
Public Member Functions | |
bool | after (Timer *o) const |
virtual bool | exec ()=0 |
int | interval () const |
bool | isRunning () |
void | printDebug () |
void | setInterval (int i) |
void | setTimeout () |
void | start () |
void | stop () |
int | timeout () const |
Timer () | |
virtual | ~Timer () |
Friends | |
class | EventLoop |
Brief description of class still missing.
Full description of class still missing
GpCoreTools::Timer::~Timer | ( | ) | [virtual] |
bool GpCoreTools::Timer::after | ( | Timer * | o | ) | const |
GpCoreTools::Timer::exec | ( | ) | [pure virtual] |
Performs action after timeout. If it returns true the timer is not single shot, i.e. deleted right after exec().
Implemented in GpCoreTools::ScreenClientConnect, NavigationTimer, IpRouteWatch, LinkMeasureTimer, LinkTestTimer, TimeRequest, BeaconTimer, DeadPeersTimer, and LinkTimer.
int GpCoreTools::Timer::interval | ( | ) | const [inline] |
Referenced by DeadPeersTimer::exec().
{return _interval;}
bool GpCoreTools::Timer::isRunning | ( | ) | [inline] |
{return _queued;}
void GpCoreTools::Timer::printDebug | ( | ) |
GpCoreTools::Timer::setInterval | ( | int | i | ) | [inline] |
Sets delay to i ms.
Referenced by BeaconTimer::BeaconTimer(), DeadPeersTimer::DeadPeersTimer(), NavigationTimer::exec(), IpRouteWatch::IpRouteWatch(), LinkMeasureTimer::LinkMeasureTimer(), LinkTestTimer::LinkTestTimer(), LinkTimer::LinkTimer(), NavigationTimer::NavigationTimer(), GpCoreTools::ScreenClientConnect::ScreenClientConnect(), and TimeRequest::TimeRequest().
{_interval=i;}
void GpCoreTools::Timer::setTimeout | ( | ) |
void GpCoreTools::Timer::start | ( | ) |
References GpCoreTools::EventLoop::addTimer(), GpCoreTools::EventLoop::instance(), stop(), and TRACE.
Referenced by LinkBuffer::bytesAvailable(), GpCoreTools::ScreenClient::connect(), PeerInfo::connect(), GpCoreTools::ScreenClient::hungUp(), and main().
{ TRACE; stop(); _queued=EventLoop::instance()->addTimer(this); }
void GpCoreTools::Timer::stop | ( | ) |
int GpCoreTools::Timer::timeout | ( | ) | const |
References TRACE.
Referenced by printDebug().
{ TRACE; timespec t; clock_gettime(CLOCK_REALTIME, &t); int d=(_timeout.tv_sec-t.tv_sec)*1000+(_timeout.tv_nsec-t.tv_nsec)/1000000; return d<0 ? 0 : d; }
friend class EventLoop [friend] |