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

#include <stdio.h>
#include <stdlib.h>
#include "asn1CppTypes.h"

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

/* Choice tag constants */

#define T_External_encoding_single_ASN1_type 1
#define T_External_encoding_octet_aligned 2
#define T_External_encoding_arbitrary   3

class EXTERNRT ASN1C_External_encoding;

typedef struct EXTERNRT ASN1T_External_encoding {
   int t;
   union {
      /* t = 1 */
      ASN1TOpenType *single_ASN1_type;
      /* t = 2 */
      ASN1TDynOctStr *octet_aligned;
      /* t = 3 */
      ASN1TDynBitStr *arbitrary;
   } u;

   ASN1T_External_encoding () {}
   ASN1T_External_encoding (ASN1C_External_encoding& srcData);
} ASN1T_External_encoding;

class EXTERNRT ASN1C_External_encoding :
   public ASN1CType
{
protected:
   ASN1T_External_encoding& msgData;
public:
   ASN1C_External_encoding (ASN1T_External_encoding& data);
   ASN1C_External_encoding (
      ASN1MessageBufferIF& msgBuf, ASN1T_External_encoding& data);
   ASN1C_External_encoding (ASN1C_External_encoding& original);

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

   // stream encode/decode methods:

   void Print (ASN1ConstCharPtr name);
   int toString (ASN1ConstCharPtr name, 
                 char* buffer, int bufSize);
   ASN1BOOL Equals (ASN1T_External_encoding* pCmpValue,
                    char* errBuff, int errBuffSize);
   ASN1T_External_encoding& getCopy (ASN1T_External_encoding* pDstData = 0);

   inline ASN1C_External_encoding& operator= (ASN1C_External_encoding& srcData) {
      srcData.getCopy (&msgData);
      return *this;
   }
} ;

EXTERNRT void asn1Print_External_encoding
   (ASN1ConstCharPtr name, ASN1T_External_encoding* pvalue);

EXTERNRT int asn1PrtToStr_External_encoding (ASN1ConstCharPtr name, ASN1T_External_encoding* pvalue, char* buffer, int bufSize);

EXTERNRT ASN1BOOL asn1Compare_External_encoding (ASN1ConstCharPtr name, ASN1T_External_encoding* pValue, ASN1T_External_encoding* pCmpValue, char* errBuff, int errBuffSize);

EXTERNRT void asn1Copy_External_encoding (ASN1CTXT *pctxt, ASN1T_External_encoding* pSrcValue, ASN1T_External_encoding* pDstValue);

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

#define TV_External	(TM_UNIV|TM_CONS|8)

class EXTERNRT ASN1C_External;

typedef struct EXTERNRT ASN1T_External {
   struct {
      unsigned direct_referencePresent : 1;
      unsigned indirect_referencePresent : 1;
      unsigned data_value_descriptorPresent : 1;
   } m;
   ASN1TObjId direct_reference;
   ASN1INT indirect_reference;
   ASN1ObjectDescriptor data_value_descriptor;
   ASN1T_External_encoding encoding;
   ASN1T_External ();
   ASN1T_External (ASN1C_External& srcData);
} ASN1T_External;

class EXTERNRT ASN1C_External :
   public ASN1CType
{
protected:
   ASN1T_External& msgData;
public:
   ASN1C_External (ASN1T_External& data);
   ASN1C_External (
      ASN1MessageBufferIF& msgBuf, ASN1T_External& data);
   ASN1C_External (ASN1C_External& original);

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

   // stream encode/decode methods:

   void Print (ASN1ConstCharPtr name);
   int toString (ASN1ConstCharPtr name, 
                 char* buffer, int bufSize);
   ASN1BOOL Equals (ASN1T_External* pCmpValue,
                    char* errBuff, int errBuffSize);
   ASN1T_External& getCopy (ASN1T_External* pDstData = 0);

   inline ASN1C_External& operator= (ASN1C_External& srcData) {
      srcData.getCopy (&msgData);
      return *this;
   }
} ;

EXTERNRT void asn1Print_External
   (ASN1ConstCharPtr name, ASN1T_External* pvalue);

EXTERNRT int asn1PrtToStr_External (ASN1ConstCharPtr name, ASN1T_External* pvalue, char* buffer, int bufSize);

EXTERNRT ASN1BOOL asn1Compare_External (ASN1ConstCharPtr name, ASN1T_External* pValue, ASN1T_External* pCmpValue, char* errBuff, int errBuffSize);

EXTERNRT void asn1Copy_External (ASN1CTXT *pctxt, ASN1T_External* pSrcValue, ASN1T_External* pDstValue);

#endif
