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

#include <TransmissionBase.h>

Inheritance diagram for inet::physicallayer::TransmissionBase:
inet::physicallayer::ITransmission inet::physicallayer::ITransmissionAnalogModel inet::physicallayer::IPrintableObject inet::physicallayer::ISignalAnalogModel inet::physicallayer::IPrintableObject inet::physicallayer::IdealTransmission inet::physicallayer::LayeredTransmission inet::physicallayer::NarrowbandTransmissionBase inet::physicallayer::Ieee80211IdealTransmission inet::physicallayer::FlatTransmissionBase inet::physicallayer::DimensionalTransmission inet::physicallayer::ScalarTransmission inet::physicallayer::Ieee80211DimensionalTransmission inet::physicallayer::Ieee80211ScalarTransmission

Public Member Functions

 TransmissionBase (const IRadio *transmitter, const cPacket *macFrame, const simtime_t startTime, const simtime_t endTime, const simtime_t preambleDuration, const simtime_t headerDuration, const simtime_t dataDuration, const Coord startPosition, const Coord endPosition, const EulerAngles startOrientation, const EulerAngles endOrientation)
 
virtual int getId () const override
 Returns an identifier for this transmission which is globally unique for the whole lifetime of the simulation among all transmissions. More...
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const IRadiogetTransmitter () const override
 Returns the transmitter that transmitted this radio signal on the radio channel. More...
 
virtual const cPacket * getPhyFrame () const override
 Returns the PHY frame corresponding to this transmission. More...
 
virtual const cPacket * getMacFrame () const override
 Returns the MAC frame corresponding to this transmission. More...
 
virtual const simtime_t getStartTime () const override
 Returns the time when the transmitter started this transmission. More...
 
virtual const simtime_t getEndTime () const override
 Returns the time when the transmitter ended this transmission. More...
 
virtual const simtime_t getStartTime (IRadioSignal::SignalPart part) const override
 
virtual const simtime_t getEndTime (IRadioSignal::SignalPart part) const override
 
virtual const simtime_t getPreambleStartTime () const override
 
virtual const simtime_t getPreambleEndTime () const override
 
virtual const simtime_t getHeaderStartTime () const override
 
virtual const simtime_t getHeaderEndTime () const override
 
virtual const simtime_t getDataStartTime () const override
 
virtual const simtime_t getDataEndTime () const override
 
virtual const simtime_t getDuration () const override
 Returns the total length of this transmission. More...
 
virtual const simtime_t getDuration (IRadioSignal::SignalPart part) const override
 Returns the length of the provided part of this transmission. More...
 
virtual const simtime_t getPreambleDuration () const override
 Returns the length of the preamble part of this transmission. More...
 
virtual const simtime_t getHeaderDuration () const override
 Returns the length of the header part of this transmission. More...
 
virtual const simtime_t getDataDuration () const override
 Returns the length of the data part of this transmission. More...
 
virtual const Coord getStartPosition () const override
 Returns the antenna's position when the transmitter started this transmission. More...
 
virtual const Coord getEndPosition () const override
 Returns the antenna's position when the transmitter ended this transmission. More...
 
virtual const EulerAngles getStartOrientation () const override
 Returns the antenna's orientation when the transmitter started this transmission. More...
 
virtual const EulerAngles getEndOrientation () const override
 Returns the antenna's orientation when the transmitter ended this transmission. More...
 
virtual const ITransmissionAnalogModelgetAnalogModel () const override
 Returns the analog model of the transmitted signal. More...
 
- 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 int id
 
const IRadiotransmitter
 
const cPacket * macFrame
 
const simtime_t startTime
 
const simtime_t endTime
 
const simtime_t preambleDuration
 
const simtime_t headerDuration
 
const simtime_t dataDuration
 
const Coord startPosition
 
const Coord endPosition
 
const EulerAngles startOrientation
 
const EulerAngles endOrientation
 

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
}
 
- Static Protected Attributes inherited from inet::physicallayer::ITransmission
static int nextId = 0
 

Constructor & Destructor Documentation

