ASN1C C/C++ Common Runtime  ASN1C v7.5.x
Public Member Functions | Static Public Member Functions | List of all members
Asn1ErrorHandler Class Referenceabstract

#include <asn1CppEvtHndlr.h>

Public Member Functions

virtual int error (OSCTXT *pCtxt, ASN1CCB *pCCB, int stat)=0
 

Static Public Member Functions

static EXTRTMETHOD int invoke (OSCTXT *pCtxt, ASN1CCB *pCCB, int stat)
 
static EXTRTMETHOD int invoke (OSCTXT *pCtxt, OSOCTET *ptr, int len, int stat)
 
static EXTRTMETHOD void setErrorHandler (OSCTXT *pCtxt, Asn1ErrorHandler *pHandler)
 

Detailed Description

Error handler base class. This is the base class from which user-defined error classes are derived. These classes can be used to provide fault-tolerance when parsing a message. The normal decoder behavior is to stop decoding when it encounters an error. An error handler can be used to ignore or take corrective action that will allow the decoding process to continue.

Member Function Documentation

◆ error()

virtual int Asn1ErrorHandler::error ( OSCTXT pCtxt,
ASN1CCB pCCB,
int  stat 
)
pure virtual

The error handler callback method. This is the method that the user must override to provide customized error handling.

Parameters
pCtxt- Pointer to a context block structure.
pCCB- Pointer to a context control block structure.
stat- The error status that caused the handler to be invoked.
Returns
- Corrected status. Set to 0 to cause decoding to continue or to a negative status code (most likely stat) to cause decoding to terminate.

◆ setErrorHandler()

static EXTRTMETHOD void Asn1ErrorHandler::setErrorHandler ( OSCTXT pCtxt,
Asn1ErrorHandler pHandler 
)
static

This static method is called to set the error handler within the context structure. Note that unlike event handlers, only a single error handling object can be specified. This must be called by the user to specify the error handling object prior to execution of the main decode function..

Parameters
pCtxt- Pointer to a context block structure.
pHandler- Pointer to error handler object to register.

Referenced by ASN1MessageBuffer::setErrorHandler().


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