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

#include <asn1CppEvtHndlr.h>

Inheritance diagram for Asn1NamedEventHandler:
Asn1NullEventHandler

Public Member Functions

virtual void startElement (const char *name, int index)=0
 
virtual void endElement (const char *name, int index)=0
 
virtual void boolValue (OSBOOL value)
 
virtual void intValue (OSINT32 value)
 
virtual void uIntValue (OSUINT32 value)
 
virtual void int64Value (OSINT64 value)
 
virtual void uInt64Value (OSUINT64 value)
 
virtual void bitStrValue (OSUINT32 numbits, const OSOCTET *data)
 
virtual void octStrValue (OSUINT32 numocts, const OSOCTET *data)
 
virtual void charStrValue (const char *value)
 
virtual void charStrValue (OSUINT32 nchars, const OSUTF8CHAR *value)
 
virtual void charStrValue (OSUINT32 nchars, OSUNICHAR *data)
 
virtual void charStrValue (OSUINT32 nchars, OS32BITCHAR *data)
 
virtual void nullValue ()
 
virtual void oidValue (OSUINT32 numSubIds, OSUINT32 *pSubIds)
 
virtual void realValue (double value)
 
virtual void enumValue (OSUINT32 value, const OSUTF8CHAR *text)
 
virtual void openTypeValue (OSUINT32 numocts, const OSOCTET *data)
 

Static Public Member Functions

static EXTRTMETHOD void addEventHandler (OSCTXT *pCtxt, Asn1NamedEventHandler *pHandler)
 
static EXTRTMETHOD void removeEventHandler (OSCTXT *pCtxt, Asn1NamedEventHandler *pHandler)
 
static EXTRTMETHOD void invokeStartElement (OSCTXT *pCtxt, const char *name, int index)
 
static EXTRTMETHOD void invokeEndElement (OSCTXT *pCtxt, const char *name, int index)
 
static EXTRTMETHOD void invokeBoolValue (OSCTXT *pCtxt, OSBOOL value)
 
static EXTRTMETHOD void invokeIntValue (OSCTXT *pCtxt, OSINT32 value)
 
static EXTRTMETHOD void invokeUIntValue (OSCTXT *pCtxt, OSUINT32 value)
 
static EXTRTMETHOD void invokeInt64Value (OSCTXT *pCtxt, OSINT64 value)
 
static EXTRTMETHOD void invokeUInt64Value (OSCTXT *pCtxt, OSUINT64 value)
 
static EXTRTMETHOD void invokeBitStrValue (OSCTXT *pCtxt, OSUINT32 numbits, const OSOCTET *data)
 
static EXTRTMETHOD void invokeOctStrValue (OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)
 
static EXTRTMETHOD void invokeCharStrValue (OSCTXT *pCtxt, const char *value)
 
static EXTRTMETHOD void invokeCharStrValue (OSCTXT *pCtxt, OSUINT32 nchars, OSUNICHAR *data)
 
static EXTRTMETHOD void invokeCharStrValue (OSCTXT *pCtxt, OSUINT32 nchars, OS32BITCHAR *data)
 
static EXTRTMETHOD void invokeCharStrValue (OSCTXT *pCtxt, OSUINT32 nchars, const OSUTF8CHAR *data)
 
static EXTRTMETHOD void invokeNullValue (OSCTXT *pCtxt)
 
static EXTRTMETHOD void invokeOidValue (OSCTXT *pCtxt, OSUINT32 numSubIds, OSUINT32 *pSubIds)
 
static EXTRTMETHOD void invokeRealValue (OSCTXT *pCtxt, double value)
 
static EXTRTMETHOD void invokeEnumValue (OSCTXT *pCtxt, OSUINT32 value, const OSUTF8CHAR *text)
 
static EXTRTMETHOD void invokeOpenTypeValue (OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)
 

Detailed Description

Named event handler base class. This is the base class from which user-defined event handler classes are derived. These classes can be used to handle events during the parsing of an ASN.1 message. The event callback methods that can be implemented are startElement, endElement, and contents methods.

Member Function Documentation

◆ addEventHandler()

static EXTRTMETHOD void Asn1NamedEventHandler::addEventHandler ( OSCTXT pCtxt,
Asn1NamedEventHandler pHandler 
)
static

This method is called to add a new event handler to the context event handler list. It is a static method.

