Timer.h
Go to the documentation of this file.
#ifndef __Timer_h__
#define __Timer_h__
#include "Socket.h"
#include "EPoll.h"
namespace core {
class Timer : Socket {
public:
Timer(EPoll &ePoll);
Timer(EPoll &ePoll, double delay);
~Timer();
void setTimer(double delay);
void clearTimer();
double getElapsed();
double getEpoch();
protected:
virtual void onTimeout() = 0;
private:
void onDataReceived(std::string data) override;
double delayValue;
};
}
#endif
core::Timer::~Timer
~Timer()
Definition: Timer.cpp:11
core::Socket::ePoll
EPoll & ePoll
Definition: Socket.h:117
core::EPoll
Definition: EPoll.h:31
core::Timer::getEpoch
double getEpoch()
Definition: Timer.cpp:58
core::Timer
Definition: Timer.h:18
core::Timer::clearTimer
void clearTimer()
Definition: Timer.cpp:34
core::Socket
Definition: Socket.h:33
core
Definition: Command.cpp:5
core::Timer::Timer
Timer(EPoll &ePoll)
core::Timer::onTimeout
virtual void onTimeout()=0
EPoll.h
core::Timer::getElapsed
double getElapsed()
Definition: Timer.cpp:47
core::Timer::setTimer
void setTimer(double delay)
Definition: Timer.cpp:14
Socket.h