EMANE  1.2.1
EMANE::NEMTimerServiceProxy Class Reference

#include <nemtimerserviceproxy.h>

Inheritance diagram for EMANE::NEMTimerServiceProxy:
EMANE::TimerServiceProvider EMANE::TimerServiceUser

Public Types

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

Public Member Functions

 NEMTimerServiceProxy ()
 
 ~NEMTimerServiceProxy ()
 
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 setNEMLayer (NEMQueuedLayer *pNEMQueuedLayer_)
 
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

NEMQueuedLayerpNEMQueuedLayer_
 

Detailed Description

Definition at line 43 of file nemtimerserviceproxy.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

◆ NEMTimerServiceProxy()

EMANE::NEMTimerServiceProxy::NEMTimerServiceProxy ( )

Definition at line 36 of file nemtimerserviceproxy.cc.

◆ ~NEMTimerServiceProxy()

EMANE::NEMTimerServiceProxy::~NEMTimerServiceProxy ( )

Definition at line 39 of file nemtimerserviceproxy.cc.

Member Function Documentation

◆ cancelTimedEvent()

bool EMANE::NEMTimerServiceProxy::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 47 of file nemtimerserviceproxy.cc.

◆ processTimedEvent()

void EMANE::NEMTimerServiceProxy::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 62 of file nemtimerserviceproxy.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::NEMTimerServiceProxy::schedule_i ( TimerCallback  callback,
const TimePoint timePoint,
const Duration interval 
)
overrideprotectedvirtual

Implements EMANE::TimerServiceProvider.

Definition at line 75 of file nemtimerserviceproxy.cc.

◆ scheduleTimedEvent()

EMANE::TimerEventId EMANE::NEMTimerServiceProxy::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 52 of file nemtimerserviceproxy.cc.

◆ setNEMLayer()

void EMANE::NEMTimerServiceProxy::setNEMLayer ( NEMQueuedLayer pNEMQueuedLayer_)

Definition at line 42 of file nemtimerserviceproxy.cc.

Member Data Documentation

◆ pNEMQueuedLayer_

NEMQueuedLayer* EMANE::NEMTimerServiceProxy::pNEMQueuedLayer_
protected

Definition at line 66 of file nemtimerserviceproxy.h.


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