Parameters
pCtxtA pointer-to an OSCTXT data structure.
pHandlerA pointer to an Asn1NamedEventHandler.

Referenced by ASN1MessageBuffer::addEventHandler().

◆ bitStrValue()

virtual void Asn1NamedEventHandler::bitStrValue ( OSUINT32  numbits,
const OSOCTET *  data 
)
inlinevirtual

This method is invoked from within a decode function when a value of the BIT STRING ASN.1 type is parsed.

Parameters
numbits- Number of bits in the parsed value.
data- Pointer to a byte array that contains the bit string data.
Returns
- none

References OS_UNUSED_ARG.

◆ boolValue()

virtual void Asn1NamedEventHandler::boolValue ( OSBOOL  value)
inlinevirtual

This method is invoked from within a decode function when a value of the BOOLEAN ASN.1 type is parsed.

Parameters
valueParsed value.
Returns
- none

References OS_UNUSED_ARG.

◆ charStrValue() [1/4]

virtual void Asn1NamedEventHandler::charStrValue ( const char *  value)
inlinevirtual

This method is invoked from within a decode function when a value of one of the 8-bit ASN.1 character string types is parsed.

Parameters
valueNull terminated character string value.
Returns
- none

References OS_UNUSED_ARG.

◆ charStrValue() [2/4]

virtual void Asn1NamedEventHandler::charStrValue ( OSUINT32  nchars,
const OSUTF8CHAR *  value 
)
inlinevirtual

This method is invoked from within a decode function when a value of a UTF-8 character string type is parsed.

Parameters
ncharsNumber of characters in the parsed value.
valueA UTF-8 character string.
Returns
- none

References OS_UNUSED_ARG.

◆ charStrValue() [3/4]

virtual void Asn1NamedEventHandler::charStrValue ( OSUINT32  nchars,
OSUNICHAR *  data 
)
inlinevirtual

This method is invoked from within a decode function when a value of one of the 16-bit ASN.1 character string types is parsed.

This is used for the ASN.1 BmpString type.

Parameters
ncharsNumber of characters in the parsed value.
dataPointer to an array containing 16-bit values. These are represented using unsigned short integer values.
Returns
- none

References OS_UNUSED_ARG.

◆ charStrValue() [4/4]

virtual void Asn1NamedEventHandler::charStrValue ( OSUINT32  nchars,
OS32BITCHAR *  data 
)
inlinevirtual

This method is invoked from within a decode function when a value of one of the 32-bit ASN.1 characer string types is parsed.

This is used for the ASN.1 UniversalString type.

Parameters
ncharsNumber of characters in the parsed value.
dataPointer to an array containing 32-bit values. Each 32-bit integer value is a universal character.
Returns
- none

References OS_UNUSED_ARG.

◆ endElement()

virtual void Asn1NamedEventHandler::endElement ( const char *  name,
int  index 
)
pure virtual

This method is invoked from within a decode function when parsing is complete on an element of a SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct.

Parameters
nameFor SEQUENCE, SET, or CHOICE, this is the name of the element as defined in the ASN.1 defination. For SEQUENCE OF or SET OF, this is set to the name "element".
indexFor SEQUENCE, SET, or CHOICE, this is not used and is set to the value -1. For SEQUENCE OF or SET OF, this contains the zero-based index of the element in the conceptual array associated with the construct.
Returns
- none

Implemented in Asn1NullEventHandler.

◆ enumValue()

virtual void Asn1NamedEventHandler::enumValue ( OSUINT32  value,
const OSUTF8CHAR *  text 
)
inlinevirtual

This method is invoked from within a decode function when a value of the ENUMERATED ASN.1 type is parsed.

Parameters
value- Parsed enumerated value
text- Textual value of enumerated identifier
Returns
- none

References OS_UNUSED_ARG.

◆ int64Value()

virtual void Asn1NamedEventHandler::int64Value ( OSINT64  value)
inlinevirtual

This method is invoked from within a decode function when a value of the 64-bit INTEGER ASN.1 type is parsed.

Parameters
valueParsed value.
Returns
- none

◆ intValue()

virtual void Asn1NamedEventHandler::intValue ( OSINT32  value)
inlinevirtual

This method is invoked from within a decode function when a value of the INTEGER ASN.1 type is parsed.

Parameters
valueParsed value.
Returns
- none

References OS_UNUSED_ARG.

