| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/discretemapper.h>

Public Member Functions | |
| DiscreteMapper () | |
| Creates an empty mapping table. | |
| bool | add (SOURCE_TYPE source, TARGET_TYPE target) |
| bool | remove (SOURCE_TYPE source) |
| virtual TARGET_TYPE | map (SOURCE_TYPE source) |
| VRS_TYPEINFO (DiscreteMapper, VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper)) | |
| VRS_SERIALIZABLE (DiscreteMapper) | |
| VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::DiscreteMapper | ( | ) | [inline] |
Creates an empty mapping table.
| bool VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::add | ( | SOURCE_TYPE | source, | |
| TARGET_TYPE | target | |||
| ) | [inline] |
Adds a new entry to the mapping table. Returns true, if there was not already a mapping from the specified source value to some target value.
| bool VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::remove | ( | SOURCE_TYPE | source | ) | [inline] |
Removes an existing entry from the mapping table. Returns true, if there was a mapping from the specified source value to some target value.
| TARGET_TYPE VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::map | ( | SOURCE_TYPE | source | ) | [inline, virtual] |
The resulting target value is calculated by finding the greatest source value in the table that is less than or equal to the given source value and returning the corresponding target value stored in the mapping table. If all source values stored in the mapping table are greater than the given source value then the target value for the smallest source value stored in the mapping table is returned.
Implements VRS::Mapper< TARGET_TYPE, SOURCE_TYPE >.
| VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_TYPEINFO | ( | DiscreteMapper< TARGET_TYPE, SOURCE_TYPE > | , | |
| VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper) | ||||
| ) |
| VRS::DiscreteMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_SERIALIZABLE | ( | DiscreteMapper< TARGET_TYPE, SOURCE_TYPE > | ) |