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

#include <ConstantGainAntenna.h>

Inheritance diagram for inet::physicallayer::ConstantGainAntenna:
inet::physicallayer::AntennaBase inet::physicallayer::IAntenna inet::IPrintableObject

Classes

class  AntennaGain
 

Public Member Functions

 ConstantGainAntenna ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
virtual Ptr< const IAntennaGaingetGain () const override
 Returns the antenna's gain calculator for directional selectivity. More...
 
- Public Member Functions inherited from inet::physicallayer::AntennaBase
 AntennaBase ()
 
virtual bool isDirectional () const override
 Returns true if the antenna has directional selectivity (i.e. More...
 
virtual IMobilitygetMobility () const override
 Returns the mobility of this antenna that describes its position and orientation over time. More...
 
virtual int getNumAntennas () const override
 Returns the number of antennas in the array. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

virtual void initialize (int stage) override
 

Protected Attributes

Ptr< AntennaGaingain
 
- Protected Attributes inherited from inet::physicallayer::AntennaBase
opp_component_ptr< IMobilitymobility
 
int numAntennas
 

Additional Inherited Members

- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Constructor & Destructor Documentation

◆ ConstantGainAntenna()

inet::physicallayer::ConstantGainAntenna::ConstantGainAntenna ( )
16  :
17  AntennaBase()
18 {
19 }

Member Function Documentation

◆ getGain()

virtual Ptr<const IAntennaGain> inet::physicallayer::ConstantGainAntenna::getGain ( ) const
inlineoverridevirtual

Returns the antenna's gain calculator for directional selectivity.

This object may be copied as needed, i.e. IAntennaGain objects are expected to have no reference to other objects.

Implements inet::physicallayer::IAntenna.

39 { return gain; }

◆ initialize()

void inet::physicallayer::ConstantGainAntenna::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::AntennaBase.

22 {
24  if (stage == INITSTAGE_LOCAL)
25  gain = makeShared<AntennaGain>(math::dB2fraction(par("gain")));
26 }

◆ printToStream()

std::ostream & inet::physicallayer::ConstantGainAntenna::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

Prints this object to the provided output stream.

Reimplemented from inet::physicallayer::AntennaBase.

29 {
30  stream << "ConstantGainAntenna";
31  if (level <= PRINT_LEVEL_DETAIL)
32  stream << EV_FIELD(gain, gain->getMaxGain());
33  return AntennaBase::printToStream(stream, level);
34 }

Member Data Documentation

◆ gain

Ptr<AntennaGain> inet::physicallayer::ConstantGainAntenna::gain
protected

Referenced by initialize(), and printToStream().


The documentation for this class was generated from the following files:
inet::physicallayer::AntennaBase::AntennaBase
AntennaBase()
Definition: AntennaBase.cc:16
inet::IPrintableObject::PRINT_LEVEL_DETAIL
@ PRINT_LEVEL_DETAIL
Definition: IPrintableObject.h:24
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::math::dB2fraction
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:153
inet::physicallayer::AntennaBase::initialize
virtual void initialize(int stage) override
Definition: AntennaBase.cc:22
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::physicallayer::ConstantGainAntenna::gain
Ptr< AntennaGain > gain
Definition: ConstantGainAntenna.h:33
inet::physicallayer::AntennaBase::printToStream
virtual std::ostream & printToStream(std::ostream &stream, int level, int evFlags=0) const override
Prints this object to the provided output stream.
Definition: AntennaBase.cc:32