INET Framework for OMNeT++/OMNEST
inet::ieee80211::DcfTransmitLifetimeHandler Class Reference

#include <DcfTransmitLifetimeHandler.h>

Inheritance diagram for inet::ieee80211::DcfTransmitLifetimeHandler:
inet::ieee80211::ITransmitLifetimeHandler

Public Member Functions

 DcfTransmitLifetimeHandler (simtime_t maxTransmitLifetime)
 
virtual void frameGotInProgess (Ieee80211DataFrame *frame)
 
virtual void frameTransmitted (Ieee80211DataFrame *frame)
 
virtual bool isLifetimeExpired (Ieee80211DataFrame *frame)
 
- Public Member Functions inherited from inet::ieee80211::ITransmitLifetimeHandler
virtual ~ITransmitLifetimeHandler ()
 

Protected Attributes

simtime_t maxTransmitLifetime
 
std::map< SequenceNumber, simtime_t > lifetimes
 

Constructor & Destructor Documentation

inet::ieee80211::DcfTransmitLifetimeHandler::DcfTransmitLifetimeHandler ( simtime_t  maxTransmitLifetime)
inline
36  { }
simtime_t maxTransmitLifetime
Definition: DcfTransmitLifetimeHandler.h:31

Member Function Documentation

void inet::ieee80211::DcfTransmitLifetimeHandler::frameGotInProgess ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

24 {
25  // don't care
26 }
void inet::ieee80211::DcfTransmitLifetimeHandler::frameTransmitted ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

34 {
35  if (frame->getFragmentNumber() == 0)
36  lifetimes[frame->getSequenceNumber()] = simTime();
37 }
std::map< SequenceNumber, simtime_t > lifetimes
Definition: DcfTransmitLifetimeHandler.h:32
bool inet::ieee80211::DcfTransmitLifetimeHandler::isLifetimeExpired ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

44 {
45  auto it = lifetimes.find(frame->getSequenceNumber());
46  if (it == lifetimes.end())
47  throw cRuntimeError("There is no lifetime entry for frame = %s", frame->getName());
48  return (simTime() - it->second) >= maxTransmitLifetime;
49 }
simtime_t maxTransmitLifetime
Definition: DcfTransmitLifetimeHandler.h:31
std::map< SequenceNumber, simtime_t > lifetimes
Definition: DcfTransmitLifetimeHandler.h:32

Member Data Documentation

std::map<SequenceNumber, simtime_t> inet::ieee80211::DcfTransmitLifetimeHandler::lifetimes
protected
simtime_t inet::ieee80211::DcfTransmitLifetimeHandler::maxTransmitLifetime
protected

Referenced by isLifetimeExpired().


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