A marker trait for the unparsers that perform alignment.
PrimUnparsers are for simple types.
PrimUnparsers are for simple types. They support the ability to pre-evaluate any computations that depend on runtime-valued properties. This is needed to support the DFDL outputValueCalc property when the calculation forward references into the infoset.
In that case, one must evaluate all the runtime-valued properties, save them for later use, then suspend unparsing of the outputValueCalc'ed element. Later when the value has been computed, one then unparses the item, and the right values are present for runtime-evaluated things, as they've been cached (on the Infoset Element)
An unparser that is primitive (no sub-unparsers), but doesn't write anything to a data stream (buffered or real), so alignment, bitOrder, etc.
An unparser that is primitive (no sub-unparsers), but doesn't write anything to a data stream (buffered or real), so alignment, bitOrder, etc. cannot apply to it.
This is a bit tricky: Since we are streaming the elements to the unparser, it will receive a DIArray element, but the length of that DIArray element at the time it is received, will probably be 0 because the child elements (not even one of them) will have been pulled yet.
This is a bit tricky: Since we are streaming the elements to the unparser, it will receive a DIArray element, but the length of that DIArray element at the time it is received, will probably be 0 because the child elements (not even one of them) will have been pulled yet. So we cannot just measure how big the array is and iterate that many times. Rather, we have to iterate until we come to an End(DIArray) event.
This requires the ability to look ahead into the input stream by 1, see if it is EndArray, and if so consume it and end the iteration.
Text primitive unparsers - primitive and textual only.
When we create a suspension during unparse, we need to clone the UStateMain for when the suspension is later resumed.
When we create a suspension during unparse, we need to clone the UStateMain for when the suspension is later resumed. However, we do not need nearly as much information for these cloned ustates as the main unparse. Either we can access the necessary information directly from the main UState, or the information isn't used and there's no need to copy it/take up valuable memory.
This object is so that we can share the iteration idioms between situations where we know N statically, and where dynamic evaluation computes N.
This object is so that we can share the iteration idioms between situations where we know N statically, and where dynamic evaluation computes N.
In these cases, there are no new points of uncertainty because computed or otherwise, we know N.
A marker trait for the unparsers that perform alignment.
Needed to distinguish alignment operations from regular primitives so that we can inspect for bitOrder changes on most primitives, but not alignments - since their purpose may be to align so that the bitOrder change is on the right boundary. Checking bit order before them defeats the purpose of alignment.