inet::physicallayer::TransmissionBase::TransmissionBase ( const IRadio transmitter,
const cPacket *  macFrame,
const simtime_t  startTime,
const simtime_t  endTime,
const simtime_t  preambleDuration,
const simtime_t  headerDuration,
const simtime_t  dataDuration,
const Coord  startPosition,
const Coord  endPosition,
const EulerAngles  startOrientation,
const EulerAngles  endOrientation 
)
24  :
25  id(nextId++),
37 {
38 }
const Coord startPosition
Definition: TransmissionBase.h:39
const cPacket * macFrame
Definition: TransmissionBase.h:33
const EulerAngles endOrientation
Definition: TransmissionBase.h:42
const IRadio * transmitter
Definition: TransmissionBase.h:32
const Coord endPosition
Definition: TransmissionBase.h:40
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t dataDuration
Definition: TransmissionBase.h:38
const int id
Definition: TransmissionBase.h:31
const simtime_t preambleDuration
Definition: TransmissionBase.h:36
const simtime_t endTime
Definition: TransmissionBase.h:35
static int nextId
Definition: ITransmission.h:44
const EulerAngles startOrientation
Definition: TransmissionBase.h:41
const simtime_t headerDuration
Definition: TransmissionBase.h:37

Member Function Documentation

virtual const ITransmissionAnalogModel* inet::physicallayer::TransmissionBase::getAnalogModel ( ) const
inlineoverridevirtual

Returns the analog model of the transmitted signal.

Implements inet::physicallayer::ITransmission.

Reimplemented in inet::physicallayer::LayeredTransmission.

80 { return check_and_cast<const ITransmissionAnalogModel *>(this); }
virtual const simtime_t inet::physicallayer::TransmissionBase::getDataDuration ( ) const
inlineoverridevirtual

Returns the length of the data part of this transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getDuration().

72 { return dataDuration; }
const simtime_t dataDuration
Definition: TransmissionBase.h:38
virtual const simtime_t inet::physicallayer::TransmissionBase::getDataEndTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getEndTime().

65 { return endTime; }
const simtime_t endTime
Definition: TransmissionBase.h:35
virtual const simtime_t inet::physicallayer::TransmissionBase::getDataStartTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getStartTime().

64 { return endTime - dataDuration; }
const simtime_t dataDuration
Definition: TransmissionBase.h:38
const simtime_t endTime
Definition: TransmissionBase.h:35
virtual const simtime_t inet::physicallayer::TransmissionBase::getDuration ( ) const
inlineoverridevirtual

Returns the total length of this transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getDuration().

67 { return endTime - startTime; }
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t endTime
Definition: TransmissionBase.h:35
const simtime_t inet::physicallayer::TransmissionBase::getDuration ( IRadioSignal::SignalPart  part) const
overridevirtual

Returns the length of the provided part of this transmission.

Implements inet::physicallayer::ITransmission.

92 {
93  switch (part) {
95  return getDuration();
97  return getPreambleDuration();
99  return getHeaderDuration();
101  return getDataDuration();
102  default:
103  throw cRuntimeError("Unknown signal part: '%s'", IRadioSignal::getSignalPartName(part));
104  }
105 }
virtual const simtime_t getDataDuration() const override
Returns the length of the data part of this transmission.
Definition: TransmissionBase.h:72
virtual const simtime_t getHeaderDuration() const override
Returns the length of the header part of this transmission.
Definition: TransmissionBase.h:71
static const char * getSignalPartName(SignalPart signalPart)
Returns the name of the provided signal part.
Definition: IRadioSignal.cc:33
virtual const simtime_t getPreambleDuration() const override
Returns the length of the preamble part of this transmission.
Definition: TransmissionBase.h:70
virtual const simtime_t getDuration() const override
Returns the total length of this transmission.
Definition: TransmissionBase.h:67
virtual const EulerAngles inet::physicallayer::TransmissionBase::getEndOrientation ( ) const
inlineoverridevirtual

Returns the antenna's orientation when the transmitter ended this transmission.

Implements inet::physicallayer::ITransmission.

78 { return endOrientation; }
const EulerAngles endOrientation
Definition: TransmissionBase.h:42
virtual const Coord inet::physicallayer::TransmissionBase::getEndPosition ( ) const
inlineoverridevirtual

Returns the antenna's position when the transmitter ended this transmission.

Implements inet::physicallayer::ITransmission.

75 { return endPosition; }
const Coord endPosition
Definition: TransmissionBase.h:40
virtual const simtime_t inet::physicallayer::TransmissionBase::getEndTime ( ) const
inlineoverridevirtual

Returns the time when the transmitter ended this transmission.

It is the end of the last bit's transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getEndTime().

56 { return endTime; }
const simtime_t endTime
Definition: TransmissionBase.h:35
const simtime_t inet::physicallayer::TransmissionBase::getEndTime ( IRadioSignal::SignalPart  part) const
overridevirtual

Implements inet::physicallayer::ITransmission.

