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

Specifies a dimension for mappings (like time, frequency, etc.) More...

#include <MappingBase.h>

Public Member Functions

 Dimension ()
 
 Dimension (const char *name, int id)
 Creates a new dimension instance representing the dimension with the passed name. More...
 
bool operator== (const Dimension &other) const
 Returns true if the ids of the two dimensions are equal. More...
 
bool operator< (const Dimension &other) const
 Returns true if the id of the other dimension is greater then the id of this dimension. More...
 
bool operator<= (const Dimension &other) const
 Sorting operator by dimension ID. More...
 
bool operator> (const Dimension &other) const
 Sorting operator by dimension ID. More...
 
bool operator>= (const Dimension &other) const
 Sorting operator by dimension ID. More...
 
bool operator!= (const Dimension &other) const
 Sorting operator by dimension ID. More...
 
const char * getName () const
 Returns the name of this dimension. More...
 
int getID () const
 Returns the unique id of the dimension this instance represents. More...
 

Static Public Attributes

static const Dimension time
 Shortcut to the time Dimension, same as 'Dimension("time")', but spares the parsing of a string. More...
 
static const Dimension frequency
 Shortcut to the frequency Dimension, same as 'Dimension("frequency")', but spares the parsing of a string. More...
 

Protected Attributes

const char * name = nullptr
 The unique name of the dimension this instance represents. More...
 
int id = 0
 The unique id of the dimension this instance represents. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Dimension &d)
 Output operator for a dimension. More...
 

Detailed Description

Specifies a dimension for mappings (like time, frequency, etc.)

The dimension is represented external by a string (like "time") and internally by an unique ID.

Note: Since the ID for a Dimensions is set the first time an instance of this dimensions is created and the id is used to provide a defined ordering of the Dimensions it DOES matter which dimensions are instantiated the first time. Only the time dimension will always have zero as unique id.

Author
Karl Wessel

Constructor & Destructor Documentation

inet::physicallayer::Dimension::Dimension ( )
inline
71 {}
inet::physicallayer::Dimension::Dimension ( const char *  name,
int  id 
)

Creates a new dimension instance representing the dimension with the passed name.

30  :
31  name(name),
32  id(id)
33 {
34 }
int id
The unique id of the dimension this instance represents.
Definition: MappingBase.h:59
const char * name
The unique name of the dimension this instance represents.
Definition: MappingBase.h:56

Member Function Documentation

int inet::physicallayer::Dimension::getID ( ) const
inline

Returns the unique id of the dimension this instance represents.

The id is used to uniquely identify dimensions as well as to provide a sorting of dimensions. Note: The "time"-dimension will always have the ID zero.

117 { return id; }
int id
The unique id of the dimension this instance represents.
Definition: MappingBase.h:59
const char* inet::physicallayer::Dimension::getName ( ) const
inline

Returns the name of this dimension.

105  {
106  return name;
107  }
const char * name
The unique name of the dimension this instance represents.
Definition: MappingBase.h:56
bool inet::physicallayer::Dimension::operator!= ( const Dimension other) const
inline

Sorting operator by dimension ID.

99 { return id != other.id; }
bool inet::physicallayer::Dimension::operator< ( const Dimension other) const
inline

Returns true if the id of the other dimension is greater then the id of this dimension.

This is needed to be able to use Dimension as a key in std::map.

90 { return id < other.id; }
bool inet::physicallayer::Dimension::operator<= ( const Dimension other) const
inline

Sorting operator by dimension ID.

93 { return id <= other.id; }
bool inet::physicallayer::Dimension::operator== ( const Dimension other) const
inline

Returns true if the ids of the two dimensions are equal.

82 { return id == other.id; }
bool inet::physicallayer::Dimension::operator> ( const Dimension other) const
inline

Sorting operator by dimension ID.

95 { return id > other.id; }
bool inet::physicallayer::Dimension::operator>= ( const Dimension other) const
inline

Sorting operator by dimension ID.

97 { return id >= other.id; }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Dimension d 
)
friend

Output operator for a dimension.

121  {
122  return out << d.getName() << "(" << d.id << ")";
123  }

Member Data Documentation

const Dimension inet::physicallayer::Dimension::frequency
static

Shortcut to the frequency Dimension, same as 'Dimension("frequency")', but spares the parsing of a string.

Referenced by inet::physicallayer::DimensionalNoise::computeMaxPower(), inet::physicallayer::DimensionalSNIR::computeMin(), inet::physicallayer::DimensionalReception::computeMinPower(), inet::physicallayer::DimensionalSignalAnalogModel::computeMinPower(), inet::physicallayer::DimensionalAnalogModelBase::computeNoise(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::FrequencyMapping< Interpolator >::createIterator(), inet::physicallayer::MappingUtils::createMapping(), inet::physicallayer::DimensionalTransmitterBase::createPowerMapping(), Dimension(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::FrequencyMappingIterator(), inet::physicallayer::FrequencyMapping< Interpolator >::getValue(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::initialize(), inet::physicallayer::DimensionalTransmitterBase::initialize(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::next(), inet::physicallayer::FrequencyMapping< Interpolator >::setValue(), and inet::physicallayer::FrequencyMappingIterator< Interpolator >::updateNextPos().

int inet::physicallayer::Dimension::id = 0
protected

The unique id of the dimension this instance represents.

Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

const char* inet::physicallayer::Dimension::name = nullptr
protected

The unique name of the dimension this instance represents.


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