INET Framework for OMNeT++/OMNEST
|
Implementation of the Mapping-interface which is able to represent arbitrary dimensional instances of Mappings by using a tree-like structure of sub-mappings, each representing the values for one of the dimensions. More...
#include <MappingUtils.h>
Public Member Functions | |
MultiDimMapping (const DimensionSet &myDims) | |
Initializes the Mapping with the passed DimensionSet as domain. More... | |
MultiDimMapping (const DimensionSet &myDims, argument_value_cref_t oorv) | |
Initializes the Mapping with the passed DimensionSet as domain. More... | |
MultiDimMapping (const MultiDimMapping< Interpolator > &o) | |
Copy-constructor which assures that the sub-mappings are deep copied instead of only their the pointers. More... | |
const MultiDimMapping & | operator= (const MultiDimMapping< Interpolator > &o) |
Copy operator which assures that the sub-mappings are deep copied instead of only their the pointers. More... | |
virtual Mapping * | clone () const override |
returns a deep copy of this mapping instance. More... | |
virtual | ~MultiDimMapping () |
Frees the memory for the sub mappings. More... | |
virtual argument_value_t | getValue (const Argument &pos) const override |
Returns the value of this Mapping at position specified by the passed Argument. More... | |
virtual void | setValue (const Argument &pos, argument_value_cref_t value) override |
Changes the value of the Mapping at the specified position. More... | |
virtual MappingIterator * | createIterator () override |
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to. More... | |
virtual MappingIterator * | createIterator (const Argument &pos) override |
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to. More... | |
Dimension | getDimension () |
Returns the dimension this instance represents. More... | |
Public Member Functions inherited from inet::physicallayer::Mapping | |
Mapping & | operator= (const Mapping ©) |
Mapping assignment operator. More... | |
void | swap (Mapping &s) |
Swaps data with another Mapping. More... | |
Mapping (const DimensionSet &dims) | |
Initializes the Mapping with the passed DimensionSet as domain. More... | |
Mapping () | |
Initializes the Mapping with the time dimension as domain. More... | |
Mapping (const Mapping &o) | |
virtual | ~Mapping () |
virtual void | setValue (const Argument &pos, argument_value_cref_t value)=0 |
Changes the value of the Mapping at the specified position. More... | |
virtual void | appendValue (const Argument &pos, argument_value_cref_t value) |
Appends the passed value at the passed position to the mapping. More... | |
virtual ConstMappingIterator * | createConstIterator () const override |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More... | |
virtual ConstMappingIterator * | createConstIterator (const Argument &pos) const override |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More... | |
virtual ConstMapping * | constClone () const override |
Returns a deep const copy of this mapping by using the according "clone()"-implementation. More... | |
Public Member Functions inherited from inet::physicallayer::ConstMapping | |
ConstMapping & | operator= (const ConstMapping ©) |
ConstMapping assignment operator. More... | |
void | swap (ConstMapping &s) |
Swaps data with another ConstMapping. More... | |
ConstMapping () | |
Initializes the ConstMapping with a the time dimension as domain. More... | |
ConstMapping (const ConstMapping &o) | |
ConstMapping (const DimensionSet &dimSet) | |
Initializes the ConstMapping with the passed DimensionSet as Domain. More... | |
virtual | ~ConstMapping () |
argument_value_t | operator[] (const Argument &pos) const |
Returns the value of this Mapping at the position specified by the passed Argument. More... | |
const DimensionSet & | getDimensionSet () const |
Returns this Mappings domain as DimensionSet. More... | |
template<class stream > | |
stream & | print (stream &out, argument_value_cref_t lTimeScale=argument_value_t(1), argument_value_cref_t lLeftColScale=Argument::MappedOne, const std::string &sTableHead=std::string("o\\ms"), const Dimension *const pOnlyDim=nullptr) const |
Prints the Mapping to an output stream. More... | |
Protected Types | |
typedef InterpolateableMap< Interpolator< std::map< argument_value_t, Mapping * > > > | interpolator_map_type |
The templated InterpolateableMap the underlying Mapping uses std::map as storage type. More... | |
typedef interpolator_map_type::interpolator_type | interpolator_type |
typedef interpolator_map_type::mapped_type | mapped_type |
typedef interpolator_map_type::mapped_cref_type | mapped_cref_type |
typedef interpolator_map_type::iterator_intpl | iterator |
typedef interpolator_map_type::const_iterator_intpl | const_iterator |
Protected Member Functions | |
MultiDimMapping (const DimensionSet &myDims, Dimension myDim) | |
Initializes the Mapping with the passed DimensionSet as domain and the passed dimension as the dimension this instance should represent. More... | |
MultiDimMapping (const DimensionSet &myDims, Dimension myDim, ConstantSimpleConstMapping *oorm, ConstMappingWrapper *wrappedoorm) | |
Initializes the Mapping with the passed DimensionSet as domain and the passed dimension as the dimension this instance should represent. More... | |
MultiDimMapping (const MultiDimMapping< Interpolator > &o, ConstantSimpleConstMapping *oorm, ConstMappingWrapper *wrappedoorm) | |
Intern copy-constructor which assures that the sub-mappings are deep copied instead of only their pointers. More... | |
mapped_type | createSubSignal () const |
Internal helper method which creates a new sub-mapping for this MultiDimMapping instance. More... | |
void | copySubMappings () |
Protected Attributes | |
ConstantSimpleConstMapping * | outOfRangeMapping |
Returned by the Interpolator if the mapping is accessed outside its range (before or after the last key entry in a dimension). More... | |
ConstMappingWrapper * | wrappedOORMapping |
Wraps the out of range mapping which is an instance of ConstMapping inside an instance of Mapping which setValue method is asserted to never be called. More... | |
interpolator_map_type | entries |
Stores the sub-mappings for the dimension this instance represents. More... | |
Dimension | myDimension |
The dimension this instance represents. More... | |
bool | isMaster |
Protected Attributes inherited from inet::physicallayer::ConstMapping | |
DimensionSet | dimensions |
The dimensions of this mappings domain. More... | |
Friends | |
class | MultiDimMappingIterator< Interpolator > |
Additional Inherited Members | |
Public Types inherited from inet::physicallayer::Mapping | |
enum | InterpolationMethod { STEPS, NEAREST, LINEAR } |
Types of interpolation methods for mappings. More... | |
Public Types inherited from inet::physicallayer::ConstMapping | |
typedef Argument::mapped_type | argument_value_t |
typedef Argument::mapped_type_cref | argument_value_cref_t |
Implementation of the Mapping-interface which is able to represent arbitrary dimensional instances of Mappings by using a tree-like structure of sub-mappings, each representing the values for one of the dimensions.
This class internally uses a map of Mappings two represent one dimension. Where every Mapping in the map represents a sub-mapping for the values in the next dimension at that position in the this dimension. These sub-mappings can either be in turn MultiDimMappings with further sub-mappings or they can be TimedMappings if their dimension is the time. The TimedMappings therefore represent the leafs of the tree-like structure.
|
protected |
|
protected |
The templated InterpolateableMap the underlying Mapping uses std::map as storage type.
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
Initializes the Mapping with the passed DimensionSet as domain and the passed dimension as the dimension this instance should represent.
Also takes the interpolation method to use, but not yet implemented.
This constructor is only used internally to create the sub-mappings.
|
inlineprotected |
Initializes the Mapping with the passed DimensionSet as domain and the passed dimension as the dimension this instance should represent.
Also takes the interpolation method to use, but not yet implemented.
This constructor is only used internally to create the sub-mappings.
|
inlineprotected |
Intern copy-constructor which assures that the sub-mappings are deep copied instead of only their pointers.
|
inline |
Initializes the Mapping with the passed DimensionSet as domain.
Also takes the interpolation-method but is not used yet.
|
inline |
Initializes the Mapping with the passed DimensionSet as domain.
Also takes the interpolation-method but is not used yet.
|
inline |
Copy-constructor which assures that the sub-mappings are deep copied instead of only their the pointers.
|
inlinevirtual |
Frees the memory for the sub mappings.
|
inlineoverridevirtual |
returns a deep copy of this mapping instance.
Implements inet::physicallayer::Mapping.
|
inlineprotected |
|
inlineoverridevirtual |
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.
The caller of this method has to delete the Iterator if not needed anymore.
Implements inet::physicallayer::Mapping.
Reimplemented in inet::physicallayer::FilledUpMapping.
|
inlineoverridevirtual |
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.
The caller of this method has to delete the Iterator if not needed anymore.
Implements inet::physicallayer::Mapping.
Reimplemented in inet::physicallayer::FilledUpMapping.
|
inlineprotected |
Internal helper method which creates a new sub-mapping for this MultiDimMapping instance.
Referenced by inet::physicallayer::FilledUpMapping::createSubSignal(), and inet::physicallayer::MultiDimMappingIterator< Linear >::setValue().
|
inline |
Returns the dimension this instance represents.
|
inlineoverridevirtual |
Returns the value of this Mapping at position specified by the passed Argument.
Has logarithmic complexity over the number of dimensions and the number of entries per dimension.
Implements inet::physicallayer::ConstMapping.
|
inline |
Copy operator which assures that the sub-mappings are deep copied instead of only their the pointers.
|
inlineoverridevirtual |
Changes the value of the Mapping at the specified position.
Has logarithmic complexity over the number of dimensions and the number of entries per dimension.
|
friend |
|
protected |
Stores the sub-mappings for the dimension this instance represents.
Referenced by inet::physicallayer::MultiDimMapping< Linear >::operator=().
|
protected |
|
protected |
The dimension this instance represents.
Referenced by inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), inet::physicallayer::MultiDimMapping< Linear >::operator=(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
protected |
Returned by the Interpolator if the mapping is accessed outside its range (before or after the last key entry in a dimension).
Referenced by inet::physicallayer::MultiDimMapping< Linear >::MultiDimMapping(), and inet::physicallayer::MultiDimMapping< Linear >::operator=().
|
protected |
Wraps the out of range mapping which is an instance of ConstMapping inside an instance of Mapping which setValue method is asserted to never be called.
Referenced by inet::physicallayer::MultiDimMapping< Linear >::operator=().