Abstract data types to be used in specifications
This module implements mappings from non-negative integers
to an arbitrary type that is specified by a generic instantiation parameter.
Any assignable type can be chosen.
The map is implemented by a dynamically allocated array using
obstack module via the
The mapping storage can be deallocated.
The size of the mapping has to to be stated on initialization.
The module is instantiated by
$/Adt/Map.gnrc +instance=NAME +referto=TYPE :inst
NAME identifies the
Map instance and
is the target type of the mapping.
Note: The target type of the mapping
TYPE must be either a
type that is predefined in C, or its definition must be made
available by some
All entities exported by this module can be used in specifications
They can also be used in
.pdl specifications or in C modules
if the interface file
NAMEMap.h is imported there.
The following functions are supplied by the module:
void NAMEInitMap (int max_n)
- Initializes the mapping for value between 0 and
void NAMEFinlMap (void)
- Deallocates the mapping.
void NAMEInitMapValues (TYPE v)
- Initializes all mappings in the range 0 to
max_n to the
void NAMESetMap (int n, TYPE v)
n to the value
It may override a previously set value.
TYPE NAMEGetMap (int n)
- Yields the
TYPE value set for
n by the most recent call of
InitMapValues, if any;
otherwise the result is undefined.