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

#include <ScalarSNIR.h>

Inheritance diagram for inet::physicallayer::ScalarSNIR:
inet::physicallayer::SNIRBase inet::physicallayer::ISNIR inet::physicallayer::IPrintableObject

Public Member Functions

 ScalarSNIR (const IReception *reception, const INoise *noise)
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual double getMin () const override
 
- Public Member Functions inherited from inet::physicallayer::SNIRBase
 SNIRBase (const IReception *reception, const INoise *noise)
 
virtual const IReceptiongetReception () const override
 
virtual const INoisegetNoise () 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 double computeMin () const
 

Protected Attributes

double minSNIR
 
- Protected Attributes inherited from inet::physicallayer::SNIRBase
const IReceptionreception
 
const INoisenoise
 

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::ScalarSNIR::ScalarSNIR ( const IReception reception,
const INoise noise 
)
26  :
28  minSNIR(NaN)
29 {
30 }
const IReception * reception
Definition: SNIRBase.h:32
const INoise * noise
Definition: SNIRBase.h:33
#define NaN
Definition: INETMath.h:103
SNIRBase(const IReception *reception, const INoise *noise)
Definition: SNIRBase.cc:24
double minSNIR
Definition: ScalarSNIR.h:30

Member Function Documentation

double inet::physicallayer::ScalarSNIR::computeMin ( ) const
protectedvirtual

Referenced by getMin().

41 {
42  const IScalarSignal *scalarSignalAnalogModel = check_and_cast<const IScalarSignal *>(reception->getAnalogModel());
43  const ScalarNoise *scalarNoise = check_and_cast<const ScalarNoise *>(noise);
44  return unit(scalarSignalAnalogModel->getPower() / scalarNoise->computeMaxPower(reception->getStartTime(), reception->getEndTime())).get();
45 }
const IReception * reception
Definition: SNIRBase.h:32
const INoise * noise
Definition: SNIRBase.h:33
pow< internal::none, 0 > unit
Definition: Units.h:60
virtual const simtime_t getEndTime() const =0
Returns the time when the receiver ended to receive the corresponding transmission.
virtual const simtime_t getStartTime() const =0
Returns the time when the receiver started to receive the corresponding transmission.
virtual const IReceptionAnalogModel * getAnalogModel() const =0
Returns the analog model of the received signal.
double inet::physicallayer::ScalarSNIR::getMin ( ) const
overridevirtual

Implements inet::physicallayer::ISNIR.

48 {
49  if (std::isnan(minSNIR))
50  minSNIR = computeMin();
51  return minSNIR;
52 }
virtual double computeMin() const
Definition: ScalarSNIR.cc:40
double minSNIR
Definition: ScalarSNIR.h:30
std::ostream & inet::physicallayer::ScalarSNIR::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::SNIRBase.

33 {
34  stream << "ScalarSNIR";
35  if (level <= PRINT_LEVEL_DETAIL)
36  stream << ", minSNIR = " << minSNIR;
37  return stream;
38 }
double minSNIR
Definition: ScalarSNIR.h:30

Member Data Documentation

double inet::physicallayer::ScalarSNIR::minSNIR
mutableprotected

Referenced by getMin(), and printToStream().


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