◆ invokeBitStrValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeBitStrValue ( OSCTXT pCtxt,
OSUINT32  numbits,
const OSOCTET *  data 
)
static

This method is called by generated code to invoke the event handlers' bit string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
numbitsThe number of bits in the decoded bit string.
dataThe decoded bit string data.

◆ invokeBoolValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeBoolValue ( OSCTXT pCtxt,
OSBOOL  value 
)
static

This method is called by generated code to invoke the event handlers' boolean method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded boolean value.

◆ invokeCharStrValue() [1/4]

static EXTRTMETHOD void Asn1NamedEventHandler::invokeCharStrValue ( OSCTXT pCtxt,
const char *  value 
)
static

This method is called by generated code to invoke the event handlers' character string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueThe decoded character string.

◆ invokeCharStrValue() [2/4]

static EXTRTMETHOD void Asn1NamedEventHandler::invokeCharStrValue ( OSCTXT pCtxt,
OSUINT32  nchars,
OSUNICHAR *  data 
)
static

This method is called by generated code to invoke the event handlers' 16-bit character string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
ncharsThe number of characters in the string.
valueThe decoded 16-bit character string.

◆ invokeCharStrValue() [3/4]

static EXTRTMETHOD void Asn1NamedEventHandler::invokeCharStrValue ( OSCTXT pCtxt,
OSUINT32  nchars,
OS32BITCHAR *  data 
)
static

This method is called by generated code to invoke the event handlers' 32-bit character string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
ncharsThe number of characters in the string.
valueThe decoded character string.

◆ invokeCharStrValue() [4/4]

static EXTRTMETHOD void Asn1NamedEventHandler::invokeCharStrValue ( OSCTXT pCtxt,
OSUINT32  nchars,
const OSUTF8CHAR *  data 
)
static

This method is called by generated code to invoke the event handlers' UTF-8 character string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
ncharsThe number of characters in the string.
valueThe decoded character string.

◆ invokeEndElement()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeEndElement ( OSCTXT pCtxt,
const char *  name,
int  index 
)
static

This method is called by generated code to invoke the event handlers' end element methods. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
nameThe name of the element.
indexThe index of the element, if it is in a SEQUENCE or SET OF type.

◆ invokeEnumValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeEnumValue ( OSCTXT pCtxt,
OSUINT32  value,
const OSUTF8CHAR *  text 
)
static

This method is called by generated code to invoke the event handlers' enumerated method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded 64-bit integer value.
textThe character string representation of the value.

◆ invokeInt64Value()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeInt64Value ( OSCTXT pCtxt,
OSINT64  value 
)
static

This method is called by generated code to invoke the event handlers' 64-bit integer method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded 64-bit integer value.

◆ invokeIntValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeIntValue ( OSCTXT pCtxt,
OSINT32  value 
)
static

This method is called by generated code to invoke the event handlers' integer method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded 32-bit integer value.

◆ invokeNullValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeNullValue ( OSCTXT pCtxt)
static

This method is called by generated code to invoke the event handlers' null method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.

◆ invokeOctStrValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeOctStrValue ( OSCTXT pCtxt,
OSUINT32  numocts,
const OSOCTET *  data 
)
static

This method is called by generated code to invoke the event handlers' octet string method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
numoctsThe number of octets in the decoded octet string.
dataThe decoded octet string data.

◆ invokeOidValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeOidValue ( OSCTXT pCtxt,
OSUINT32  numSubIds,
OSUINT32 *  pSubIds 
)
static

This method is called by generated code to invoke the event handlers' object identifier method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
numSubIdsThe number of OID subids.
valueThe decoded OID ids.

◆ invokeOpenTypeValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeOpenTypeValue ( OSCTXT pCtxt,
OSUINT32  numocts,
const OSOCTET *  data 
)
static

This method is called by generated code to invoke the event handlers' open type method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
numoctsThe number of octets in the open type.
dataThe data octets that comprise the open type value.

◆ invokeRealValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeRealValue ( OSCTXT pCtxt,
double  value 
)
static

This method is called by generated code to invoke the event handlers' real method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded real value.

◆ invokeStartElement()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeStartElement ( OSCTXT pCtxt,
const char *  name,
int  index 
)
static

This method is called by generated code to invoke the event handlers' start element methods. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
nameThe name of the element.
indexThe index of the element, if it is in a SEQUENCE or SET OF type.

