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

#include <Ieee80211OFDMEncoder.h>

Inheritance diagram for inet::physicallayer::Ieee80211OFDMEncoder:
inet::physicallayer::IEncoder inet::physicallayer::IPrintableObject

Public Member Functions

 Ieee80211OFDMEncoder (const Ieee80211OFDMCode *code)
 
 ~Ieee80211OFDMEncoder ()
 
virtual const ITransmissionBitModelencode (const ITransmissionPacketModel *packetModel) const override
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
const Ieee80211OFDMCodegetCode () 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 Attributes

const IFECCoderconvolutionalCoder = nullptr
 
const IInterleaverinterleaver = nullptr
 
const IScramblerscrambler = nullptr
 
const Ieee80211OFDMCodecode = nullptr
 

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::Ieee80211OFDMEncoder::Ieee80211OFDMEncoder ( const Ieee80211OFDMCode code)
70  :
71  convolutionalCoder(nullptr),
72  interleaver(nullptr),
73  scrambler(nullptr),
74  code(code)
75 {
76  if (code->getScrambling())
77  scrambler = new AdditiveScrambler(code->getScrambling());
78  if (code->getInterleaving())
79  interleaver = new Ieee80211OFDMInterleaver(code->getInterleaving());
81  convolutionalCoder = new ConvolutionalCoder(code->getConvolutionalCode());
82 }
const AdditiveScrambling * getScrambling() const
Definition: Ieee80211OFDMCode.h:43
const IFECCoder * convolutionalCoder
Definition: Ieee80211OFDMEncoder.h:37
const IScrambler * scrambler
Definition: Ieee80211OFDMEncoder.h:39
const Ieee80211OFDMInterleaving * getInterleaving() const
Definition: Ieee80211OFDMCode.h:42
const ConvolutionalCode * getConvolutionalCode() const
Definition: Ieee80211OFDMCode.h:41
const IInterleaver * interleaver
Definition: Ieee80211OFDMEncoder.h:38
const Ieee80211OFDMCode * code
Definition: Ieee80211OFDMEncoder.h:40
inet::physicallayer::Ieee80211OFDMEncoder::~Ieee80211OFDMEncoder ( )
85 {
86  delete convolutionalCoder;
87  delete interleaver;
88  delete scrambler;
89 }
const IFECCoder * convolutionalCoder
Definition: Ieee80211OFDMEncoder.h:37
const IScrambler * scrambler
Definition: Ieee80211OFDMEncoder.h:39
const IInterleaver * interleaver
Definition: Ieee80211OFDMEncoder.h:38

Member Function Documentation

const ITransmissionBitModel * inet::physicallayer::Ieee80211OFDMEncoder::encode ( const ITransmissionPacketModel packetModel) const
overridevirtual

Implements inet::physicallayer::IEncoder.

Referenced by inet::physicallayer::Ieee80211OFDMEncoderModule::encode(), and inet::physicallayer::Ieee80211LayeredOFDMTransmitter::encodeAndModulate().

46 {
47  const BitVector *serializedPacket = packetModel->getSerializedPacket();
48  BitVector *encodedBits = new BitVector(*serializedPacket);
49  const IScrambling *scrambling = nullptr;
50  if (scrambler) {
51  *encodedBits = scrambler->scramble(*encodedBits);
52  scrambling = scrambler->getScrambling();
53  EV_DEBUG << "Scrambled bits are: " << *encodedBits << endl;
54  }
55  const IForwardErrorCorrection *forwardErrorCorrection = nullptr;
56  if (convolutionalCoder) {
57  *encodedBits = convolutionalCoder->encode(*encodedBits);
58  forwardErrorCorrection = convolutionalCoder->getForwardErrorCorrection();
59  EV_DEBUG << "FEC encoded bits are: " << *encodedBits << endl;
60  }
61  const IInterleaving *interleaving = nullptr;
62  if (interleaver) {
63  *encodedBits = interleaver->interleave(*encodedBits);
64  interleaving = interleaver->getInterleaving();
65  EV_DEBUG << "Interleaved bits are: " << *encodedBits << endl;
66  }
67  return new TransmissionBitModel(encodedBits, forwardErrorCorrection, scrambling, interleaving);
68 }
virtual const IInterleaving * getInterleaving() const =0
virtual BitVector encode(const BitVector &informationBits) const =0
const IFECCoder * convolutionalCoder
Definition: Ieee80211OFDMEncoder.h:37
virtual BitVector scramble(const BitVector &bits) const =0
virtual const IScrambling * getScrambling() const =0
virtual const IForwardErrorCorrection * getForwardErrorCorrection() const =0
const IScrambler * scrambler
Definition: Ieee80211OFDMEncoder.h:39
virtual BitVector interleave(const BitVector &bits) const =0
const IInterleaver * interleaver
Definition: Ieee80211OFDMEncoder.h:38
const Ieee80211OFDMCode* inet::physicallayer::Ieee80211OFDMEncoder::getCode ( ) const
inlineoverridevirtual

Implements inet::physicallayer::IEncoder.

48 { return code; }
const Ieee80211OFDMCode * code
Definition: Ieee80211OFDMEncoder.h:40
std::ostream & inet::physicallayer::Ieee80211OFDMEncoder::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.

Referenced by inet::physicallayer::Ieee80211OFDMEncoderModule::printToStream().

35 {
36  stream << "Ieee80211OFDMEncoder";
37  if (level <= PRINT_LEVEL_TRACE)
38  stream << ", convolutionalCoder = " << printObjectToString(convolutionalCoder, level + 1)
39  << ", interleaver = " << printObjectToString(interleaver, level + 1)
40  << ", scrambler = " << printObjectToString(scrambler, level + 1)
41  << ", code = " << printObjectToString(code, level + 1);
42  return stream;
43 }
std::string printObjectToString(const IPrintableObject *object, int level)
Definition: IPrintableObject.h:73
const IFECCoder * convolutionalCoder
Definition: Ieee80211OFDMEncoder.h:37
const IScrambler * scrambler
Definition: Ieee80211OFDMEncoder.h:39
const IInterleaver * interleaver
Definition: Ieee80211OFDMEncoder.h:38
const Ieee80211OFDMCode * code
Definition: Ieee80211OFDMEncoder.h:40

Member Data Documentation

const Ieee80211OFDMCode* inet::physicallayer::Ieee80211OFDMEncoder::code = nullptr
protected

Referenced by printToStream().

const IFECCoder* inet::physicallayer::Ieee80211OFDMEncoder::convolutionalCoder = nullptr
protected
const IInterleaver* inet::physicallayer::Ieee80211OFDMEncoder::interleaver = nullptr
protected
const IScrambler* inet::physicallayer::Ieee80211OFDMEncoder::scrambler = nullptr
protected

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