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

#include <HcfFs.h>

Inheritance diagram for inet::ieee80211::HcfFs:
inet::ieee80211::AlternativesFs inet::ieee80211::IFrameSequence

Public Member Functions

 HcfFs ()
 
virtual ~HcfFs ()
 
virtual int selectHcfSequence (AlternativesFs *frameSequence, FrameSequenceContext *context)
 
virtual int selectDataOrManagementSequence (AlternativesFs *frameSequence, FrameSequenceContext *context)
 
virtual bool isSelfCtsNeeded (OptionalFs *frameSequence, FrameSequenceContext *context)
 
virtual bool hasMoreTxOps (RepeatingFs *frameSequence, FrameSequenceContext *context)
 
virtual bool hasMoreTxOpsAndMulticast (RepeatingFs *frameSequence, FrameSequenceContext *context)
 
- Public Member Functions inherited from inet::ieee80211::AlternativesFs
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 ()
 

Additional Inherited Members

- Protected Attributes inherited from inet::ieee80211::AlternativesFs
int firstStep = -1
 
int step = -1
 
int elementIndex = -1
 
std::vector< IFrameSequence * > elements
 
std::function< int(AlternativesFs *, FrameSequenceContext *)> selector
 

Constructor & Destructor Documentation

inet::ieee80211::HcfFs::HcfFs ( )
25  :
26  // G.3 EDCA and HCCA sequences
27  // hcf-sequence =
28  // ( [ CTS ] 1{( Data + group [+ QoS ] ) | Management + broadcast ) +pifs} |
29  // ( [ CTS ] 1{txop-sequence} ) |
30  // (* HC only, polled TXOP delivery *)
31  // ( [ RTS CTS ] non-cf-ack-piggybacked-qos-poll-sequence )
32  // (* HC only, polled TXOP delivery *)
33  // cf-ack-piggybacked-qos-poll-sequence |
34  // (* HC only, self TXOP delivery or termination *)
35  // Data + self + null + CF-Poll + QoS;
42 {
43 }
virtual bool hasMoreTxOps(RepeatingFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:67
AlternativesFs(std::vector< IFrameSequence * > elements, std::function< int(AlternativesFs *, FrameSequenceContext *)> selector)
Definition: GenericFrameSequences.cc:170
#define REPEATINGFS_PREDICATE(predicate)
Definition: GenericFrameSequences.h:31
virtual bool hasMoreTxOpsAndMulticast(RepeatingFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:77
Definition: PrimitiveFrameSequences.h:28
Definition: PrimitiveFrameSequences.h:41
virtual bool isSelfCtsNeeded(OptionalFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:62
virtual int selectDataOrManagementSequence(AlternativesFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:51
Definition: GenericFrameSequences.h:34
#define ALTERNATIVESFS_SELECTOR(selector)
Definition: GenericFrameSequences.h:32
#define OPTIONALFS_PREDICATE(predicate)
Definition: GenericFrameSequences.h:30
Definition: TxOpFs.h:27
virtual int selectHcfSequence(AlternativesFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:45
Definition: PrimitiveFrameSequences.h:68
Definition: GenericFrameSequences.h:74
Definition: GenericFrameSequences.h:52
virtual inet::ieee80211::HcfFs::~HcfFs ( )
inlinevirtual
29 { }

Member Function Documentation

bool inet::ieee80211::HcfFs::hasMoreTxOps ( RepeatingFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by hasMoreTxOpsAndMulticast(), and HcfFs().

68 {
69  bool hasFrameToTransmit = context->getInProgressFrames()->hasInProgressFrames();
70  if (hasFrameToTransmit) {
71  auto nextFrameToTransmit = context->getInProgressFrames()->getFrameToTransmit();
72  return frameSequence->getCount() == 0 || (!nextFrameToTransmit->getReceiverAddress().isMulticast() && context->getQoSContext()->txopProcedure->getRemaining() > 0);
73  }
74  return false;
75 }
virtual QoSContext * getQoSContext() const
Definition: FrameSequenceContext.h:92
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
TxopProcedure * txopProcedure
Definition: FrameSequenceContext.h:50
virtual bool hasInProgressFrames()
Definition: InProgressFrames.h:56
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
virtual simtime_t getRemaining() const
Definition: TxopProcedure.cc:93
virtual int getCount()
Definition: GenericFrameSequences.h:88
bool inet::ieee80211::HcfFs::hasMoreTxOpsAndMulticast ( RepeatingFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by HcfFs().

78 {
79  return hasMoreTxOps(frameSequence, context) && context->getInProgressFrames()->getFrameToTransmit()->getReceiverAddress().isMulticast();
80 }
virtual bool hasMoreTxOps(RepeatingFs *frameSequence, FrameSequenceContext *context)
Definition: HcfFs.cc:67
virtual MACAddress & getReceiverAddress()
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
bool isMulticast() const
Returns true if this is a multicast logical address (first byte&#39;s lsb is 1).
Definition: MACAddress.h:146
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
bool inet::ieee80211::HcfFs::isSelfCtsNeeded ( OptionalFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by HcfFs().

63 {
64  return false;
65 }
int inet::ieee80211::HcfFs::selectDataOrManagementSequence ( AlternativesFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by HcfFs().

52 {
53  auto frameToTransmit = context->getInProgressFrames()->getFrameToTransmit();
54  if (dynamic_cast<Ieee80211DataFrame*>(frameToTransmit))
55  return 0;
56  else if (dynamic_cast<Ieee80211ManagementFrame*>(frameToTransmit))
57  return 1;
58  else
59  throw cRuntimeError("frameToTransmit must be either a Data or a Management frame");
60 }
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
int inet::ieee80211::HcfFs::selectHcfSequence ( AlternativesFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by HcfFs().

46 {
47  auto frameToTransmit = context->getInProgressFrames()->getFrameToTransmit();
48  return frameToTransmit->getReceiverAddress().isMulticast() ? 0 : 1;
49 }
virtual MACAddress & getReceiverAddress()
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
bool isMulticast() const
Returns true if this is a multicast logical address (first byte&#39;s lsb is 1).
Definition: MACAddress.h:146
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87

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