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

#include <GenericFrameSequences.h>

Inheritance diagram for inet::ieee80211::SequentialFs:
inet::ieee80211::IFrameSequence

Public Member Functions

virtual ~SequentialFs ()
 
 SequentialFs (std::vector< IFrameSequence * > elements)
 
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
 

Constructor & Destructor Documentation

inet::ieee80211::SequentialFs::~SequentialFs ( )
virtual
70 {
71  for (auto element : elements)
72  delete element;
73 }
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39
inet::ieee80211::SequentialFs::SequentialFs ( std::vector< IFrameSequence * >  elements)
23  :
25 {
26 }
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39

Member Function Documentation

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

Implements inet::ieee80211::IFrameSequence.

53 {
54  step++;
55  return elements[elementIndex]->completeStep(context);
56 }
int step
Definition: GenericFrameSequences.h:37
int elementIndex
Definition: GenericFrameSequences.h:38
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39
std::string inet::ieee80211::SequentialFs::getHistory ( )
overridevirtual

Implements inet::ieee80211::IFrameSequence.

59 {
60  ASSERT(step != -1);
61  std::string history = "(";
62  for (int i = 0; i < std::min(elementIndex + 1, (int)elements.size()); i++)
63  history += (i == 0 ? "" : " ") + elements.at(i)->getHistory();
64  history += ")";
65  return history;
66 }
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SCTPAssociation.h:270
int step
Definition: GenericFrameSequences.h:37
int elementIndex
Definition: GenericFrameSequences.h:38
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39
IFrameSequenceStep * inet::ieee80211::SequentialFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

38 {
39  while (elementIndex < (int) elements.size()) {
40  auto elementStep = elements[elementIndex]->prepareStep(context);
41  if (elementStep != nullptr)
42  return elementStep;
43  else {
44  elementIndex++;
45  if (elementIndex < (int) elements.size())
47  }
48  }
49  return nullptr;
50 }
int firstStep
Definition: GenericFrameSequences.h:36
virtual void startSequence(FrameSequenceContext *context, int firstStep) override
Definition: GenericFrameSequences.cc:28
int step
Definition: GenericFrameSequences.h:37
int elementIndex
Definition: GenericFrameSequences.h:38
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39
void inet::ieee80211::SequentialFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

Referenced by prepareStep().

29 {
30  this->firstStep = firstStep;
31  step = 0;
32  elementIndex = 0;
33  if (elementIndex < (int) (elements.size()))
34  elements[elementIndex]->startSequence(context, firstStep);
35 }
int firstStep
Definition: GenericFrameSequences.h:36
int step
Definition: GenericFrameSequences.h:37
int elementIndex
Definition: GenericFrameSequences.h:38
std::vector< IFrameSequence * > elements
Definition: GenericFrameSequences.h:39

Member Data Documentation

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

Referenced by prepareStep(), and startSequence().

int inet::ieee80211::SequentialFs::step = -1
protected

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