When C++ code generation is specified using the -xml switch, the generated EncodeTo and DecodeFrom methods in the PDU control class are set up to encode complete XML documents including the start document header as well as namespace attributes in the main element tag.
Generated encode functions are invoked through the class interface by calling the base class Encode method. The calling sequence for this method is as follows:
stat = <object>.Encode ();
In this definition, <object> is an object of the class generated for the given
production. The function result variable stat
returns the status value from
the XML encode function. This status value will be zero if encoding was successful or a
negative error status value if encoding fails. Return status values are defined in the
rtxErrCodes.h include file.
The user must call the encode buffer class methods getMsgPtr and getMsgLen to obtain the starting address and length of the encoded message component.