ASN1C C/C++ Common Runtime  ASN1C v7.8.x
asn1CppEvtHndlr64.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1997-2022 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
24 
25 // rtsrc/asn1CppEvtHndlr64.h - this .h file defines the object that is
26 // registered for the C++ version of the event handler feature.
27 
38 #ifndef _ASN1CPPEVTHNDLR64_H_
39 #define _ASN1CPPEVTHNDLR64_H_
40 
41 #include "rtsrc/asn1CppEvtHndlr.h"
42 
43 #ifndef _WIN32
44 /* Set gcc to ignore the "virtual override intended?" warning for this header
45  file. It is not an error - the override is indeed intended (ASN-9912).
46  However, a customer who has warnings set as errors (such as for ASN-11080)
47  will get compilation failures if it is not marked as ignored...
48 */
49 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
50 #endif
51 
52 // The following pure abstract class defines the event handler interface
53 // callback functions that are invoked as a message is parsed..
61 class EXTRTCLASS Asn1NamedEventHandler64 : public Asn1NullEventHandler {
62  public:
64  virtual ~Asn1NamedEventHandler64() {}
65 
66  // Start element callback function. This is invoked upon entry into
67  // an element in a constructed type (SEQUENCE, SET, SEQUENCE OF,
68  // SET OF, or CHOICE). A single char* argument (name) is passed.
84  virtual void startElement (const char* name, OSSIZE index) = 0;
85 #if __cplusplus >= 201103L
87 #endif
88 
89  // End element callback function. This is invoked upon exit from
90  // a constructed type. A single char* argument (name) is passed.
107  virtual void endElement (const char* name, OSSIZE index) = 0;
108 #if __cplusplus >= 201103L
110 #endif
111 
112  // Data callback functions. These are invoked when data contents
113  // are parsed from a field. A separate callback is invoked for
114  // each of the ASN.1 primitive data types..
115 
125  virtual void bitStrValue (OSSIZE numbits, const OSOCTET* data) {
126  OS_UNUSED_ARG(numbits); OS_UNUSED_ARG(data);
127  }
128 #if __cplusplus >= 201103L
130 #endif
131 
141  virtual void octStrValue (OSSIZE numocts, const OSOCTET* data) {
142  OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
143  }
144 #if __cplusplus >= 201103L
146 #endif
147 
156  virtual void charStrValue (OSSIZE nchars, const OSUTF8CHAR* value) {
157  OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(value);
158  }
159 #if __cplusplus >= 201103L
161 #endif
162 
175  virtual void charStrValue (OSSIZE nchars, OSUNICHAR* data) {
176  OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
177  }
178 
190  virtual void charStrValue (OSSIZE nchars, OS32BITCHAR* data) {
191  OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
192  }
193 
203  virtual void openTypeValue (OSSIZE numocts, const OSOCTET* data) {
204  OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
205  }
206 #if __cplusplus >= 201103L
208 #endif
209 
210  // The following static methods are invoked from within the generated
211  // code to call the various user-defined event handler methods ..
212 
222  EXTRTMETHOD static void invokeStartElement
223  (OSCTXT* pCtxt, const char* name, OSSIZE index);
224 
234  EXTRTMETHOD static void invokeEndElement
235  (OSCTXT* pCtxt, const char* name, OSSIZE index);
236 
245  EXTRTMETHOD static void invokeBitStrValue
246  (OSCTXT* pCtxt, OSSIZE numbits, const OSOCTET* data);
247 
256  EXTRTMETHOD static void invokeOctStrValue
257  (OSCTXT* pCtxt, OSSIZE numocts, const OSOCTET* data);
258 
267  EXTRTMETHOD static void invokeCharStrValue
268  (OSCTXT* pCtxt, OSSIZE nchars, OSUNICHAR* data);
269 
278  EXTRTMETHOD static void invokeCharStrValue
279  (OSCTXT* pCtxt, OSSIZE nchars, OS32BITCHAR* data);
280 
289  EXTRTMETHOD static void invokeCharStrValue
290  (OSCTXT* pCtxt, OSSIZE nchars, const OSUTF8CHAR* data);
291 
300  EXTRTMETHOD static void invokeOpenTypeValue
301  (OSCTXT* pCtxt, OSSIZE numocts, const OSOCTET* data);
302 
303 } ;
304 
305 // Null event handler class. This class contains an empty implementation
306 // of all user methods..
307 
313  public:
315  virtual void startElement (const char* , OSSIZE ) {}
317  virtual void endElement (const char* , OSSIZE ) {}
318 } ;
319 
323 #endif
virtual void startElement(const char *, OSSIZE)
Definition: asn1CppEvtHndlr64.h:315
static EXTRTMETHOD void invokeStartElement(OSCTXT *pCtxt, const char *name, int index)
virtual void charStrValue(OSSIZE nchars, OS32BITCHAR *data)
Definition: asn1CppEvtHndlr64.h:190
static EXTRTMETHOD void invokeCharStrValue(OSCTXT *pCtxt, const char *value)
Definition: asn1CppEvtHndlr64.h:312
virtual void octStrValue(OSUINT32 numocts, const OSOCTET *data)
Definition: asn1CppEvtHndlr.h:198
#define OS_UNUSED_ARG(arg)
Definition: asn1CppEvtHndlr.h:63
static EXTRTMETHOD void invokeOpenTypeValue(OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)
static EXTRTMETHOD void invokeBitStrValue(OSCTXT *pCtxt, OSUINT32 numbits, const OSOCTET *data)
virtual void openTypeValue(OSUINT32 numocts, const OSOCTET *data)
Definition: asn1CppEvtHndlr.h:305
Definition: asn1CppEvtHndlr.h:533
virtual void bitStrValue(OSUINT32 numbits, const OSOCTET *data)
Definition: asn1CppEvtHndlr.h:185
Definition: asn1CppEvtHndlr64.h:61
virtual void endElement(const char *, int)
Definition: asn1CppEvtHndlr.h:538
virtual void startElement(const char *, int)
Definition: asn1CppEvtHndlr.h:536
virtual void endElement(const char *, OSSIZE)
Definition: asn1CppEvtHndlr64.h:317
virtual void charStrValue(OSSIZE nchars, OSUNICHAR *data)
Definition: asn1CppEvtHndlr64.h:175
virtual void charStrValue(OSSIZE nchars, const OSUTF8CHAR *value)
Definition: asn1CppEvtHndlr64.h:156
virtual void charStrValue(const char *value)
Definition: asn1CppEvtHndlr.h:209
static EXTRTMETHOD void invokeEndElement(OSCTXT *pCtxt, const char *name, int index)
virtual void openTypeValue(OSSIZE numocts, const OSOCTET *data)
Definition: asn1CppEvtHndlr64.h:203
Definition: rtxContext.h:198
virtual void octStrValue(OSSIZE numocts, const OSOCTET *data)
Definition: asn1CppEvtHndlr64.h:141
static EXTRTMETHOD void invokeOctStrValue(OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)
virtual void bitStrValue(OSSIZE numbits, const OSOCTET *data)
Definition: asn1CppEvtHndlr64.h:125