INET Framework for OMNeT++/OMNEST
inet::physicallayer::BaseDelayedMapping< Base > Class Template Reference

Common base for Const- and NonConst-DelayedMapping. More...

#include <MappingUtils.h>

Inheritance diagram for inet::physicallayer::BaseDelayedMapping< Base >:

Public Member Functions

 BaseDelayedMapping (const BaseDelayedMapping &o)
 
BaseDelayedMappingoperator= (const BaseDelayedMapping &copy)
 BaseDelayedMapping assignment operator. More...
 
void swap (BaseDelayedMapping &s)
 Swaps data with another BaseDelayedMapping. More...
 
 BaseDelayedMapping (Base *mapping, simtime_t_cref delay)
 
virtual ~BaseDelayedMapping ()
 
virtual Base::argument_value_t getValue (const Argument &pos) const
 
virtual ConstMappingIteratorcreateConstIterator () const
 
virtual ConstMappingIteratorcreateConstIterator (const Argument &pos) const
 
virtual simtime_t_cref getDelay () const
 Returns the delay used by this mapping. More...
 
virtual void delayMapping (simtime_t_cref d)
 Changes the delay to the passed value. More...
 

Protected Member Functions

Argument delayPosition (const Argument &pos) const
 

Protected Attributes

Base * mapping
 
simtime_t delay
 

Detailed Description

template<class Base>
class inet::physicallayer::BaseDelayedMapping< Base >

Common base for Const- and NonConst-DelayedMapping.

See also
DelayedMapping, ConstDelayedMapping
Author
Karl Wessel

Constructor & Destructor Documentation

template<class Base>
inet::physicallayer::BaseDelayedMapping< Base >::BaseDelayedMapping ( const BaseDelayedMapping< Base > &  o)
inline
2801  :
2802  Base(o), mapping(o.mapping), delay(o.delay) {}
Base * mapping
Definition: MappingUtils.h:2789
simtime_t delay
Definition: MappingUtils.h:2790
template<class Base>
inet::physicallayer::BaseDelayedMapping< Base >::BaseDelayedMapping ( Base *  mapping,
simtime_t_cref  delay 
)
inline
2836  :
2837  Base(mapping->getDimensionSet()), mapping(mapping), delay(delay) {}
Base * mapping
Definition: MappingUtils.h:2789
simtime_t delay
Definition: MappingUtils.h:2790
template<class Base>
virtual inet::physicallayer::BaseDelayedMapping< Base >::~BaseDelayedMapping ( )
inlinevirtual
2839 {}

Member Function Documentation

template<class Base>
virtual ConstMappingIterator* inet::physicallayer::BaseDelayedMapping< Base >::createConstIterator ( ) const
inlinevirtual
2847  {
2848  return new ConstDelayedMappingIterator(mapping->createConstIterator(), delay);
2849  }
Base * mapping
Definition: MappingUtils.h:2789
simtime_t delay
Definition: MappingUtils.h:2790
BaseDelayedIterator< FilteredConstMappingIterator, ConstMappingIterator > ConstDelayedMappingIterator
ConstIterator for a ConstDelayedMapping.
Definition: MappingUtils.h:2767
template<class Base>
virtual ConstMappingIterator* inet::physicallayer::BaseDelayedMapping< Base >::createConstIterator ( const Argument pos) const
inlinevirtual
2852  {
2853  return new ConstDelayedMappingIterator(mapping->createConstIterator(delayPosition(pos)), delay);
2854  }
Base * mapping
Definition: MappingUtils.h:2789
simtime_t delay
Definition: MappingUtils.h:2790
BaseDelayedIterator< FilteredConstMappingIterator, ConstMappingIterator > ConstDelayedMappingIterator
ConstIterator for a ConstDelayedMapping.
Definition: MappingUtils.h:2767
Argument delayPosition(const Argument &pos) const
Definition: MappingUtils.h:2793
template<class Base>
virtual void inet::physicallayer::BaseDelayedMapping< Base >::delayMapping ( simtime_t_cref  d)
inlinevirtual

Changes the delay to the passed value.

2868  {
2869  delay = d;
2870  }
simtime_t delay
Definition: MappingUtils.h:2790
template<class Base>
Argument inet::physicallayer::BaseDelayedMapping< Base >::delayPosition ( const Argument pos) const
inlineprotected
2794  {
2795  Argument res(pos);
2796  res.setTime(res.getTime() - delay);
2797  return res;
2798  }
simtime_t delay
Definition: MappingUtils.h:2790
template<class Base>
virtual simtime_t_cref inet::physicallayer::BaseDelayedMapping< Base >::getDelay ( ) const
inlinevirtual

Returns the delay used by this mapping.

2860  {
2861  return delay;
2862  }
simtime_t delay
Definition: MappingUtils.h:2790
template<class Base>
virtual Base::argument_value_t inet::physicallayer::BaseDelayedMapping< Base >::getValue ( const Argument pos) const
inlinevirtual
2842  {
2843  return mapping->getValue(delayPosition(pos));
2844  }
Base * mapping
Definition: MappingUtils.h:2789
Argument delayPosition(const Argument &pos) const
Definition: MappingUtils.h:2793
template<class Base>
BaseDelayedMapping& inet::physicallayer::BaseDelayedMapping< Base >::operator= ( const BaseDelayedMapping< Base > &  copy)
inline

BaseDelayedMapping assignment operator.

Parameters
copyA BaseDelayedMapping of identical element and allocator types.

All the elements of copy are copied.

2811  {
2812  BaseDelayedMapping tmp(copy); // All resource all allocation happens here.
2813  // If this fails the copy will throw an exception
2814  // and 'this' object is unaffected by the exception.
2815  swap(tmp);
2816  return *this;
2817  }
BaseDelayedMapping(const BaseDelayedMapping &o)
Definition: MappingUtils.h:2801
void swap(BaseDelayedMapping &s)
Swaps data with another BaseDelayedMapping.
Definition: MappingUtils.h:2827
template<class Base>
void inet::physicallayer::BaseDelayedMapping< Base >::swap ( BaseDelayedMapping< Base > &  s)
inline

Swaps data with another BaseDelayedMapping.

Parameters
sA BaseDelayedMapping of the same element and allocator types.

This exchanges the elements between two BaseDelayedMapping's in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.

2828  {
2829  Base::swap(s); // swap the base class members
2830  /* Swap all D members */
2831  std::swap(mapping, s.mapping);
2832  std::swap(delay, s.delay);
2833  }
Base * mapping
Definition: MappingUtils.h:2789
simtime_t delay
Definition: MappingUtils.h:2790
value< double, units::s > s
Definition: Units.h:1049

Member Data Documentation

template<class Base>
simtime_t inet::physicallayer::BaseDelayedMapping< Base >::delay
protected
template<class Base>
Base* inet::physicallayer::BaseDelayedMapping< Base >::mapping
protected

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