
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 ASN1EncodeStream class.
The function result variable stat returns the completion status. Error status codes are negative. Return status values are defined in the rtxErrCodes.h include file.
<outputStream> << <object>;Exceptions are not used in ASN1C C++, therefore, the user must fetch the status value following a call such as this in order to determine if it was successful. The getStatus method in the ASN1EncodeStream class is used for this purpose.
Objective Systems, Inc.55 Dowlin Forge RoadExton, 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 |