...
A schematic representation of the example discussed in this section
external
Since the last three optional fields (including RecordOwnerType
and RecordOwnerDN
) consist of several fields, each one will be defined as its own type. That is, an external sequential format.
...
Code Block |
---|
/ Filler needed to be able to recognize on the input stream: external FillerRecord_0x00_EXT: identified_by(RecordIdentifier == 0x00), static_size(32) { int(little_endian) RecordIdentifier : static_size(1), external_only, encode_value(0x00); // Note that no other fields are specified. // The UDR size (32) will be consumed and discarded (see in_map). }; |
Alternative Syntax
An alternative to use the set
construct, in the external definition for AMARecord_ext
, switched_set
could be used. This will impact the syntax for the Package_*_EXT
types. Only the syntax differing from the original example is shown. The main reason for using switched_set
instead of set
is when performance must be increased.
...
Note | ||
---|---|---|
| ||
No |
internal
No internal
is used. In this case, the target_internal
is sufficient; all field names and field types are in order and there is only one type of record present in the input, and no additional fields are required.
in_map
The padding in the records is recognized by the decoder, however it is not actually mapped in to the system due to the use of the discard_output
flag.
...
Code Block |
---|
in_map FillerRecord_0x00_Map : external(FillerRecord_0x00_EXT), target_internal(FillerRecord_0x00), discard_output { automatic; }; in_map AMARecord_Map : external(AMARecord_EXT), target_internal( AMARecord ) { automatic { RecordOwnerType_EXT : target_internal( RecordOwnerType ); RecordOwnerDN_EXT : target_internal( RecordOwnerDN ); Package_100_EXT : target_internal( Package_100 ); Package_101_EXT : target_internal( Package_101 ); Package_102_EXT : target_internal( Package_102 ); }; }; |
decoder
The padding pseudo-records and data records can arrive in any order, therefore there is no need to define a constructed decoder.
...