INET Framework for OMNeT++/OMNEST
|
Abstract subclass of ConstMapping which can be used as base for any ConstMapping implementation with read access of constant complexity. More...
#include <MappingBase.h>
Public Member Functions | |
virtual ConstMappingIterator * | createConstIterator () const override |
Returns a pointer of a new Iterator which is able to iterate over the Mapping. More... | |
virtual ConstMappingIterator * | createConstIterator (const Argument &pos) const override |
Returns a pointer of a new Iterator which is able to iterate over the Mapping. More... | |
SimpleConstMapping (const DimensionSet &dims) | |
Initializes a not yet iterateable SimpleConstmapping with the passed DimensionSet as domain. More... | |
SimpleConstMapping (const SimpleConstMapping &o) | |
SimpleConstMapping & | operator= (const SimpleConstMapping ©) |
SimpleConstMapping assignment operator. More... | |
void | swap (SimpleConstMapping &s) |
Swaps data with another SimpleConstMapping. More... | |
SimpleConstMapping (const DimensionSet &dims, const Argument &key) | |
Fully initializes this mapping with the passed position as key entry. More... | |
SimpleConstMapping (const DimensionSet &dims, const Argument &key1, const Argument &key2) | |
Fully initializes this mapping with the passed two positions as key entries. More... | |
SimpleConstMapping (const DimensionSet &dims, const Argument &min, const Argument &max, const Argument &interval) | |
Fully initializes this mapping with the key entries defined by the passed min, max and interval values. More... | |
void | initializeArguments (const Argument &key) |
Initializes the key entry set with the passed position as entry. More... | |
void | initializeArguments (const Argument &key1, const Argument &key2) |
Initializes the key entry set with the passed two positions as entries. More... | |
void | initializeArguments (const Argument &min, const Argument &max, const Argument &interval) |
Initializes the key entry set with the passed min, max and interval-Arguments. 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 () |
virtual argument_value_t | getValue (const Argument &pos) const =0 |
Returns the value of this Mapping at the position specified by the passed Argument. More... | |
virtual ConstMapping * | constClone () const =0 |
returns a deep copy of this mapping instance. More... | |
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 std::set< Argument > | KeyEntrySet |
Type for a set of Arguments defining key entries. More... | |
Protected Member Functions | |
void | createKeyEntries (const Argument &from, const Argument &to, const Argument &step, Argument &pos) |
Utility method to fill add range of key entries in the time dimension to the key entry set. More... | |
void | createKeyEntries (const Argument &from, const Argument &to, const Argument &step, DimensionSet::const_iterator curDim, Argument &pos) |
Utility method to fill add range of key entries in the passed dimension (and recursively its sub dimensions) to the key entry set. More... | |
Protected Attributes | |
KeyEntrySet | keyEntries |
A set of Arguments defining the "points of interest" an iterator should iterate over. More... | |
Protected Attributes inherited from inet::physicallayer::ConstMapping | |
DimensionSet | dimensions |
The dimensions of this mappings domain. More... | |
Additional Inherited Members | |
Public Types inherited from inet::physicallayer::ConstMapping | |
typedef Argument::mapped_type | argument_value_t |
typedef Argument::mapped_type_cref | argument_value_cref_t |
Abstract subclass of ConstMapping which can be used as base for any ConstMapping implementation with read access of constant complexity.
Any subclass only has to implement the "getValue()" and the "clone()"-method.
The subclass has to define the "points of interest" an iterator should iterate over. This should be done either at construction time or later by calling the "initializeArguments()"-method.
The SimpleConstMapping class provides Iterator creation by using the SimpleConstMappingIterator which assumes that the underlying ConstMappings getValue()-method is fast enough to be called on every iteration step (which means constant complexity).
|
protected |
Type for a set of Arguments defining key entries.
|
inline |
Initializes a not yet iterateable SimpleConstmapping with the passed DimensionSet as domain.
|
inline |
|
inline |
Fully initializes this mapping with the passed position as key entry.
A SimpleConstMapping initialized by this constructor is able to return a valid ConstIterator.
|
inline |
Fully initializes this mapping with the passed two positions as key entries.
A SimpleConstMapping initialized by this constructor is able to return a valid ConstIterator.
|
inline |
Fully initializes this mapping with the key entries defined by the passed min, max and interval values.
A SimpleConstMapping initialized by this constructor is able to return a valid ConstIterator.
|
inlineoverridevirtual |
Returns a pointer of a new Iterator which is able to iterate over the Mapping.
This method asserts that the mapping had been fully initialized.
Implements inet::physicallayer::ConstMapping.
|
inlineoverridevirtual |
Returns a pointer of a new Iterator which is able to iterate over the Mapping.
The iterator starts at the passed position.
This method asserts that the mapping had been fully initialized.
Implements inet::physicallayer::ConstMapping.
|
protected |
Utility method to fill add range of key entries in the time dimension to the key entry set.
|
protected |
Utility method to fill add range of key entries in the passed dimension (and recursively its sub dimensions) to the key entry set.
|
inline |
Initializes the key entry set with the passed position as entry.
Convenience method for simple mappings.
|
inline |
Initializes the key entry set with the passed two positions as entries.
Convenience method for simple mappings.
void inet::physicallayer::SimpleConstMapping::initializeArguments | ( | const Argument & | min, |
const Argument & | max, | ||
const Argument & | interval | ||
) |
Initializes the key entry set with the passed min, max and interval-Arguments.
After a call to this method this SimpleConstMapping is able to return a valid ConstIterator.
|
inline |
SimpleConstMapping assignment operator.
copy | A SimpleConstMapping of identical element and allocator types. |
All the elements of copy are copied.
|
inline |
Swaps data with another SimpleConstMapping.
s | A SimpleConstMapping of the same element and allocator types. |
This exchanges the elements between two SimpleConstMapping's in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.
|
protected |
A set of Arguments defining the "points of interest" an iterator should iterate over.