Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Containers

The asn_container_t template supplied by the Boost.ASN1 library is simple mechanism for applications to send/receive sequences of ASN1 objects in a vector like manner. The asn_container_t template supports simple vector methods for manipulating data; assign(), append(), get() and erase().

[Note] Note

Creating support for complex protocols with asn_container_t templates can be a very painful experience. This template is mentioned here so that programmers will understand the underlying mechanisms of dealing with sequences, as mentioned in the Data Encoding section.

This template has specializations for the various containers required by the ASN1 specification.

ASN1 Type C++ Equiv
SEQUENCE sequence_t
SET set_t
SEQUENCE OF sequence_of_t
SET OF set_of_t

The ASN1 container objects allow for very simple usage. For instance, to assign data, you can do the following:

sequence_t simpleSequence;

simpleSequence.append(integer_t(1))
              .append(ia5string_t("text."));
              
octectstring_t oString = simpleSequence.get(1);
cout << oString << endl;

Copyright © 2007 Andreas Haberstroh

PrevUpHomeNext