◆ invokeUInt64Value()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeUInt64Value ( OSCTXT pCtxt,
OSUINT64  value 
)
static

This method is called by generated code to invoke the event handlers' unsigned 64-bit integer method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded 64-bit integer value.

◆ invokeUIntValue()

static EXTRTMETHOD void Asn1NamedEventHandler::invokeUIntValue ( OSCTXT pCtxt,
OSUINT32  value 
)
static

This method is called by generated code to invoke the event handlers' unsigned integer method. It is static.

Parameters
pCtxtA pointer to an OSCTXT data structure.
valueA decoded unsigned 32-bit integer value.

◆ nullValue()

virtual void Asn1NamedEventHandler::nullValue ( )
inlinevirtual

This method is invoked from within a decode function when a value of the NULL ASN.1 type is parsed.

Parameters
-none
Returns
- none

◆ octStrValue()

virtual void Asn1NamedEventHandler::octStrValue ( OSUINT32  numocts,
const OSOCTET *  data 
)
inlinevirtual

This method is invoked from within a decode function when a value of one of the OCTET STRING ASN.1 type is parsed.

Parameters
numoctsNumber of octets in the parsed value.
dataPointer to byte array containing the octet string data.
Returns
- none

References OS_UNUSED_ARG.

◆ oidValue()

virtual void Asn1NamedEventHandler::oidValue ( OSUINT32  numSubIds,
OSUINT32 *  pSubIds 
)
inlinevirtual

This method is invoked from within a decode function whn a value the OBJECT IDENTIFIER ASN.1 type is parsed.

Parameters
numSubIdsNumber of subidentifiers in the object identifier.
pSubIdsPointer to array containing the subidentifier values.
Returns
-none

References OS_UNUSED_ARG.

◆ openTypeValue()

virtual void Asn1NamedEventHandler::openTypeValue ( OSUINT32  numocts,
const OSOCTET *  data 
)
inlinevirtual

This value is invoked from within a decode function when an ASN.1 open type is parsed.

Parameters
numoctsNumber of octets in the parsed value.
dataPointer to byet array contain in tencoded ASN.1 value.
Returns
- none

References OS_UNUSED_ARG.

◆ realValue()

virtual void Asn1NamedEventHandler::realValue ( double  value)
inlinevirtual

This method is invoked from within a decode function when a value the REAL ASN.1 type is parsed.

Parameters
valueParsed value.
Returns
- none

References OS_UNUSED_ARG.

◆ removeEventHandler()

static EXTRTMETHOD void Asn1NamedEventHandler::removeEventHandler ( OSCTXT pCtxt,
Asn1NamedEventHandler pHandler 
)
static

This method removes the given event handler from the context event handler list. This method does not delete the handler, so memory allocated for it will need to be released elsewhere.

Parameters
pCtxtA pointer-to an OSCTXT data structure.
pHandlerA pointer to an Asn1NamedEventHandler.

Referenced by ASN1MessageBuffer::removeEventHandler().

◆ startElement()

virtual void Asn1NamedEventHandler::startElement ( const char *  name,
int  index 
)
pure virtual

This method is invoked from within a decode function when an element of a SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct is parsed.

Parameters
nameFor SEQUENCE, SET, or CHOICE, this is the name of the element as defined in the ASN.1 defination. For SEQUENCE OF or SET OF, this is set to the name "element".
indexFor SEQUENCE, SET, or CHOICE, this is not used and is set to the value -1. For SEQUENCE OF or SET OF, this contains the zero-based index of the element in the conceptual array associated with the construct.
Returns
- none

Implemented in Asn1NullEventHandler.

◆ uInt64Value()

virtual void Asn1NamedEventHandler::uInt64Value ( OSUINT64  value)
inlinevirtual

This method is invoked from within a decode function when a value of the 64-bit INTEGER ASN.1 type is parsed.

Parameters
valueParsed value.
Returns
- none

◆ uIntValue()

virtual void Asn1NamedEventHandler::uIntValue ( OSUINT32  value)
inlinevirtual

This method is invoked from within a decode function when a value of the INTEGER ASN.1 type is parsed.

In this case, constraints on the integer value forced the use of unsigned integer C type to represent the value.

Parameters
valueParsed value.
Returns
- none

References OS_UNUSED_ARG.


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