Generated Stream-Oriented C++ Encode Method Format and Calling Parameters
C++ code generation of stream-based encoders is selected by using the -c++ and -stream compiler command line options. In this case, ASN1C generates an EncodeTo method that wraps the C function call. This method provides a more simplified calling interface because it hides things such as the context structure and tag type parameters.
stat = <object>.EncodeTo (<outputStream>);In this definition, <object> is an instance of the control class (i.e., ASN1C_<prodName>) generated for the given production.
The <outputStream> placeholder represents an output stream object type. This is an object derived from an ASN1OutputStream class.
The function result variable stat returns the completion status. Error status codes are negative. Return status values are defined in the asn1type.h include file.
<outputStream> << <object>;
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |