47 return m_time.s == 1 ;
50 bool GNet::TimerBase::expired(
G::EpochTime & now )
const
56 else if( immediate() )
63 return m_time <= now ;
88 void GNet::TimerBase::doTimeout()
90 G_ASSERT( active() ) ;
96 catch( std::exception & e )
98 G_DEBUG(
"GNet::TimerBase::doTimeout: exception from timeout handler being passed back: " << e.what() ) ;
A subsecond-resolution timestamp based on a time_t.
TimerBase()
Default constructor.
Overload discriminator class for TimerList.
static EpochTime now()
Returns the current epoch time.
static TimerList & instance()
Singleton access. Throws an exception if none.
void add(TimerBase &)
Adds a timer.
void cancelTimer()
Cancels the timer.
void startTimer(unsigned int interval_s, unsigned int interval_us=0U)
Starts the timer so that it goes off after the given time interval.
virtual ~TimerBase()
Destructor.
void update(TimerBase &)
Called when a timer changes its value.
bool immediate() const
Returns true if the timer is active() and zero-length.
void remove(TimerBase &)
Removes a timer from the list.