76 {
77  switch (part) {
79  return getEndTime();
81  return getPreambleEndTime();
83  return getHeaderEndTime();
85  return getDataEndTime();
86  default:
87  throw cRuntimeError("Unknown signal part: '%s'", IRadioSignal::getSignalPartName(part));
88  }
89 }
virtual const simtime_t getDataEndTime() const override
Definition: TransmissionBase.h:65
static const char * getSignalPartName(SignalPart signalPart)
Returns the name of the provided signal part.
Definition: IRadioSignal.cc:33
virtual const simtime_t getPreambleEndTime() const override
Definition: TransmissionBase.h:61
virtual const simtime_t getHeaderEndTime() const override
Definition: TransmissionBase.h:63
virtual const simtime_t getEndTime() const override
Returns the time when the transmitter ended this transmission.
Definition: TransmissionBase.h:56
virtual const simtime_t inet::physicallayer::TransmissionBase::getHeaderDuration ( ) const
inlineoverridevirtual

Returns the length of the header part of this transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getDuration().

71 { return headerDuration; }
const simtime_t headerDuration
Definition: TransmissionBase.h:37
virtual const simtime_t inet::physicallayer::TransmissionBase::getHeaderEndTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getEndTime().

63 { return endTime - dataDuration; }
const simtime_t dataDuration
Definition: TransmissionBase.h:38
const simtime_t endTime
Definition: TransmissionBase.h:35
virtual const simtime_t inet::physicallayer::TransmissionBase::getHeaderStartTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getStartTime().

62 { return startTime + preambleDuration; }
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t preambleDuration
Definition: TransmissionBase.h:36
virtual int inet::physicallayer::TransmissionBase::getId ( ) const
inlineoverridevirtual

Returns an identifier for this transmission which is globally unique for the whole lifetime of the simulation among all transmissions.

Implements inet::physicallayer::ITransmission.

47 { return id; }
const int id
Definition: TransmissionBase.h:31
virtual const cPacket* inet::physicallayer::TransmissionBase::getMacFrame ( ) const
inlineoverridevirtual

Returns the MAC frame corresponding to this transmission.

This function never returns nullptr.

Implements inet::physicallayer::ITransmission.

Reimplemented in inet::physicallayer::LayeredTransmission.

53 { return macFrame; }
const cPacket * macFrame
Definition: TransmissionBase.h:33
virtual const cPacket* inet::physicallayer::TransmissionBase::getPhyFrame ( ) const
inlineoverridevirtual

Returns the PHY frame corresponding to this transmission.

This function may return nullptr.

Implements inet::physicallayer::ITransmission.

Reimplemented in inet::physicallayer::LayeredTransmission.

52 { return nullptr; }
virtual const simtime_t inet::physicallayer::TransmissionBase::getPreambleDuration ( ) const
inlineoverridevirtual

Returns the length of the preamble part of this transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getDuration().

70 { return preambleDuration; }
const simtime_t preambleDuration
Definition: TransmissionBase.h:36
virtual const simtime_t inet::physicallayer::TransmissionBase::getPreambleEndTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getEndTime().

61 { return startTime + preambleDuration; }
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t preambleDuration
Definition: TransmissionBase.h:36
virtual const simtime_t inet::physicallayer::TransmissionBase::getPreambleStartTime ( ) const
inlineoverridevirtual

Implements inet::physicallayer::ITransmission.

Referenced by getStartTime().

60 { return startTime; }
const simtime_t startTime
Definition: TransmissionBase.h:34
virtual const EulerAngles inet::physicallayer::TransmissionBase::getStartOrientation ( ) const
inlineoverridevirtual

Returns the antenna's orientation when the transmitter started this transmission.

Implements inet::physicallayer::ITransmission.

77 { return startOrientation; }
const EulerAngles startOrientation
Definition: TransmissionBase.h:41
virtual const Coord inet::physicallayer::TransmissionBase::getStartPosition ( ) const
inlineoverridevirtual

Returns the antenna's position when the transmitter started this transmission.

Implements inet::physicallayer::ITransmission.

74 { return startPosition; }
const Coord startPosition
Definition: TransmissionBase.h:39
virtual const simtime_t inet::physicallayer::TransmissionBase::getStartTime ( ) const
inlineoverridevirtual

Returns the time when the transmitter started this transmission.

It is the start of the first bit's transmission.

Implements inet::physicallayer::ITransmission.

Referenced by getStartTime().

55 { return startTime; }
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t inet::physicallayer::TransmissionBase::getStartTime ( IRadioSignal::SignalPart  part) const
overridevirtual

Implements inet::physicallayer::ITransmission.

