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

#include <RateControlBase.h>

Inheritance diagram for inet::ieee80211::RateControlBase:
inet::ieee80211::ModeSetListener inet::ieee80211::IRateControl inet::ieee80211::AARFRateControl inet::ieee80211::OnoeRateControl

Static Public Attributes

static simsignal_t datarateSignal = cComponent::registerSignal("datarate")
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
virtual void emitDatarateSignal ()
 
const IIeee80211ModeincreaseRateIfPossible (const IIeee80211Mode *currentMode)
 
const IIeee80211ModedecreaseRateIfPossible (const IIeee80211Mode *currentMode)
 

Protected Attributes

const IIeee80211ModecurrentMode = nullptr
 
- Protected Attributes inherited from inet::ieee80211::ModeSetListener
Ieee80211ModeSetmodeSet = nullptr
 

Additional Inherited Members

- Public Member Functions inherited from inet::ieee80211::IRateControl
virtual ~IRateControl ()
 
virtual const IIeee80211ModegetRate ()=0
 
virtual void frameTransmitted (const Ieee80211Frame *frame, int retryCount, bool isSuccessful, bool isGivenUp)=0
 
virtual void frameReceived (const Ieee80211Frame *frame, const Ieee80211ReceptionIndication *receptionIndication)=0
 

Member Function Documentation

const IIeee80211Mode * inet::ieee80211::RateControlBase::decreaseRateIfPossible ( const IIeee80211Mode currentMode)
protected

Referenced by inet::ieee80211::OnoeRateControl::computeMode(), and inet::ieee80211::AARFRateControl::frameTransmitted().

38 {
39  const IIeee80211Mode *newMode = modeSet->getSlowerMode(currentMode);
40  return newMode == nullptr ? currentMode : newMode;
41 }
const IIeee80211Mode * getSlowerMode(const IIeee80211Mode *mode) const
Definition: Ieee80211ModeSet.cc:221
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
Definition: IIeee80211Mode.h:54
void inet::ieee80211::RateControlBase::emitDatarateSignal ( )
protectedvirtual

Referenced by inet::ieee80211::OnoeRateControl::computeMode(), inet::ieee80211::AARFRateControl::frameTransmitted(), inet::ieee80211::AARFRateControl::increaseRateIfTimerIsExpired(), and receiveSignal().

44 {
46  emit(datarateSignal, rate.get());
47 }
virtual const IIeee80211DataMode * getDataMode() const =0
const value_type & get() const
Definition: Units.h:89
virtual bps getNetBitrate() const =0
static simsignal_t datarateSignal
Definition: RateControlBase.h:30
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
Definition: Units.h:69
const IIeee80211Mode * inet::ieee80211::RateControlBase::increaseRateIfPossible ( const IIeee80211Mode currentMode)
protected

Referenced by inet::ieee80211::OnoeRateControl::computeMode(), inet::ieee80211::AARFRateControl::frameTransmitted(), and inet::ieee80211::AARFRateControl::increaseRateIfTimerIsExpired().

32 {
33  const IIeee80211Mode *newMode = modeSet->getFasterMode(currentMode);
34  return newMode == nullptr ? currentMode : newMode;
35 }
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
const IIeee80211Mode * getFasterMode(const IIeee80211Mode *mode) const
Definition: Ieee80211ModeSet.cc:230
Definition: IIeee80211Mode.h:54
void inet::ieee80211::RateControlBase::initialize ( int  stage)
overrideprotectedvirtual
virtual int inet::ieee80211::RateControlBase::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

Reimplemented in inet::ieee80211::AARFRateControl, and inet::ieee80211::OnoeRateControl.

36 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::ieee80211::RateControlBase::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

50 {
51  Enter_Method("receiveModeSetChangeNotification");
52  if (signalID == NF_MODESET_CHANGED) {
53  modeSet = check_and_cast<Ieee80211ModeSet*>(obj);
54  double initRate = par("initialRate");
55  currentMode = initRate == -1 ? modeSet->getFastestMandatoryMode() : modeSet->getMode(bps(initRate));
57  }
58 }
Definition: Ieee80211ModeSet.h:28
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
compose< b, pow< s,-1 > > bps
Definition: Units.h:985
const IIeee80211Mode * getMode(bps bitrate) const
Definition: Ieee80211ModeSet.cc:202
simsignal_t NF_MODESET_CHANGED
Definition: NotifierConsts.cc:46
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
virtual void emitDatarateSignal()
Definition: RateControlBase.cc:43
const IIeee80211Mode * getFastestMandatoryMode() const
Definition: Ieee80211ModeSet.cc:247

Member Data Documentation

simsignal_t inet::ieee80211::RateControlBase::datarateSignal = cComponent::registerSignal("datarate")
static

Referenced by emitDatarateSignal().


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