Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Open Source
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

ASN1BEREncodeBuffer Class Reference
[BER Message Buffer Classes]

#include <asn1BerCppTypes.h>

Inheritance diagram for ASN1BEREncodeBuffer:

ASN1BERMessageBuffer List of all members.

Detailed Description

The ANS1BEREncodeBuffer class is derived from the ASN1BERMessageBuffer base class. It contains variables and methods specific to encoding ASN.1 messages using the Basic Encoding Rules (BER). It is used to manage the buffer into which an ASN.1 message is to be encoded.


Public Member Functions

 ASN1BEREncodeBuffer ()
 ASN1BEREncodeBuffer (ASN1OCTET *pMsgBuf, size_t msgBufLen)
virtual ASN1OCTET * getMsgCopy ()
virtual const ASN1OCTET * getMsgPtr ()
int init ()
virtual ASN1BOOL isA (Type bufferType)
int setBuffer (ASN1OCTET *pMsgBuf, size_t msgBufLen)
ASN1BEREncodeBufferoperator<< (ASN1CType &val)


Constructor & Destructor Documentation

ASN1BEREncodeBuffer::ASN1BEREncodeBuffer  ) 
 

A Constructor. ASN1BEREncodeBuffer has 2 overloaded constructors. This version tales no arguments (dynamic encoding version). Use getStatus() method to determine has error occured during the initialization or not.

ASN1BEREncodeBuffer::ASN1BEREncodeBuffer ASN1OCTET *  pMsgBuf,
size_t  msgBufLen
 

A Constructor. ASN1BEREncodeBuffer has 2 overloaded constructors. This version takes a message buffer ans size argument (static encoding version) Use getStatus() method to determine has error occured during the initialization or not.

Parameters:
pMsgBuf A pointer to a fixed size message buffer to recieve the encoded message.
msgBufLen Size of the fixed-size message buffer.


Member Function Documentation

virtual ASN1OCTET* ASN1BEREncodeBuffer::getMsgCopy  )  [virtual]
 

This method returns a copy of the current encoded message. Memory is allocated for the message using the 'new []' operation. It is the users's responsibility to free the memory using 'delete []'.

Calling Sequence:

ptr = encodeBuffer.getMsgCopy ();

where encodeBuffer is an ASN1BEREncodeBuffer object.

Returns:
Pointer to copy of encoded message. It is the users's responsibility to free the memory using 'delete []' (i.e., delete [] ptr;).

virtual const ASN1OCTET* ASN1BEREncodeBuffer::getMsgPtr  )  [virtual]
 

This method returns the internal pointer to the current encoded message. Calling Sequence:

ptr = encodeBuffer.getMsgPtr ();

where encodeBuffer is an ASN1BEREncodeBuffer object.

Returns:
Pointer to encoded message.

int ASN1BEREncodeBuffer::init  ) 
 

This method reinitializes the encode buffer pointer to allow a new message to be encoded. This makes it possible to reuse one message buffer object in a loop to encode multiple messages. After this method is called, any previously encoded message in the buffer will be overwritten on the next encode call.

Calling Sequence:

encodeBuffer.init ();

where encodeBuffer is an ASN1BEREncodeBuffer object.

Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

virtual ASN1BOOL ASN1BEREncodeBuffer::isA Type  bufferType  )  [inline, virtual]
 

This method checks the type of the message buffer.

Parameters:
bufferType Enumerated identifier specifying a derived class. The only possible value for this class is BEREncode.
Returns:
Boolean result of the match operation. True if this is the class corresponding to the identifier argument.

ASN1BEREncodeBuffer& ASN1BEREncodeBuffer::operator<< ASN1CType &  val  ) 
 

This operator encodes instance of ASN1CType derived class. Use getStatus() method to determine has error occured during the operation or not.

int ASN1BEREncodeBuffer::setBuffer ASN1OCTET *  pMsgBuf,
size_t  msgBufLen
 

This method sets a buffer to receive the encoded message.

Parameters:
pMsgBuf A pointer to a memory buffer to use to encode a message. The buffer should be declared as an array of unsigned characters (ASN1OCTETs). This parameter can be set to NULL to specify dynamic encoding (i.e., the encode functions will dynamically allocate a buffer for the message).
msgBufLen The length of the memory buffer in bytes. If pMsgBuf is NULL, this parameter specifies the initial size of the dynamic buffer; if 0 - the default size will be used.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.


The documentation for this class was generated from the following file:

Copyright © 1997-2005 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 8 Sep 2005.
ASN1C BER Runtime, ASN1C v5.8x