How do you map based on an external reference?

0 votes
asked Nov 30, 2016 by bmh_ca (120 points)

Given an array of types, found e.g. in the header of a file (a "HeaderStructureMap", say):

05 02 04 01 09 0a

How can one use those to reference a repeated set of structures elsewhere – e.g. with the body of the file containing (variable-length, repeated, heterogenous structures), like this:







In the only examples I've seen a TypeId is a property of the structure, and one uses the 'Mask' to set it.  Unfortunately that does not work here.

What would make sense is to have a repeated structure Parent that repeats over a HeaderStructureMap, and maps to a child based on the HeaderStructureMap[i] => Structure[09].

Unfortunately it is not clear how to accomplish this – though I'd have expected it to be fairly common.

Scripting is an option – one would think it'd be fairly straightforward, but I've not seen any examples that would serve as good concise precedents for this.

Has anyone encountered a similar situation?


1 Answer

0 votes
answered Dec 1, 2016 by andreas (2,880 points)
I'm not aware of another format with a similar "feature". Mostly structures have some identifier in themselves.

So I suggest to map the sequence with a script. Please let me know if you need any assistance for this.