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

#include <GenericFrameSequences.h>

Inheritance diagram for inet::ieee80211::AlternativesFs:
inet::ieee80211::IFrameSequence inet::ieee80211::DcfFs inet::ieee80211::HcfFs inet::ieee80211::HtTxOpFs inet::ieee80211::McfFs inet::ieee80211::PcfFs inet::ieee80211::TxOpFs

Public Member Functions

virtual ~AlternativesFs ()
 
 AlternativesFs (std::vector< IFrameSequence * > elements, std::function< int(AlternativesFs *, FrameSequenceContext *)> selector)
 
virtual int getStep ()
 
virtual int selectSequence (FrameSequenceContext *context)
 
virtual void startSequence (FrameSequenceContext *context, int firstStep) override
 
virtual IFrameSequenceStepprepareStep (FrameSequenceContext *context) override
 
virtual bool completeStep (FrameSequenceContext *context) override
 
virtual std::string getHistory () override
 
- Public Member Functions inherited from inet::ieee80211::IFrameSequence
virtual ~IFrameSequence ()
 

Protected Attributes

int firstStep = -1
 
int step = -1
 
int elementIndex = -1
 
std::vector< IFrameSequence * > elements
 
std::function< int(AlternativesFs *, FrameSequenceContext *)> selector
 

Constructor & Destructor Documentation

inet::ieee80211::AlternativesFs::~AlternativesFs ( )
virtual
202 {
203  for (auto element : elements)
204  delete element;
205 }
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
inet::ieee80211::AlternativesFs::AlternativesFs ( std::vector< IFrameSequence * >  elements,
std::function< int(AlternativesFs *, FrameSequenceContext *)>  selector 
)

Referenced by inet::ieee80211::DcfFs::DcfFs(), inet::ieee80211::HcfFs::HcfFs(), and inet::ieee80211::TxOpFs::TxOpFs().

170  :
173 {
174 }
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
std::function< int(AlternativesFs *, FrameSequenceContext *)> selector
Definition: GenericFrameSequences.h:105

Member Function Documentation

bool inet::ieee80211::AlternativesFs::completeStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

190 {
191  step++;
192  return elements[elementIndex]->completeStep(context);
193 }
int elementIndex
Definition: GenericFrameSequences.h:103
int step
Definition: GenericFrameSequences.h:102
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
std::string inet::ieee80211::AlternativesFs::getHistory ( )
overridevirtual

Implements inet::ieee80211::IFrameSequence.

196 {
197  ASSERT(step != -1);
198  return elements[elementIndex]->getHistory();
199 }
int elementIndex
Definition: GenericFrameSequences.h:103
int step
Definition: GenericFrameSequences.h:102
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
virtual int inet::ieee80211::AlternativesFs::getStep ( )
inlinevirtual
111 { return firstStep + step; }
int step
Definition: GenericFrameSequences.h:102
int firstStep
Definition: GenericFrameSequences.h:101
IFrameSequenceStep * inet::ieee80211::AlternativesFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

185 {
186  return elements[elementIndex]->prepareStep(context);
187 }
int elementIndex
Definition: GenericFrameSequences.h:103
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
virtual int inet::ieee80211::AlternativesFs::selectSequence ( FrameSequenceContext context)
inlinevirtual

Referenced by startSequence().

112 { return selector(this, context); }
std::function< int(AlternativesFs *, FrameSequenceContext *)> selector
Definition: GenericFrameSequences.h:105
void inet::ieee80211::AlternativesFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

177 {
178  this->firstStep = firstStep;
179  step = 0;
180  elementIndex = selectSequence(context);
181  elements[elementIndex]->startSequence(context, firstStep);
182 }
int elementIndex
Definition: GenericFrameSequences.h:103
int step
Definition: GenericFrameSequences.h:102
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:104
int firstStep
Definition: GenericFrameSequences.h:101
virtual int selectSequence(FrameSequenceContext *context)
Definition: GenericFrameSequences.h:112

Member Data Documentation

int inet::ieee80211::AlternativesFs::elementIndex = -1
protected
std::vector<IFrameSequence *> inet::ieee80211::AlternativesFs::elements
protected
int inet::ieee80211::AlternativesFs::firstStep = -1
protected

Referenced by startSequence().

std::function<int (AlternativesFs *, FrameSequenceContext *)> inet::ieee80211::AlternativesFs::selector
protected
int inet::ieee80211::AlternativesFs::step = -1
protected

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