INET Framework for OMNeT++/OMNEST
inet::physicallayer::APSKDecoder Class Reference

#include <APSKDecoder.h>

Inheritance diagram for inet::physicallayer::APSKDecoder:
inet::physicallayer::IDecoder inet::physicallayer::IPrintableObject

Public Member Functions

 APSKDecoder ()
 
virtual ~APSKDecoder ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const APSKCodegetCode () const
 
virtual const IReceptionPacketModeldecode (const IReceptionBitModel *bitModel) const override
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 

Protected Attributes

const APSKCodecode
 
const IScramblerdescrambler
 
const IFECCoderfecDecoder
 
const IInterleaverdeinterleaver
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Constructor & Destructor Documentation

inet::physicallayer::APSKDecoder::APSKDecoder ( )
27  :
28  code(nullptr),
29  descrambler(nullptr),
30  fecDecoder(nullptr),
31  deinterleaver(nullptr)
32 {
33 }
const APSKCode * code
Definition: APSKDecoder.h:31
const IInterleaver * deinterleaver
Definition: APSKDecoder.h:34
const IScrambler * descrambler
Definition: APSKDecoder.h:32
const IFECCoder * fecDecoder
Definition: APSKDecoder.h:33
inet::physicallayer::APSKDecoder::~APSKDecoder ( )
virtual
36 {
37  delete code;
38 }
const APSKCode * code
Definition: APSKDecoder.h:31

Member Function Documentation

const IReceptionPacketModel * inet::physicallayer::APSKDecoder::decode ( const IReceptionBitModel bitModel) const
overridevirtual

Implements inet::physicallayer::IDecoder.

68 {
69  bool isPacketErrorless = true;
70  BitVector *decodedBits = new BitVector(*bitModel->getBits());
71  if (deinterleaver)
72  *decodedBits = deinterleaver->deinterleave(*decodedBits);
73  if (fecDecoder) {
74  std::pair<BitVector, bool> fecDecodedDataField = fecDecoder->decode(*decodedBits);
75  isPacketErrorless = fecDecodedDataField.second;
76  *decodedBits = fecDecodedDataField.first;
77  }
78  if (descrambler)
79  *decodedBits = descrambler->descramble(*decodedBits);
80  return new ReceptionPacketModel(nullptr, decodedBits, bps(NaN), -1, isPacketErrorless);
81 }
const IInterleaver * deinterleaver
Definition: APSKDecoder.h:34
const IScrambler * descrambler
Definition: APSKDecoder.h:32
compose< b, pow< s,-1 > > bps
Definition: Units.h:985
#define NaN
Definition: INETMath.h:103
const IFECCoder * fecDecoder
Definition: APSKDecoder.h:33
virtual std::pair< BitVector, bool > decode(const BitVector &encodedBits) const =0
virtual BitVector deinterleave(const BitVector &bits) const =0
virtual BitVector descramble(const BitVector &bits) const =0
virtual const APSKCode* inet::physicallayer::APSKDecoder::getCode ( ) const
inlinevirtual
45 { return code; }
const APSKCode * code
Definition: APSKDecoder.h:31
void inet::physicallayer::APSKDecoder::initialize ( int  stage)
overrideprotectedvirtual
41 {
42  if (stage == INITSTAGE_LOCAL) {
43  descrambler = dynamic_cast<const IScrambler *>(getSubmodule("descrambler"));
44  fecDecoder = dynamic_cast<const IFECCoder *>(getSubmodule("fecDecoder"));
45  deinterleaver = dynamic_cast<const IInterleaver *>(getSubmodule("deinterleaver"));
46  }
47  else if (stage == INITSTAGE_PHYSICAL_LAYER) {
48  const IScrambling *scrambling = descrambler != nullptr ? descrambler->getScrambling() : nullptr;
49  const ConvolutionalCode *forwardErrorCorrection = fecDecoder != nullptr ? check_and_cast<const ConvolutionalCode *>(fecDecoder->getForwardErrorCorrection()) : nullptr;
50  const IInterleaving *interleaving = deinterleaver != nullptr ? deinterleaver->getInterleaving() : nullptr;
51  code = new APSKCode(forwardErrorCorrection, interleaving, scrambling);
52  }
53 }
const APSKCode * code
Definition: APSKDecoder.h:31
Initialization of the physical layer of protocol stacks.
Definition: InitStages.h:53
virtual const IInterleaving * getInterleaving() const =0
const IInterleaver * deinterleaver
Definition: APSKDecoder.h:34
const IScrambler * descrambler
Definition: APSKDecoder.h:32
virtual const IScrambling * getScrambling() const =0
Local initializations.
Definition: InitStages.h:35
virtual const IForwardErrorCorrection * getForwardErrorCorrection() const =0
const IFECCoder * fecDecoder
Definition: APSKDecoder.h:33
virtual int inet::physicallayer::APSKDecoder::numInitStages ( ) const
inlineoverrideprotectedvirtual
37 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
std::ostream & inet::physicallayer::APSKDecoder::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::IPrintableObject.

56 {
57  stream << "APSKDecoder";
58  if (level <= PRINT_LEVEL_DETAIL)
59  stream << ", code = " << code;
60  if (level <= PRINT_LEVEL_TRACE)
61  stream << ", descrambler = " << printObjectToString(descrambler, level + 1)
62  << ", fecDecoder = " << printObjectToString(fecDecoder, level + 1)
63  << ", deinterleaver = " << printObjectToString(deinterleaver, level + 1);
64  return stream;
65 }
const APSKCode * code
Definition: APSKDecoder.h:31
std::string printObjectToString(const IPrintableObject *object, int level)
Definition: IPrintableObject.h:73
const IInterleaver * deinterleaver
Definition: APSKDecoder.h:34
const IScrambler * descrambler
Definition: APSKDecoder.h:32
const IFECCoder * fecDecoder
Definition: APSKDecoder.h:33

Member Data Documentation

const APSKCode* inet::physicallayer::APSKDecoder::code
protected
const IInterleaver* inet::physicallayer::APSKDecoder::deinterleaver
protected

Referenced by decode(), initialize(), and printToStream().

const IScrambler* inet::physicallayer::APSKDecoder::descrambler
protected

Referenced by decode(), initialize(), and printToStream().

const IFECCoder* inet::physicallayer::APSKDecoder::fecDecoder
protected

Referenced by decode(), initialize(), and printToStream().


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