/**
 * This file was generated by the Objective Systems ASN1C Compiler
 * (http://www.obj-sys.com).  Version: 5.50, Date: 30-May-2003.
 */
#ifndef ASN1EXTERNALXER_H
#define ASN1EXTERNALXER_H

#include <stdio.h>
#include <stdlib.h>
#include "asn1XerCppTypes.h"
#include "asn1External.h"
#include "ASN1CXerOpenType.h"

/**************************************************************/
/*                                                            */
/*  External_encoding                                         */
/*                                                            */
/**************************************************************/


class EXTERNXER ASN1C_XERExternal_encoding :
   public ASN1C_External_encoding, public ASN1XERSAXDecodeHandler
{
protected:
   struct ElementID {
      enum {
         _unknown, single_ASN1_type, octet_aligned, arbitrary
      } ;
   } ;
   int getElementID 
      (const XMLCHAR* const uri, const XMLCHAR* const localname,
       const XMLCHAR* const qname);

   ASN1CXerOpenType* mpSingle_ASN1_typeC;
   ASN1XERSAXDecodeHandler* mpCurrElem;
   ASN1MemBuf mCurrElemValue;
public:
   ASN1C_XERExternal_encoding (ASN1T_External_encoding& data);
   ASN1C_XERExternal_encoding (
      ASN1MessageBufferIF& msgBuf, ASN1T_External_encoding& data);

   ~ASN1C_XERExternal_encoding();
   // standard encode/decode methods (defined in ASN1CType base class):
   // int Encode ();
   // int Decode ();

   // stream encode/decode methods:
   int EncodeTo (ASN1MessageBufferIF& msgBuf);
   int DecodeFrom (ASN1MessageBufferIF& msgBuf);


   // SAX ContentHandler interface

   virtual void startElement 
      (const XMLCHAR* const uri, 
       const XMLCHAR* const localname, 
       const XMLCHAR* const qname, 
       IXMLAttributes& attrs);

   virtual void characters 
      (const XMLCHAR* const chars,
       const unsigned int length);

   virtual void endElement
      (const XMLCHAR* const uri,
       const XMLCHAR* const localname,
       const XMLCHAR* const qname);

   virtual void init (int level = 0);
} ;

EXTERNXER int asn1XE_External_encoding
  (ASN1CTXT* pctxt, ASN1T_External_encoding* pvalue,
   ASN1ConstCharPtr elemName, ASN1ConstCharPtr attributes);

/**************************************************************/
/*                                                            */
/*  External                                                  */
/*                                                            */
/**************************************************************/


class EXTERNXER ASN1C_XERExternal :
   public ASN1C_External, public ASN1XERSAXDecodeHandler
{
protected:
   struct ElementID {
      enum {
         _unknown, direct_reference, indirect_reference,
         data_value_descriptor, encoding
      } ;
   } ;
   int getElementID 
      (const XMLCHAR* const uri, const XMLCHAR* const localname,
       const XMLCHAR* const qname);

   class ASN1C_XERExternal_encoding* mpEncodingC;
   ASN1XERSAXDecodeHandler* mpCurrElem;
   ASN1MemBuf mCurrElemValue;
   int mReqElemCnt;
public:
   ASN1C_XERExternal (ASN1T_External& data);
   ASN1C_XERExternal (
      ASN1MessageBufferIF& msgBuf, ASN1T_External& data);

   ~ASN1C_XERExternal();
   // standard encode/decode methods (defined in ASN1CType base class):
   // int Encode ();
   // int Decode ();

   // stream encode/decode methods:
   int EncodeTo (ASN1MessageBufferIF& msgBuf);
   int DecodeFrom (ASN1MessageBufferIF& msgBuf);


   // SAX ContentHandler interface

   virtual void startElement 
      (const XMLCHAR* const uri, 
       const XMLCHAR* const localname, 
       const XMLCHAR* const qname, 
       IXMLAttributes& attrs);

   virtual void characters 
      (const XMLCHAR* const chars,
       const unsigned int length);

   virtual void endElement
      (const XMLCHAR* const uri,
       const XMLCHAR* const localname,
       const XMLCHAR* const qname);

   virtual void init (int level = 0);
} ;

EXTERNXER int asn1XE_External
  (ASN1CTXT* pctxt, ASN1T_External* pvalue,
   ASN1ConstCharPtr elemName, ASN1ConstCharPtr attributes);

#endif
