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

#include <GenericFrameSequences.h>

Inheritance diagram for inet::ieee80211::OptionalFs:
inet::ieee80211::IFrameSequence

Public Member Functions

virtual ~OptionalFs ()
 
 OptionalFs (IFrameSequence *element, std::function< bool(OptionalFs *, FrameSequenceContext *)> predicate=nullptr)
 
virtual int getStep ()
 
virtual bool isSequenceApply (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
 
bool apply = false
 
IFrameSequenceelement
 
std::function< bool(OptionalFs *, FrameSequenceContext *)> predicate
 

Constructor & Destructor Documentation

virtual inet::ieee80211::OptionalFs::~OptionalFs ( )
inlinevirtual
61 { delete element; }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
inet::ieee80211::OptionalFs::OptionalFs ( IFrameSequence element,
std::function< bool(OptionalFs *, FrameSequenceContext *)>  predicate = nullptr 
)
76  :
77  element(element),
79 {
80 }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
std::function< bool(OptionalFs *, FrameSequenceContext *)> predicate
Definition: GenericFrameSequences.h:58

Member Function Documentation

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

Implements inet::ieee80211::IFrameSequence.

97 {
98  ASSERT(apply);
99  step++;
100  return element->completeStep(context);
101 }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
bool apply
Definition: GenericFrameSequences.h:56
virtual bool completeStep(FrameSequenceContext *context)=0
int step
Definition: GenericFrameSequences.h:55
std::string inet::ieee80211::OptionalFs::getHistory ( )
overridevirtual

Implements inet::ieee80211::IFrameSequence.

104 {
105  ASSERT(step != -1);
106  return apply ? "["+ element->getHistory() + "]" : "";
107 }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
bool apply
Definition: GenericFrameSequences.h:56
virtual std::string getHistory()=0
int step
Definition: GenericFrameSequences.h:55
virtual int inet::ieee80211::OptionalFs::getStep ( )
inlinevirtual
64 { return firstStep + step; }
int firstStep
Definition: GenericFrameSequences.h:54
int step
Definition: GenericFrameSequences.h:55
virtual bool inet::ieee80211::OptionalFs::isSequenceApply ( FrameSequenceContext context)
inlinevirtual

Referenced by startSequence().

65 { return predicate(this, context); }
std::function< bool(OptionalFs *, FrameSequenceContext *)> predicate
Definition: GenericFrameSequences.h:58
IFrameSequenceStep * inet::ieee80211::OptionalFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

92 {
93  return apply ? element->prepareStep(context) : nullptr;
94 }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
virtual IFrameSequenceStep * prepareStep(FrameSequenceContext *context)=0
bool apply
Definition: GenericFrameSequences.h:56
void inet::ieee80211::OptionalFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

83 {
84  this->firstStep = firstStep;
85  step = 0;
86  apply = isSequenceApply(context);
87  if (apply)
88  element->startSequence(context, firstStep);
89 }
IFrameSequence * element
Definition: GenericFrameSequences.h:57
int firstStep
Definition: GenericFrameSequences.h:54
virtual bool isSequenceApply(FrameSequenceContext *context)
Definition: GenericFrameSequences.h:65
bool apply
Definition: GenericFrameSequences.h:56
virtual void startSequence(FrameSequenceContext *context, int step)=0
int step
Definition: GenericFrameSequences.h:55

Member Data Documentation

bool inet::ieee80211::OptionalFs::apply = false
protected
IFrameSequence* inet::ieee80211::OptionalFs::element
protected
int inet::ieee80211::OptionalFs::firstStep = -1
protected

Referenced by startSequence().

std::function<bool (OptionalFs *, FrameSequenceContext *)> inet::ieee80211::OptionalFs::predicate
protected
int inet::ieee80211::OptionalFs::step = -1
protected

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