Public Member Functions | Protected Attributes

RSAMMapping Class Reference
[phyLayer - physical layer modules]

This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM). More...

#include <PhyUtils.h>

Inherits ConstMapping.

Collaboration diagram for RSAMMapping:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RSAMMapping (const RadioStateAnalogueModel *rsam, simtime_t signalStart, simtime_t signalEnd)
 Constructor taking a pointer to the corresponding RSAM.
virtual double getValue (const Argument &pos) const
 Returns the value of this Function at position specified by the passed Argument. Zero-time-switches are ignored here, i.e. in case of multiple entries at the same time-point, the last one is significant.
virtual ConstMappingIteratorcreateConstIterator ()
 Returns a pointer of a new Iterator which is able to iterate over the function.
virtual ConstMappingIteratorcreateConstIterator (const Argument &pos)
 Returns a pointer of a new Iterator which is able to iterate over the function. The iterator starts at the passed position.
virtual ConstMappingconstClone () const
 returns a deep copy of this mapping instance.

Protected Attributes

const RadioStateAnalogueModelrsam
 Pointer to the RSAM module.
simtime_t signalStart
 Start of the signal this mapping defines attenuation for.
simtime_t signalEnd
 End of the signal this mapping defines attenuation for.

Detailed Description

This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM).

Since RSAM is modified dynamically over time, RSAMMapping doesn't store the information itself, but interacts with its RSAM to obtain information about the mapping.

The relation to RSAM is very tight. RSAM creates an appropriate RSAMMapping by passing a self-pointer to the constructor call.

class RSAMMapping is a friend of class RadioStateAnalogueModel

Definition at line 558 of file PhyUtils.h.


Member Function Documentation

double RSAMMapping::getValue ( const Argument pos  )  const [virtual]

Returns the value of this Function at position specified by the passed Argument. Zero-time-switches are ignored here, i.e. in case of multiple entries at the same time-point, the last one is significant.

In this case we have a function: simtime_t -> attenuation

Implements ConstMapping.

Definition at line 342 of file PhyUtils.cc.

References Argument::getTime(), and RadioStateAnalogueModel::radioStateAttenuation.

{
  // extract the time-component from the argument
  simtime_t t = pos.getTime();

  // assert that t is not before the first timepoint in the RSAM
  // and receiving list is not empty
  assert( !(rsam->radioStateAttenuation.empty()) &&
      !(t < rsam->radioStateAttenuation.front().getTime()) );

  /* receiving list contains at least one entry */

  // set an iterator to the first entry with timepoint > t
  std::list<RadioStateAnalogueModel::ListEntry>::const_iterator it;
  it = upper_bound(rsam->radioStateAttenuation.begin(), rsam->radioStateAttenuation.end(), t);

  // REGULAR CASE: it points to an element that has a predecessor
  it--; // go back one entry, this one is significant!

  return it->getValue();
}


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