ASN.1 C++ Compiler Overview

The ASN.1 C++ Compiler is a plus version of ASN.1 C Compiler, utilizing object-oriented programming techniques. The ASN.1 C++ Compiler automatically translates ASN.1 specifications into C++ classes as well as metadata for encoding/decoding.

In addition to the ASN.1 C++ Compiler, ASN.1 C++ Runtime Library is also part of the package. The ASN.1 C++ Runtime Library is designed as a set of common functions for encoding and decoding the base ASN.1 types (BOOLEAN, INTEGER, etc.) and a rich collection of utility functions to operate on application messages. The ASN.1 C++ Runtime Library is also meta-orient, that is, the metadata is loaded at runtime, and can be freed after usage.

ASN.1 C++ Compiler Features

  • Straightforward and intuitive ASN.1 types/C++ classes mapping, smoother learning curve.

    The ASN.1 C++ Compiler always generates type as primitive as possible, and not inherit any class, the mapping between ASN.1 types and C++ classes is quite simple and intuitive, you don't have to learn some special API in order to use these codes. Such minimize your time and effort to get familiar with the generated codes.

  • Metadata-oriented, minimal generated codes size.

    Generates only type-safe C++ classes and metadata for ASN.1 types, such minimize the codes generated, resulting a higher code reuse rate.

  • High speed encoding/decoding with multi-thread support.

    Some assumptions greatly improve the speed of encoding/decoding. Of course these assumptions also pose some limitations.

  • Auto-release of metadata and message memory

    Auto-release of the metadata memory, free utility function to free the dynamic content of message.

Known Limitations

  • ASN.1 Development Tools Limitations

    Because ASN.1 C++ Compiler extent the ASN.1 Development Tools, it has all the limitations of ASN.1 Development Tools.

  • Tag

    The long integer are used to hold the encoded tag for optimization reason, which limits the representable tag code to less than 221 but for reasonable ASN.1 specifications this should not be a problem.

  • Length

    The length of enumerated items, bit string, octet string, components or alternatives can't exceed maximum of size_t in C++.


    The value of INTEGER should be in the range of long long (or __int64_t for Windows) type in C++, i.e. arbitrarily large integer numbers are not supported. The BigInteger is now supported.

  • REAL

    The value of REAL is allways encoded/decoded in binary form, the precision should never exceed double type in C++, i.e. arbitrary precision decimal numbers are not support.

  • SET OF

    SET OF value dynamic sort is not supported, it's recommended to use SEQUENCE OF type instead of SET OF type.


Continue to Getting started with the ASN.1 C++ Compiler.