ASN1C C/C++ Common Runtime  ASN1C v7.7.x
Public Member Functions | Protected Member Functions | List of all members
ASN1MessageBuffer Class Reference

#include <asn1CppTypes.h>

Inheritance diagram for ASN1MessageBuffer:
OSRTMessageBuffer

Public Member Functions

virtual ~ASN1MessageBuffer ()
 
virtual void addEventHandler (Asn1NamedEventHandler *pEventHandler)
 
void addRawEventHandler (Asn1RawEventHandler *pHandler)
 
ASN1BMPStringCStringToBMPString (const char *cstring, ASN1BMPString *pBMPString, Asn116BitCharSet *pCharSet=0)
 
virtual void * getAppInfo ()
 
virtual EXTRTMETHOD int initBuffer (OSRTMEMBUF &membuf)
 
virtual EXTRTMETHOD int initBuffer (OSUNICHAR *unistr)
 
virtual int initBuffer (const OSUTF8CHAR *)
 
virtual OSBOOL isA (Type)
 
virtual void removeEventHandler (Asn1NamedEventHandler *pEventHandler)
 
void removeRawEventHandler ()
 
virtual void resetErrorInfo ()
 
virtual void setAppInfo (void *)
 
virtual void setErrorHandler (Asn1ErrorHandler *pErrorHandler)
 
EXTRTMETHOD int setRunTimeKey (const OSOCTET *key, OSSIZE keylen)
 
size_t getBitOffset ()
 
OSOCTET * GetMsgCopy ()
 
const OSOCTET * GetMsgPtr ()
 
void PrintErrorInfo ()
 
- Public Member Functions inherited from OSRTMessageBuffer
virtual ~OSRTMessageBuffer ()
 
virtual size_t getByteIndex ()
 
virtual OSRTCtxtPtr getContext ()
 
virtual OSCTXTgetCtxtPtr ()
 
virtual char * getErrorInfo ()
 
virtual char * getErrorInfo (char *pBuf, size_t &bufSize)
 
virtual OSOCTET * getMsgCopy ()
 
virtual const OSOCTET * getMsgPtr ()
 
virtual size_t getMsgLen ()
 
int getStatus () const
 
virtual int init ()
 
virtual EXTRTMETHOD int initBuffer (OSOCTET *pMsgBuf, size_t msgBufLen)
 
virtual void printErrorInfo ()
 
virtual EXTRTMETHOD void setDiag (OSBOOL value=TRUE)
 

Protected Member Functions

EXTRTMETHOD ASN1MessageBuffer (Type bufferType)
 
EXTRTMETHOD ASN1MessageBuffer (Type bufferType, OSRTContext *pContext)
 
virtual int setStatus (int stat)
 
- Protected Member Functions inherited from OSRTMessageBuffer
EXTRTMETHOD OSRTMessageBuffer (Type bufferType, OSRTContext *pContext=0)
 

Additional Inherited Members

- Protected Attributes inherited from OSRTMessageBuffer
OSRTCtxtHolder mCtxtHolder
 
Type mBufferType
 

Detailed Description

Abstract ASN.1 message buffer base class. This class is used to manage a message buffer containing an ASN.1 message. For encoding, this is the buffer the message is being built in. For decoding, it is a message that was read into memory to be decoded. Further classes are derived from this to handle encoding and decoding of messages for different encoding rules types.

Constructor & Destructor Documentation

◆ ASN1MessageBuffer() [1/2]

EXTRTMETHOD ASN1MessageBuffer::ASN1MessageBuffer ( Type  bufferType)
protected

The protected constructor creates a new context and sets the buffer class type.

Parameters
bufferTypeType of message buffer that is being created (for example, BEREncode).

◆ ASN1MessageBuffer() [2/2]

EXTRTMETHOD ASN1MessageBuffer::ASN1MessageBuffer ( Type  bufferType,
OSRTContext pContext 
)
protected

This constructor sets the buffer class type and also a pointer to a context created by the user.

Parameters
bufferTypeType of message buffer that is being created (for example, BEREncode).
pContextA pointer to an OSRTContext structure previously created by the user.

◆ ~ASN1MessageBuffer()

virtual ASN1MessageBuffer::~ASN1MessageBuffer ( )
inlinevirtual

The virtual destructor does nothing. It is overridden by derived versions of this class.

Member Function Documentation

◆ addEventHandler()

virtual void ASN1MessageBuffer::addEventHandler ( Asn1NamedEventHandler pEventHandler)
inlinevirtual

The addEventHandler method is used to register a used-defined named event handler. Methods from within this handler will be invoked when this message buffer is used in the decoding of a message.

Parameters
pEventHandler- Pointer to named event handler object to register.

References Asn1NamedEventHandler::addEventHandler(), and OSRTMessageBuffer::getCtxtPtr().

◆ addRawEventHandler()

