Generated decode functions are invoked through the class interface by calling the base class Decode method. The calling sequence for this method is as follows:
status = <object>.Decode ();
In this definition, <object> is an object of the class generated for the given production.
An ASN1OERDecodeBuffer object must be passed to the <object> constructor prior to decoding. This is where the message start address and length are specified.
The function result variable status
returns the status of the decode
operation. The return status will be zero (0) if decoding is successful or a
negative value if an error occurs. Return status values are documented in the
C/C++ Common Functions Reference Manual and
in the rtxErrCodes.h include file.
If the code is generated using the -coer switch, then the decoding will be canonical. If the code is generated using the -oer switch, the decoding can be made canonical by setting the appropriate flag in the context prior to calling the decode function:
ASN1OERDecodeBuffer decodeBuffer;; OSCTXT* pctxt = decodeBuffer.getCtxtPtr(); rtxCtxtSetFlag(pctxt, ASN1CANON);