60 {
61  switch (part) {
63  return getStartTime();
65  return getPreambleStartTime();
67  return getHeaderStartTime();
69  return getDataStartTime();
70  default:
71  throw cRuntimeError("Unknown signal part: '%s'", IRadioSignal::getSignalPartName(part));
72  }
73 }
static const char * getSignalPartName(SignalPart signalPart)
Returns the name of the provided signal part.
Definition: IRadioSignal.cc:33
virtual const simtime_t getDataStartTime() const override
Definition: TransmissionBase.h:64
virtual const simtime_t getPreambleStartTime() const override
Definition: TransmissionBase.h:60
virtual const simtime_t getStartTime() const override
Returns the time when the transmitter started this transmission.
Definition: TransmissionBase.h:55
virtual const simtime_t getHeaderStartTime() const override
Definition: TransmissionBase.h:62
virtual const IRadio* inet::physicallayer::TransmissionBase::getTransmitter ( ) const
inlineoverridevirtual

Returns the transmitter that transmitted this radio signal on the radio channel.

This function never returns nullptr.

Implements inet::physicallayer::ITransmission.

51 { return transmitter; }
const IRadio * transmitter
Definition: TransmissionBase.h:32
std::ostream & inet::physicallayer::TransmissionBase::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.

Reimplemented in inet::physicallayer::LayeredTransmission, inet::physicallayer::IdealTransmission, inet::physicallayer::NarrowbandTransmissionBase, inet::physicallayer::DimensionalTransmission, inet::physicallayer::FlatTransmissionBase, inet::physicallayer::ScalarTransmission, inet::physicallayer::Ieee80211IdealTransmission, inet::physicallayer::Ieee80211DimensionalTransmission, and inet::physicallayer::Ieee80211ScalarTransmission.

Referenced by inet::physicallayer::NarrowbandTransmissionBase::printToStream(), inet::physicallayer::IdealTransmission::printToStream(), and inet::physicallayer::LayeredTransmission::printToStream().

41 {
42  if (level <= PRINT_LEVEL_DETAIL)
43  stream << ", id = " << id;
44  if (level <= PRINT_LEVEL_TRACE)
45  stream << ", transmitterId = " << transmitter->getId()
46  << ", startTime = " << startTime
47  << ", endTime = " << endTime
48  << ", startPosition = " << startPosition
49  << ", preambleDuration = " << preambleDuration
50  << ", headerPosition = " << headerDuration
51  << ", dataPosition = " << dataDuration
52  << ", endPosition = " << endPosition
53  << ", startOrientation = " << startOrientation
54  << ", endOrientation = " << endOrientation;
55  return stream;
56 }
const Coord startPosition
Definition: TransmissionBase.h:39
const EulerAngles endOrientation
Definition: TransmissionBase.h:42
const IRadio * transmitter
Definition: TransmissionBase.h:32
const Coord endPosition
Definition: TransmissionBase.h:40
const simtime_t startTime
Definition: TransmissionBase.h:34
const simtime_t dataDuration
Definition: TransmissionBase.h:38
const int id
Definition: TransmissionBase.h:31
const simtime_t preambleDuration
Definition: TransmissionBase.h:36
const simtime_t endTime
Definition: TransmissionBase.h:35
virtual int getId() const =0
Returns an identifier for this radio which is globally unique for the whole lifetime of the simulatio...
const EulerAngles startOrientation
Definition: TransmissionBase.h:41
const simtime_t headerDuration
Definition: TransmissionBase.h:37

Member Data Documentation

const simtime_t inet::physicallayer::TransmissionBase::dataDuration
protected

Referenced by printToStream().

const EulerAngles inet::physicallayer::TransmissionBase::endOrientation
protected

Referenced by printToStream().

const Coord inet::physicallayer::TransmissionBase::endPosition
protected

Referenced by printToStream().

const simtime_t inet::physicallayer::TransmissionBase::endTime
protected

Referenced by printToStream().

const simtime_t inet::physicallayer::TransmissionBase::headerDuration
protected

Referenced by printToStream().

const int inet::physicallayer::TransmissionBase::id
protected

Referenced by printToStream().

const cPacket* inet::physicallayer::TransmissionBase::macFrame
protected
const simtime_t inet::physicallayer::TransmissionBase::preambleDuration
protected

Referenced by printToStream().

const EulerAngles inet::physicallayer::TransmissionBase::startOrientation
protected

Referenced by printToStream().

const Coord inet::physicallayer::TransmissionBase::startPosition
protected

Referenced by printToStream().

const simtime_t inet::physicallayer::TransmissionBase::startTime
protected

Referenced by printToStream().

const IRadio* inet::physicallayer::TransmissionBase::transmitter
protected

Referenced by printToStream().


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