void ASN1MessageBuffer::addRawEventHandler ( Asn1RawEventHandler *  pHandler)
inline

Add the given event handler to this object's context, replacing any previous event handler. This does not take ownership of the handler.

References OSRTMessageBuffer::getCtxtPtr().

◆ CStringToBMPString()

ASN1BMPString* ASN1MessageBuffer::CStringToBMPString ( const char *  cstring,
ASN1BMPString pBMPString,
Asn116BitCharSet pCharSet = 0 
)

The CStringToBMPString method is a utility function for converting a null-terminated Ascii string into a BMP string. A BMP string contains 16-bit Unicode characters.

Parameters
cstring- Null-terminated character string to convert
pBMPString- Pointer to BMP string target variable
pCharSet- Pointer to permitted alphabet character set. If provided, index to character within this set is returned.

◆ getAppInfo()

virtual void* ASN1MessageBuffer::getAppInfo ( )
inlinevirtual

Returns a pointer to application-specific information block

Reimplemented from OSRTMessageBuffer.

References OSRTMessageBuffer::initBuffer(), and RTERR_NOTSUPP.

◆ getBitOffset()

size_t ASN1MessageBuffer::getBitOffset ( )
inline

This method returns the current bit offset in the message buffer.

Parameters
-none

References OSRTMessageBuffer::getCtxtPtr(), OSRTMessageBuffer::getMsgCopy(), OSRTMessageBuffer::getMsgPtr(), OSRTMessageBuffer::printErrorInfo(), and rtxCtxtGetBitOffset().

◆ initBuffer() [1/2]

virtual EXTRTMETHOD int ASN1MessageBuffer::initBuffer ( OSRTMEMBUF membuf)
virtual

This version of the overloaded initBuffer method initializes the message buffer to point at the memory contained within the referenced OSRTMEMBUF object.

Parameters
membufOSRTMEMBUF memory buffer class object reference.
Returns
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

◆ initBuffer() [2/2]

virtual EXTRTMETHOD int ASN1MessageBuffer::initBuffer ( OSUNICHAR *  unistr)
virtual

This version of the overloaded initBuffer method initializes the message buffer to point at the given Unicode string. This is used mainly for XER (XML) message decoding.

Parameters
unistrPointer to a Unicode character string.
Returns
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

◆ isA()

virtual OSBOOL ASN1MessageBuffer::isA ( Type  )
inlinevirtual

This method checks the type of the message buffer.

Parameters
bufferTypeEnumerated identifier specifying a derived class. Possible values are: BEREncode, BERDecode, PEREncode, PERDecode, XMLEncode, XMLDecode, Stream.
Returns
Boolean result of the match operation. True if this is the class corresponding to the identifier argument.

◆ removeEventHandler()

virtual void ASN1MessageBuffer::removeEventHandler ( Asn1NamedEventHandler pEventHandler)
inlinevirtual

The removeEventHandler method is used to de-register a used-defined named event handler.

Parameters
pEventHandler- Pointer to named event handler object to de-register.

References OSRTMessageBuffer::getCtxtPtr(), and Asn1NamedEventHandler::removeEventHandler().

◆ removeRawEventHandler()

void ASN1MessageBuffer::removeRawEventHandler ( )
inline

Remove the event handler from this object's context.

References OSRTMessageBuffer::getCtxtPtr().

◆ resetErrorInfo()

virtual void ASN1MessageBuffer::resetErrorInfo ( )
inlinevirtual

The resetErrorInfo method resets information on errors contained within the context.

Reimplemented from OSRTMessageBuffer.

References OSRTMessageBuffer::resetErrorInfo().

◆ setAppInfo()

virtual void ASN1MessageBuffer::setAppInfo ( void *  )
inlinevirtual

Sets the application-specific information block.

Reimplemented from OSRTMessageBuffer.

◆ setErrorHandler()

virtual void ASN1MessageBuffer::setErrorHandler ( Asn1ErrorHandler pErrorHandler)
inlinevirtual

The setErrorHandler method is used to register a used-defined error handler. Methods from within this handler will be invoked when an error occurs in decoding a message using this message buffer object.

Parameters
pErrorHandler- Pointer to error handler object to register.

References OSRTMessageBuffer::getCtxtPtr(), and Asn1ErrorHandler::setErrorHandler().

◆ setRunTimeKey()

EXTRTMETHOD int ASN1MessageBuffer::setRunTimeKey ( const OSOCTET *  key,
OSSIZE  keylen 
)

This method sets run-time key to the context. This method does nothing for unlimited redistribution libraries.

Parameters
key- array of octets with the key
keylen- number of octets in key array.
Returns
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

◆ setStatus()

virtual int ASN1MessageBuffer::setStatus ( int  stat)
inlineprotectedvirtual

This method sets error status to the context.

Returns
Error status value being set.

References OSRTMessageBuffer::getContext(), and OSRTContext::setStatus().


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