EMANE  1.2.1
EMANE::TimerServiceProxy Class Reference

#include <timerserviceproxy.h>

Inheritance diagram for EMANE::TimerServiceProxy:
EMANE::TimerServiceProvider EMANE::TimerServiceUser

Public Types

using TimerCallback = std::function< void(const TimePoint &, const TimePoint &, const TimePoint &)>
 

Public Member Functions

 TimerServiceProxy ()
 
 ~TimerServiceProxy ()
 
bool cancelTimedEvent (TimerEventId eventId) override
 
TimerEventId scheduleTimedEvent (const TimePoint &timeout, const void *arg, const Duration &interval) override
 
void processTimedEvent (TimerEventId eventId, const TimePoint &requestedExpireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg) override
 
void setTimerServiceUser (TimerServiceUser *pTimerServiceUser)
 
template<typename Function >
TimerEventId schedule (Function fn, const TimePoint &timePoint, const Duration &interval=Duration::zero())
 
template<typename Function >
EMANE::TimerEventId schedule (Function fn, const TimePoint &timePoint, const Duration &interval)
 

Protected Member Functions

TimerEventId schedule_i (TimerCallback callback, const TimePoint &timePoint, const Duration &interval) override
 

Protected Attributes

TimerServiceUserpTimerServiceUser_
 

Detailed Description

Definition at line 44 of file timerserviceproxy.h.

Member Typedef Documentation

◆ TimerCallback

using EMANE::TimerServiceProvider::TimerCallback = std::function<void(const TimePoint &, const TimePoint &, const TimePoint &)>
inherited

Definition at line 100 of file timerserviceprovider.h.

Constructor & Destructor Documentation

◆ TimerServiceProxy()

EMANE::TimerServiceProxy::TimerServiceProxy ( )

Definition at line 38 of file timerserviceproxy.cc.

◆ ~TimerServiceProxy()

EMANE::TimerServiceProxy::~TimerServiceProxy ( )

Definition at line 41 of file timerserviceproxy.cc.

Member Function Documentation

◆ cancelTimedEvent()

bool EMANE::TimerServiceProxy::cancelTimedEvent ( TimerEventId  eventId)
overridevirtual

Cancels a timed event

Parameters
eventIdevent id
Note
It is not an error to cancel an event that has already occured.

Implements EMANE::TimerServiceProvider.

Definition at line 49 of file timerserviceproxy.cc.

◆ processTimedEvent()

void EMANE::TimerServiceProxy::processTimedEvent ( TimerEventId  eventId,
const TimePoint expireTime,
const TimePoint scheduleTime,
const TimePoint fireTime,
const void *  arg 
)
overridevirtual

Process a timed event

Parameters
eventIdIdentifier corresponding to the timer being processed
expireTimeThe time the timer was scheduled to expire
scheduleTimeThe Time the timer was scheduled
fireTimeTime time The time the timer actually fired
argOpaque timed event data
Note
All times are abosulte using CLOCK_REALTIME

Reimplemented from EMANE::TimerServiceUser.

Definition at line 64 of file timerserviceproxy.cc.

◆ schedule() [1/2]

template<typename Function >
EMANE::TimerEventId EMANE::TimerServiceProvider::schedule ( Function  fn,
const TimePoint timePoint,
const Duration interval 
)
inherited

Definition at line 34 of file timerserviceprovider.inl.

◆ schedule() [2/2]

template<typename Function >
TimerEventId EMANE::TimerServiceProvider::schedule ( Function  fn,
const TimePoint timePoint,
const Duration interval = Duration::zero() 
)
inherited

Schedules an generic interval timer callable

Parameters
fnA callable object
absoluteTimePointAbsolute time of the timeout
intervalRepeat interval

◆ schedule_i()

EMANE::TimerEventId EMANE::TimerServiceProxy::schedule_i ( TimerCallback  callback,
const TimePoint timePoint,
const Duration interval 
)
overrideprotectedvirtual

Implements EMANE::TimerServiceProvider.

Definition at line 77 of file timerserviceproxy.cc.

◆ scheduleTimedEvent()

EMANE::TimerEventId EMANE::TimerServiceProxy::scheduleTimedEvent ( const TimePoint timePoint,
const void *  arg,
const Duration interval 
)
overridevirtual

Schedules a timed event

Parameters
timePointSchedule absolute time for timer to go off
argOpaque data pointer
intervalTimer reschedule interval. Default is one shot.
Returns
timer id

Implements EMANE::TimerServiceProvider.

Definition at line 54 of file timerserviceproxy.cc.

◆ setTimerServiceUser()

void EMANE::TimerServiceProxy::setTimerServiceUser ( TimerServiceUser pTimerServiceUser)

Definition at line 44 of file timerserviceproxy.cc.

Member Data Documentation

◆ pTimerServiceUser_

TimerServiceUser* EMANE::TimerServiceProxy::pTimerServiceUser_
protected

Definition at line 67 of file timerserviceproxy.h.


The documentation for this class was generated from the following files: