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

#include <APSKModulator.h>

Inheritance diagram for inet::physicallayer::APSKModulator:
inet::physicallayer::IModulator inet::physicallayer::IPrintableObject

Public Member Functions

 APSKModulator ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const IModulationgetModulation () const override
 
virtual const ITransmissionSymbolModelmodulate (const ITransmissionBitModel *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 APSKModulationBasemodulation
 

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::APSKModulator::APSKModulator ( )
30  :
31  modulation(nullptr)
32 {
33 }
const APSKModulationBase * modulation
Definition: APSKModulator.h:34

Member Function Documentation

virtual const IModulation* inet::physicallayer::APSKModulator::getModulation ( ) const
inlineoverridevirtual

Implements inet::physicallayer::IModulator.

44 { return modulation; }
const APSKModulationBase * modulation
Definition: APSKModulator.h:34
void inet::physicallayer::APSKModulator::initialize ( int  stage)
overrideprotectedvirtual
36 {
37  if (stage == INITSTAGE_LOCAL)
39 }
static const APSKModulationBase * findModulation(const char *name)
Definition: APSKModulationBase.cc:47
const APSKModulationBase * modulation
Definition: APSKModulator.h:34
Local initializations.
Definition: InitStages.h:35
const ITransmissionSymbolModel * inet::physicallayer::APSKModulator::modulate ( const ITransmissionBitModel bitModel) const
overridevirtual

Implements inet::physicallayer::IModulator.

50 {
51  const BitVector *bits = bitModel->getBits();
52  unsigned int codeWordSize = modulation->getCodeWordSize();
53  if (bits->getSize() % codeWordSize != 0)
54  throw cRuntimeError("Invalid bit length for code word size");
55  ShortBitVector symbolBits;
56  std::vector<const ISymbol *> *symbols = new std::vector<const ISymbol *>();
57  for (unsigned int i = 0; i < bits->getSize(); i++) {
58  symbolBits.setBit(i % codeWordSize, bits->getBit(i));
59  if (i % codeWordSize == codeWordSize - 1)
60  symbols->push_back(modulation->mapToConstellationDiagram(symbolBits));
61  }
62  // TODO: double symbolRate = bitModel->getBitRate() / modulation->getCodeWordSize();
63  return new TransmissionSymbolModel(symbols->size(), NaN, symbols->size(), NaN, symbols, modulation, modulation);
64 }
const APSKModulationBase * modulation
Definition: APSKModulator.h:34
#define NaN
Definition: INETMath.h:103
virtual const APSKSymbol * mapToConstellationDiagram(const ShortBitVector &symbol) const
Definition: APSKModulationBase.cc:69
virtual unsigned int getCodeWordSize() const override
Definition: APSKModulationBase.h:47
virtual int inet::physicallayer::APSKModulator::numInitStages ( ) const
inlineoverrideprotectedvirtual
37 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
std::ostream & inet::physicallayer::APSKModulator::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.

42 {
43  stream << "APSKModulator";
44  if (level <= PRINT_LEVEL_TRACE)
45  stream << ", modulation = " << printObjectToString(modulation, level + 1);
46  return stream;
47 }
std::string printObjectToString(const IPrintableObject *object, int level)
Definition: IPrintableObject.h:73
const APSKModulationBase * modulation
Definition: APSKModulator.h:34

Member Data Documentation

const APSKModulationBase* inet::physicallayer::APSKModulator::modulation
protected

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


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