Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class asn_visitor_t

boost::asn1::asn_visitor_t —

Synopsis

class asn_visitor_t {
public:
  // construct/copy/destruct
  asn_visitor_t(iostream &);

  // public member functions
  iostream & stream() ;
  uint32_t execute(asn_base_ptr &) ;
  uint32_t visit(asn_base_ptr &) ;
};

Description

ASN1 visitor class

Overview

The asn_visitor_t is a Visitor pattern interface for ASN1 codecs, so that encoding and decoding of an ASN1 data packet is homogenous in it's interface.

The asn_visitor_t class exposes an iostream object that is used by all visiting ASN1 objects to encode/decode their respective data.

asn_encode, asn_decode

asn_visitor_t construct/copy/destruct

  1. asn_visitor_t(iostream & strm);

    Default constructor

    Parameters:
    strm

    iostream used for visiting ASN1 objects.

asn_visitor_t public member functions

  1. iostream & stream() ;

    Gets the iostream associated with this visitor object.

  2. uint32_t execute(asn_base_ptr & asn_object) ;

    Executes a visitation process.

    Starts the process of visitation. Reads/Writes the tag and then calls the ASN1 object's visit function.

    When decoding, receives a created copy of the ASN1 object. On encoding the asn_object is the ASN1 packet to encode.

    Parameters:
    asn_object

    Used for the encode/decode process

    Returns:

    Number of bytes visited

  3. uint32_t visit(asn_base_ptr & asn_object) ;

    Visits an individual ASN1 object.

    Visits the ASN1 object's encode/decode methods to read/write data to the stream.

    Parameters:
    asn_object

    When decoding, receives a created copy of the ASN1 object. On encoding the asn_object is the ASN1 packet to encode.

    Returns:

    Number of bytes visited

Copyright © 2007 Andreas Haberstroh

PrevUpHomeNext