// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 11.1.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2025 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "DIAMETER_Types.hh"

namespace DIAMETER__Types {

/* Member functions of C++ classes */

AAA__3GPP__Complete__Data__List__Included__Indicator::AAA__3GPP__Complete__Data__List__Included__Indicator()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Complete__Data__List__Included__Indicator::AAA__3GPP__Complete__Data__List__Included__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator::AAA__3GPP__Complete__Data__List__Included__Indicator(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator::AAA__3GPP__Complete__Data__List__Included__Indicator(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator& AAA__3GPP__Complete__Data__List__Included__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator& AAA__3GPP__Complete__Data__List__Included__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator& AAA__3GPP__Complete__Data__List__Included__Indicator::operator=(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value == other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator==(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value < other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator<(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value > other_value;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::operator>(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Complete__Data__List__Included__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case All__PDP__CONTEXTS__INCLUDED: return "All_PDP_CONTEXTS_INCLUDED";
case MODIFIED__ADDED__PDP__CONTEXTS__INCLUDED: return "MODIFIED_ADDED_PDP_CONTEXTS_INCLUDED";
default:
return "<unknown>";
}
}

AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type AAA__3GPP__Complete__Data__List__Included__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "All_PDP_CONTEXTS_INCLUDED")) return All__PDP__CONTEXTS__INCLUDED;
if (!strcmp(str_par, "MODIFIED_ADDED_PDP_CONTEXTS_INCLUDED")) return MODIFIED__ADDED__PDP__CONTEXTS__INCLUDED;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Complete__Data__List__Included__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Complete__Data__List__Included__Indicator::enum2int(const AAA__3GPP__Complete__Data__List__Included__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Complete__Data__List__Included__Indicator::operator AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return enum_value;
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
  }
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", enum_value);
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Complete__Data__List__Included__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Complete__Data__List__Included__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Complete__Data__List__Included__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::copy_template(const AAA__3GPP__Complete__Data__List__Included__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Complete__Data__List__Included__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Complete__Data__List__Included__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Complete__Data__List__Included__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template()
{
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Complete__Data__List__Included__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type)other_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Complete__Data__List__Included__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
single_value = other_value.enum_value;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(const OPTIONAL<AAA__3GPP__Complete__Data__List__Included__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type)(const AAA__3GPP__Complete__Data__List__Included__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator from an unbound optional field.");
}
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(AAA__3GPP__Complete__Data__List__Included__Indicator_template* p_precondition, AAA__3GPP__Complete__Data__List__Included__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(Dynamic_Match_Interface<AAA__3GPP__Complete__Data__List__Included__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Complete__Data__List__Included__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::AAA__3GPP__Complete__Data__List__Included__Indicator_template(const AAA__3GPP__Complete__Data__List__Included__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template::~AAA__3GPP__Complete__Data__List__Included__Indicator_template()
{
clean_up();
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Complete__Data__List__Included__Indicator::UNBOUND_VALUE;
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(int other_value)
{
if (!AAA__3GPP__Complete__Data__List__Included__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type)other_value;
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value)
{
if (other_value.enum_value == AAA__3GPP__Complete__Data__List__Included__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(const OPTIONAL<AAA__3GPP__Complete__Data__List__Included__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type)(const AAA__3GPP__Complete__Data__List__Included__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
return *this;
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::operator=(const AAA__3GPP__Complete__Data__List__Included__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::match(AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
return FALSE;
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::match(const AAA__3GPP__Complete__Data__List__Included__Indicator& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Complete__Data__List__Included__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type AAA__3GPP__Complete__Data__List__Included__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return single_value;
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Complete__Data__List__Included__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
}

AAA__3GPP__Complete__Data__List__Included__Indicator_template& AAA__3GPP__Complete__Data__List__Included__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Complete__Data__List__Included__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::log_match(const AAA__3GPP__Complete__Data__List__Included__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Complete__Data__List__Included__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Complete__Data__List__Included__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
}
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Complete__Data__List__Included__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Complete__Data__List__Included__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Complete__Data__List__Included__Indicator::enum_type enum_val = AAA__3GPP__Complete__Data__List__Included__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Complete__Data__List__Included__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Complete__Data__List__Included__Indicator_template* precondition = new AAA__3GPP__Complete__Data__List__Included__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Complete__Data__List__Included__Indicator_template* implied_template = new AAA__3GPP__Complete__Data__List__Included__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Complete__Data__List__Included__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Complete__Data__List__Included__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Complete_Data_List_Included_Indicator");
}

DCC__NONE__CC__Request__Type::DCC__NONE__CC__Request__Type()
{
enum_value = UNBOUND_VALUE;
}

DCC__NONE__CC__Request__Type::DCC__NONE__CC__Request__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCC__NONE__CC__Request__Type::DCC__NONE__CC__Request__Type(enum_type other_value)
{
enum_value = other_value;
}

DCC__NONE__CC__Request__Type::DCC__NONE__CC__Request__Type(const DCC__NONE__CC__Request__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
enum_value = other_value.enum_value;
}

DCC__NONE__CC__Request__Type& DCC__NONE__CC__Request__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCC__NONE__CC__Request__Type& DCC__NONE__CC__Request__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCC__NONE__CC__Request__Type& DCC__NONE__CC__Request__Type::operator=(const DCC__NONE__CC__Request__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCC__NONE__CC__Request__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCC__NONE__CC__Request__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value == other_value;
}

boolean DCC__NONE__CC__Request__Type::operator==(const DCC__NONE__CC__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value == other_value.enum_value;
}

boolean DCC__NONE__CC__Request__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCC__NONE__CC__Request__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value < other_value;
}

boolean DCC__NONE__CC__Request__Type::operator<(const DCC__NONE__CC__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value < other_value.enum_value;
}

boolean DCC__NONE__CC__Request__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCC__NONE__CC__Request__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value > other_value;
}

boolean DCC__NONE__CC__Request__Type::operator>(const DCC__NONE__CC__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value > other_value.enum_value;
}

const char *DCC__NONE__CC__Request__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case INITIAL__REQUEST: return "INITIAL_REQUEST";
case UPDATE__REQUEST: return "UPDATE_REQUEST";
case TERMINATION__REQUEST: return "TERMINATION_REQUEST";
case EVENT__REQUEST: return "EVENT_REQUEST";
default:
return "<unknown>";
}
}

DCC__NONE__CC__Request__Type::enum_type DCC__NONE__CC__Request__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "INITIAL_REQUEST")) return INITIAL__REQUEST;
if (!strcmp(str_par, "UPDATE_REQUEST")) return UPDATE__REQUEST;
if (!strcmp(str_par, "TERMINATION_REQUEST")) return TERMINATION__REQUEST;
if (!strcmp(str_par, "EVENT_REQUEST")) return EVENT__REQUEST;
}
return UNKNOWN_VALUE;
}

boolean DCC__NONE__CC__Request__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int DCC__NONE__CC__Request__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCC__NONE__CC__Request__Type::enum2int(const DCC__NONE__CC__Request__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCC__NONE__CC__Request__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCC__NONE__CC__Request__Type::operator DCC__NONE__CC__Request__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return enum_value;
}

void DCC__NONE__CC__Request__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCC__NONE__CC__Request__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCC_NONE_CC_Request_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
  }
}

void DCC__NONE__CC__Request__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
text_buf.push_int(enum_value);
}

void DCC__NONE__CC__Request__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", enum_value);
}

void DCC__NONE__CC__Request__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCC__NONE__CC__Request__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCC__NONE__CC__Request__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCC__NONE__CC__Request__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCC__NONE__CC__Request__Type_template::copy_template(const DCC__NONE__CC__Request__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCC__NONE__CC__Request__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCC__NONE__CC__Request__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCC__NONE__CC__Request__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template()
{
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCC__NONE__CC__Request__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type with unknown numeric value %d.", other_value);
single_value = (DCC__NONE__CC__Request__Type::enum_type)other_value;
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(DCC__NONE__CC__Request__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(const DCC__NONE__CC__Request__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCC__NONE__CC__Request__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
single_value = other_value.enum_value;
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(const OPTIONAL<DCC__NONE__CC__Request__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__CC__Request__Type::enum_type)(const DCC__NONE__CC__Request__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type from an unbound optional field.");
}
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(DCC__NONE__CC__Request__Type_template* p_precondition, DCC__NONE__CC__Request__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(Dynamic_Match_Interface<DCC__NONE__CC__Request__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCC__NONE__CC__Request__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCC__NONE__CC__Request__Type_template::DCC__NONE__CC__Request__Type_template(const DCC__NONE__CC__Request__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCC__NONE__CC__Request__Type_template::~DCC__NONE__CC__Request__Type_template()
{
clean_up();
}

boolean DCC__NONE__CC__Request__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCC__NONE__CC__Request__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCC__NONE__CC__Request__Type::UNBOUND_VALUE;
}

void DCC__NONE__CC__Request__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(int other_value)
{
if (!DCC__NONE__CC__Request__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__CC__Request__Type::enum_type)other_value;
return *this;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(DCC__NONE__CC__Request__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(const DCC__NONE__CC__Request__Type& other_value)
{
if (other_value.enum_value == DCC__NONE__CC__Request__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(const OPTIONAL<DCC__NONE__CC__Request__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__CC__Request__Type::enum_type)(const DCC__NONE__CC__Request__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
return *this;
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::operator=(const DCC__NONE__CC__Request__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCC__NONE__CC__Request__Type_template::match(DCC__NONE__CC__Request__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
return FALSE;
}

boolean DCC__NONE__CC__Request__Type_template::match(const DCC__NONE__CC__Request__Type& other_value, boolean) const
{
if (other_value.enum_value == DCC__NONE__CC__Request__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type with an unbound value.");
return match(other_value.enum_value);
}

DCC__NONE__CC__Request__Type::enum_type DCC__NONE__CC__Request__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return single_value;
}

void DCC__NONE__CC__Request__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCC__NONE__CC__Request__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
}

DCC__NONE__CC__Request__Type_template& DCC__NONE__CC__Request__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
return value_list.list_value[list_index];
}

void DCC__NONE__CC__Request__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCC__NONE__CC__Request__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCC__NONE__CC__Request__Type_template::log_match(const DCC__NONE__CC__Request__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCC__NONE__CC__Request__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
}

void DCC__NONE__CC__Request__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCC__NONE__CC__Request__Type::enum_type)text_buf.pull_int().get_val();
if (!DCC__NONE__CC__Request__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCC__NONE__CC__Request__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
}
}

boolean DCC__NONE__CC__Request__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCC__NONE__CC__Request__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCC__NONE__CC__Request__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCC__NONE__CC__Request__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCC__NONE__CC__Request__Type::enum_type enum_val = DCC__NONE__CC__Request__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCC__NONE__CC__Request__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCC_NONE_CC_Request_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCC__NONE__CC__Request__Type_template* precondition = new DCC__NONE__CC__Request__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCC__NONE__CC__Request__Type_template* implied_template = new DCC__NONE__CC__Request__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCC__NONE__CC__Request__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCC_NONE_CC_Request_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCC__NONE__CC__Request__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCC_NONE_CC_Request_Type");
}

PCC__3GPP__Usage__Monitoring__Report::PCC__3GPP__Usage__Monitoring__Report()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Usage__Monitoring__Report::PCC__3GPP__Usage__Monitoring__Report(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Usage__Monitoring__Report::PCC__3GPP__Usage__Monitoring__Report(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Usage__Monitoring__Report::PCC__3GPP__Usage__Monitoring__Report(const PCC__3GPP__Usage__Monitoring__Report& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Usage__Monitoring__Report& PCC__3GPP__Usage__Monitoring__Report::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Report& PCC__3GPP__Usage__Monitoring__Report::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Report& PCC__3GPP__Usage__Monitoring__Report::operator=(const PCC__3GPP__Usage__Monitoring__Report& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value == other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator==(const PCC__3GPP__Usage__Monitoring__Report& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value < other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator<(const PCC__3GPP__Usage__Monitoring__Report& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value > other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Report::operator>(const PCC__3GPP__Usage__Monitoring__Report& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Usage__Monitoring__Report::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case USAGE__MONITORING__REPORT__REQUIRED: return "USAGE_MONITORING_REPORT_REQUIRED";
default:
return "<unknown>";
}
}

PCC__3GPP__Usage__Monitoring__Report::enum_type PCC__3GPP__Usage__Monitoring__Report::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "USAGE_MONITORING_REPORT_REQUIRED")) return USAGE__MONITORING__REPORT__REQUIRED;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Usage__Monitoring__Report::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Usage__Monitoring__Report::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Usage__Monitoring__Report::enum2int(const PCC__3GPP__Usage__Monitoring__Report& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Usage__Monitoring__Report::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Usage__Monitoring__Report::operator PCC__3GPP__Usage__Monitoring__Report::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return enum_value;
}

void PCC__3GPP__Usage__Monitoring__Report::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Usage__Monitoring__Report::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
  }
}

void PCC__3GPP__Usage__Monitoring__Report::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Usage__Monitoring__Report::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", enum_value);
}

void PCC__3GPP__Usage__Monitoring__Report::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Usage__Monitoring__Report::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Usage__Monitoring__Report::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Usage__Monitoring__Report::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void PCC__3GPP__Usage__Monitoring__Report_template::copy_template(const PCC__3GPP__Usage__Monitoring__Report_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Report_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Usage__Monitoring__Report_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Usage__Monitoring__Report_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template()
{
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Usage__Monitoring__Report::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Usage__Monitoring__Report::enum_type)other_value;
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(PCC__3GPP__Usage__Monitoring__Report::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(const PCC__3GPP__Usage__Monitoring__Report& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Report::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
single_value = other_value.enum_value;
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(const OPTIONAL<PCC__3GPP__Usage__Monitoring__Report>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Report::enum_type)(const PCC__3GPP__Usage__Monitoring__Report&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report from an unbound optional field.");
}
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(PCC__3GPP__Usage__Monitoring__Report_template* p_precondition, PCC__3GPP__Usage__Monitoring__Report_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(Dynamic_Match_Interface<PCC__3GPP__Usage__Monitoring__Report>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Usage__Monitoring__Report>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Usage__Monitoring__Report_template::PCC__3GPP__Usage__Monitoring__Report_template(const PCC__3GPP__Usage__Monitoring__Report_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Usage__Monitoring__Report_template::~PCC__3GPP__Usage__Monitoring__Report_template()
{
clean_up();
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Usage__Monitoring__Report::UNBOUND_VALUE;
}

void PCC__3GPP__Usage__Monitoring__Report_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(int other_value)
{
if (!PCC__3GPP__Usage__Monitoring__Report::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Report::enum_type)other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(PCC__3GPP__Usage__Monitoring__Report::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(const PCC__3GPP__Usage__Monitoring__Report& other_value)
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Report::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(const OPTIONAL<PCC__3GPP__Usage__Monitoring__Report>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Report::enum_type)(const PCC__3GPP__Usage__Monitoring__Report&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
return *this;
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::operator=(const PCC__3GPP__Usage__Monitoring__Report_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::match(PCC__3GPP__Usage__Monitoring__Report::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
return FALSE;
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::match(const PCC__3GPP__Usage__Monitoring__Report& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Report::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Usage__Monitoring__Report::enum_type PCC__3GPP__Usage__Monitoring__Report_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return single_value;
}

void PCC__3GPP__Usage__Monitoring__Report_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Report_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
}

PCC__3GPP__Usage__Monitoring__Report_template& PCC__3GPP__Usage__Monitoring__Report_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Usage__Monitoring__Report_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Usage__Monitoring__Report::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Usage__Monitoring__Report_template::log_match(const PCC__3GPP__Usage__Monitoring__Report& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Usage__Monitoring__Report_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
}

void PCC__3GPP__Usage__Monitoring__Report_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Usage__Monitoring__Report::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Usage__Monitoring__Report::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Report_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
}
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Usage__Monitoring__Report_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Usage__Monitoring__Report_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Usage__Monitoring__Report_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Usage__Monitoring__Report::enum_type enum_val = PCC__3GPP__Usage__Monitoring__Report::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Usage__Monitoring__Report::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Usage__Monitoring__Report_template* precondition = new PCC__3GPP__Usage__Monitoring__Report_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Usage__Monitoring__Report_template* implied_template = new PCC__3GPP__Usage__Monitoring__Report_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Usage__Monitoring__Report_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Usage__Monitoring__Report_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Report");
}

CxDx__3GPP__Priviledged__Sender__Indication::CxDx__3GPP__Priviledged__Sender__Indication()
{
enum_value = UNBOUND_VALUE;
}

CxDx__3GPP__Priviledged__Sender__Indication::CxDx__3GPP__Priviledged__Sender__Indication(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

CxDx__3GPP__Priviledged__Sender__Indication::CxDx__3GPP__Priviledged__Sender__Indication(enum_type other_value)
{
enum_value = other_value;
}

CxDx__3GPP__Priviledged__Sender__Indication::CxDx__3GPP__Priviledged__Sender__Indication(const CxDx__3GPP__Priviledged__Sender__Indication& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
enum_value = other_value.enum_value;
}

CxDx__3GPP__Priviledged__Sender__Indication& CxDx__3GPP__Priviledged__Sender__Indication::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication& CxDx__3GPP__Priviledged__Sender__Indication::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication& CxDx__3GPP__Priviledged__Sender__Indication::operator=(const CxDx__3GPP__Priviledged__Sender__Indication& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
enum_value = other_value.enum_value;
return *this;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value == other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator==(const CxDx__3GPP__Priviledged__Sender__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value == other_value.enum_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value < other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator<(const CxDx__3GPP__Priviledged__Sender__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value < other_value.enum_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value > other_value;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::operator>(const CxDx__3GPP__Priviledged__Sender__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value > other_value.enum_value;
}

const char *CxDx__3GPP__Priviledged__Sender__Indication::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NOT__PRIVILEDGED__SENDER: return "NOT_PRIVILEDGED_SENDER";
case PRIVILEDGED__SENDER: return "PRIVILEDGED_SENDER";
default:
return "<unknown>";
}
}

CxDx__3GPP__Priviledged__Sender__Indication::enum_type CxDx__3GPP__Priviledged__Sender__Indication::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NOT_PRIVILEDGED_SENDER")) return NOT__PRIVILEDGED__SENDER;
if (!strcmp(str_par, "PRIVILEDGED_SENDER")) return PRIVILEDGED__SENDER;
}
return UNKNOWN_VALUE;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int CxDx__3GPP__Priviledged__Sender__Indication::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CxDx__3GPP__Priviledged__Sender__Indication::enum2int(const CxDx__3GPP__Priviledged__Sender__Indication& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void CxDx__3GPP__Priviledged__Sender__Indication::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", int_val);
enum_value = (enum_type)int_val;
}

CxDx__3GPP__Priviledged__Sender__Indication::operator CxDx__3GPP__Priviledged__Sender__Indication::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return enum_value;
}

void CxDx__3GPP__Priviledged__Sender__Indication::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CxDx__3GPP__Priviledged__Sender__Indication::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
  }
}

void CxDx__3GPP__Priviledged__Sender__Indication::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
text_buf.push_int(enum_value);
}

void CxDx__3GPP__Priviledged__Sender__Indication::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", enum_value);
}

void CxDx__3GPP__Priviledged__Sender__Indication::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CxDx__3GPP__Priviledged__Sender__Indication::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CxDx__3GPP__Priviledged__Sender__Indication::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CxDx__3GPP__Priviledged__Sender__Indication::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::copy_template(const CxDx__3GPP__Priviledged__Sender__Indication_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CxDx__3GPP__Priviledged__Sender__Indication_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CxDx__3GPP__Priviledged__Sender__Indication_template(*other_value.implication_.precondition);
implication_.implied_template = new CxDx__3GPP__Priviledged__Sender__Indication_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template()
{
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!CxDx__3GPP__Priviledged__Sender__Indication::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication with unknown numeric value %d.", other_value);
single_value = (CxDx__3GPP__Priviledged__Sender__Indication::enum_type)other_value;
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(CxDx__3GPP__Priviledged__Sender__Indication::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(const CxDx__3GPP__Priviledged__Sender__Indication& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CxDx__3GPP__Priviledged__Sender__Indication::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
single_value = other_value.enum_value;
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(const OPTIONAL<CxDx__3GPP__Priviledged__Sender__Indication>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Priviledged__Sender__Indication::enum_type)(const CxDx__3GPP__Priviledged__Sender__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication from an unbound optional field.");
}
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(CxDx__3GPP__Priviledged__Sender__Indication_template* p_precondition, CxDx__3GPP__Priviledged__Sender__Indication_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(Dynamic_Match_Interface<CxDx__3GPP__Priviledged__Sender__Indication>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<CxDx__3GPP__Priviledged__Sender__Indication>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

CxDx__3GPP__Priviledged__Sender__Indication_template::CxDx__3GPP__Priviledged__Sender__Indication_template(const CxDx__3GPP__Priviledged__Sender__Indication_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

CxDx__3GPP__Priviledged__Sender__Indication_template::~CxDx__3GPP__Priviledged__Sender__Indication_template()
{
clean_up();
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != CxDx__3GPP__Priviledged__Sender__Indication::UNBOUND_VALUE;
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(int other_value)
{
if (!CxDx__3GPP__Priviledged__Sender__Indication::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Priviledged__Sender__Indication::enum_type)other_value;
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(CxDx__3GPP__Priviledged__Sender__Indication::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(const CxDx__3GPP__Priviledged__Sender__Indication& other_value)
{
if (other_value.enum_value == CxDx__3GPP__Priviledged__Sender__Indication::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(const OPTIONAL<CxDx__3GPP__Priviledged__Sender__Indication>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Priviledged__Sender__Indication::enum_type)(const CxDx__3GPP__Priviledged__Sender__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
return *this;
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::operator=(const CxDx__3GPP__Priviledged__Sender__Indication_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::match(CxDx__3GPP__Priviledged__Sender__Indication::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
return FALSE;
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::match(const CxDx__3GPP__Priviledged__Sender__Indication& other_value, boolean) const
{
if (other_value.enum_value == CxDx__3GPP__Priviledged__Sender__Indication::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication with an unbound value.");
return match(other_value.enum_value);
}

CxDx__3GPP__Priviledged__Sender__Indication::enum_type CxDx__3GPP__Priviledged__Sender__Indication_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return single_value;
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CxDx__3GPP__Priviledged__Sender__Indication_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
}

CxDx__3GPP__Priviledged__Sender__Indication_template& CxDx__3GPP__Priviledged__Sender__Indication_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
return value_list.list_value[list_index];
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(CxDx__3GPP__Priviledged__Sender__Indication::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::log_match(const CxDx__3GPP__Priviledged__Sender__Indication& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CxDx__3GPP__Priviledged__Sender__Indication::enum_type)text_buf.pull_int().get_val();
if (!CxDx__3GPP__Priviledged__Sender__Indication::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CxDx__3GPP__Priviledged__Sender__Indication_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
}
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CxDx__3GPP__Priviledged__Sender__Indication_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CxDx__3GPP__Priviledged__Sender__Indication_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CxDx__3GPP__Priviledged__Sender__Indication::enum_type enum_val = CxDx__3GPP__Priviledged__Sender__Indication::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CxDx__3GPP__Priviledged__Sender__Indication::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CxDx__3GPP__Priviledged__Sender__Indication_template* precondition = new CxDx__3GPP__Priviledged__Sender__Indication_template;
    precondition->set_param(*m_p->get_elem(0));
    CxDx__3GPP__Priviledged__Sender__Indication_template* implied_template = new CxDx__3GPP__Priviledged__Sender__Indication_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CxDx__3GPP__Priviledged__Sender__Indication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication");
  }
  is_ifpresent = param.get_ifpresent();
}

void CxDx__3GPP__Priviledged__Sender__Indication_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.CxDx_3GPP_Priviledged_Sender_Indication");
}

DCA__3GPP__AoC__Service__Obligatory__Type::DCA__3GPP__AoC__Service__Obligatory__Type()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__AoC__Service__Obligatory__Type::DCA__3GPP__AoC__Service__Obligatory__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type::DCA__3GPP__AoC__Service__Obligatory__Type(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type::DCA__3GPP__AoC__Service__Obligatory__Type(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
enum_value = other_value.enum_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type& DCA__3GPP__AoC__Service__Obligatory__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type& DCA__3GPP__AoC__Service__Obligatory__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type& DCA__3GPP__AoC__Service__Obligatory__Type::operator=(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value == other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator==(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value < other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator<(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value > other_value;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::operator>(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__AoC__Service__Obligatory__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NON__BINDING: return "NON_BINDING";
case BINDING: return "BINDING";
default:
return "<unknown>";
}
}

DCA__3GPP__AoC__Service__Obligatory__Type::enum_type DCA__3GPP__AoC__Service__Obligatory__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NON_BINDING")) return NON__BINDING;
if (!strcmp(str_par, "BINDING")) return BINDING;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__AoC__Service__Obligatory__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__AoC__Service__Obligatory__Type::enum2int(const DCA__3GPP__AoC__Service__Obligatory__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__AoC__Service__Obligatory__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__AoC__Service__Obligatory__Type::operator DCA__3GPP__AoC__Service__Obligatory__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return enum_value;
}

void DCA__3GPP__AoC__Service__Obligatory__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__AoC__Service__Obligatory__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
  }
}

void DCA__3GPP__AoC__Service__Obligatory__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__AoC__Service__Obligatory__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", enum_value);
}

void DCA__3GPP__AoC__Service__Obligatory__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__AoC__Service__Obligatory__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__AoC__Service__Obligatory__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__AoC__Service__Obligatory__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::copy_template(const DCA__3GPP__AoC__Service__Obligatory__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__AoC__Service__Obligatory__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__AoC__Service__Obligatory__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__AoC__Service__Obligatory__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template()
{
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__AoC__Service__Obligatory__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__AoC__Service__Obligatory__Type::enum_type)other_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(DCA__3GPP__AoC__Service__Obligatory__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__AoC__Service__Obligatory__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
single_value = other_value.enum_value;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(const OPTIONAL<DCA__3GPP__AoC__Service__Obligatory__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__AoC__Service__Obligatory__Type::enum_type)(const DCA__3GPP__AoC__Service__Obligatory__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type from an unbound optional field.");
}
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(DCA__3GPP__AoC__Service__Obligatory__Type_template* p_precondition, DCA__3GPP__AoC__Service__Obligatory__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(Dynamic_Match_Interface<DCA__3GPP__AoC__Service__Obligatory__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__AoC__Service__Obligatory__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::DCA__3GPP__AoC__Service__Obligatory__Type_template(const DCA__3GPP__AoC__Service__Obligatory__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__AoC__Service__Obligatory__Type_template::~DCA__3GPP__AoC__Service__Obligatory__Type_template()
{
clean_up();
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__AoC__Service__Obligatory__Type::UNBOUND_VALUE;
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(int other_value)
{
if (!DCA__3GPP__AoC__Service__Obligatory__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__AoC__Service__Obligatory__Type::enum_type)other_value;
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(DCA__3GPP__AoC__Service__Obligatory__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value)
{
if (other_value.enum_value == DCA__3GPP__AoC__Service__Obligatory__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(const OPTIONAL<DCA__3GPP__AoC__Service__Obligatory__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__AoC__Service__Obligatory__Type::enum_type)(const DCA__3GPP__AoC__Service__Obligatory__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
return *this;
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::operator=(const DCA__3GPP__AoC__Service__Obligatory__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::match(DCA__3GPP__AoC__Service__Obligatory__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
return FALSE;
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::match(const DCA__3GPP__AoC__Service__Obligatory__Type& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__AoC__Service__Obligatory__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__AoC__Service__Obligatory__Type::enum_type DCA__3GPP__AoC__Service__Obligatory__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return single_value;
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__AoC__Service__Obligatory__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
}

DCA__3GPP__AoC__Service__Obligatory__Type_template& DCA__3GPP__AoC__Service__Obligatory__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
return value_list.list_value[list_index];
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__AoC__Service__Obligatory__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::log_match(const DCA__3GPP__AoC__Service__Obligatory__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__AoC__Service__Obligatory__Type::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__AoC__Service__Obligatory__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__AoC__Service__Obligatory__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
}
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__AoC__Service__Obligatory__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__AoC__Service__Obligatory__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__AoC__Service__Obligatory__Type::enum_type enum_val = DCA__3GPP__AoC__Service__Obligatory__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__AoC__Service__Obligatory__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__AoC__Service__Obligatory__Type_template* precondition = new DCA__3GPP__AoC__Service__Obligatory__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__AoC__Service__Obligatory__Type_template* implied_template = new DCA__3GPP__AoC__Service__Obligatory__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__AoC__Service__Obligatory__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__AoC__Service__Obligatory__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_AoC_Service_Obligatory_Type");
}

AAA__3GPP__ICS__Indicator::AAA__3GPP__ICS__Indicator()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__ICS__Indicator::AAA__3GPP__ICS__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__ICS__Indicator::AAA__3GPP__ICS__Indicator(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__ICS__Indicator::AAA__3GPP__ICS__Indicator(const AAA__3GPP__ICS__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
enum_value = other_value.enum_value;
}

AAA__3GPP__ICS__Indicator& AAA__3GPP__ICS__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__ICS__Indicator& AAA__3GPP__ICS__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__ICS__Indicator& AAA__3GPP__ICS__Indicator::operator=(const AAA__3GPP__ICS__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__ICS__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value == other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator==(const AAA__3GPP__ICS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__ICS__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value < other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator<(const AAA__3GPP__ICS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__ICS__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value > other_value;
}

boolean AAA__3GPP__ICS__Indicator::operator>(const AAA__3GPP__ICS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__ICS__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case FALSE_: return "FALSE";
case TRUE_: return "TRUE";
default:
return "<unknown>";
}
}

AAA__3GPP__ICS__Indicator::enum_type AAA__3GPP__ICS__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "FALSE")) return FALSE_;
if (!strcmp(str_par, "TRUE")) return TRUE_;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__ICS__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__ICS__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__ICS__Indicator::enum2int(const AAA__3GPP__ICS__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__ICS__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__ICS__Indicator::operator AAA__3GPP__ICS__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return enum_value;
}

void AAA__3GPP__ICS__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__ICS__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_ICS_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
  }
}

void AAA__3GPP__ICS__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__ICS__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", enum_value);
}

void AAA__3GPP__ICS__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__ICS__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__ICS__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__ICS__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__ICS__Indicator_template::copy_template(const AAA__3GPP__ICS__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__ICS__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__ICS__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__ICS__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template()
{
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__ICS__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__ICS__Indicator::enum_type)other_value;
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(AAA__3GPP__ICS__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(const AAA__3GPP__ICS__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__ICS__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
single_value = other_value.enum_value;
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(const OPTIONAL<AAA__3GPP__ICS__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__ICS__Indicator::enum_type)(const AAA__3GPP__ICS__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator from an unbound optional field.");
}
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(AAA__3GPP__ICS__Indicator_template* p_precondition, AAA__3GPP__ICS__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(Dynamic_Match_Interface<AAA__3GPP__ICS__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__ICS__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__ICS__Indicator_template::AAA__3GPP__ICS__Indicator_template(const AAA__3GPP__ICS__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__ICS__Indicator_template::~AAA__3GPP__ICS__Indicator_template()
{
clean_up();
}

boolean AAA__3GPP__ICS__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__ICS__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__ICS__Indicator::UNBOUND_VALUE;
}

void AAA__3GPP__ICS__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(int other_value)
{
if (!AAA__3GPP__ICS__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__ICS__Indicator::enum_type)other_value;
return *this;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(AAA__3GPP__ICS__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(const AAA__3GPP__ICS__Indicator& other_value)
{
if (other_value.enum_value == AAA__3GPP__ICS__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(const OPTIONAL<AAA__3GPP__ICS__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__ICS__Indicator::enum_type)(const AAA__3GPP__ICS__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
return *this;
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::operator=(const AAA__3GPP__ICS__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__ICS__Indicator_template::match(AAA__3GPP__ICS__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
return FALSE;
}

boolean AAA__3GPP__ICS__Indicator_template::match(const AAA__3GPP__ICS__Indicator& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__ICS__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__ICS__Indicator::enum_type AAA__3GPP__ICS__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return single_value;
}

void AAA__3GPP__ICS__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__ICS__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
}

AAA__3GPP__ICS__Indicator_template& AAA__3GPP__ICS__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
return value_list.list_value[list_index];
}

void AAA__3GPP__ICS__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__ICS__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__ICS__Indicator_template::log_match(const AAA__3GPP__ICS__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__ICS__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
}

void AAA__3GPP__ICS__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__ICS__Indicator::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__ICS__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__ICS__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
}
}

boolean AAA__3GPP__ICS__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__ICS__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__ICS__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__ICS__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__ICS__Indicator::enum_type enum_val = AAA__3GPP__ICS__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__ICS__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_ICS_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__ICS__Indicator_template* precondition = new AAA__3GPP__ICS__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__ICS__Indicator_template* implied_template = new AAA__3GPP__ICS__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__ICS__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_ICS_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__ICS__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_ICS_Indicator");
}

AAA__3GPP__Cancellation__Type::AAA__3GPP__Cancellation__Type()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Cancellation__Type::AAA__3GPP__Cancellation__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Cancellation__Type::AAA__3GPP__Cancellation__Type(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Cancellation__Type::AAA__3GPP__Cancellation__Type(const AAA__3GPP__Cancellation__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Cancellation__Type& AAA__3GPP__Cancellation__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Cancellation__Type& AAA__3GPP__Cancellation__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Cancellation__Type& AAA__3GPP__Cancellation__Type::operator=(const AAA__3GPP__Cancellation__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Cancellation__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value == other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator==(const AAA__3GPP__Cancellation__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Cancellation__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value < other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator<(const AAA__3GPP__Cancellation__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Cancellation__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value > other_value;
}

boolean AAA__3GPP__Cancellation__Type::operator>(const AAA__3GPP__Cancellation__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Cancellation__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case MME__UPDATE__PROCEDURE: return "MME_UPDATE_PROCEDURE";
case SGSN__UPDATE__PROCEDURE: return "SGSN_UPDATE_PROCEDURE";
case SUBSCRIPTION__WITHDRAWAL: return "SUBSCRIPTION_WITHDRAWAL";
case UPDATE__PROCEDURE__IWF: return "UPDATE_PROCEDURE_IWF";
case INITIAL__ATTACH__PROCEDURE: return "INITIAL_ATTACH_PROCEDURE";
default:
return "<unknown>";
}
}

AAA__3GPP__Cancellation__Type::enum_type AAA__3GPP__Cancellation__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "MME_UPDATE_PROCEDURE")) return MME__UPDATE__PROCEDURE;
if (!strcmp(str_par, "SGSN_UPDATE_PROCEDURE")) return SGSN__UPDATE__PROCEDURE;
if (!strcmp(str_par, "SUBSCRIPTION_WITHDRAWAL")) return SUBSCRIPTION__WITHDRAWAL;
if (!strcmp(str_par, "UPDATE_PROCEDURE_IWF")) return UPDATE__PROCEDURE__IWF;
if (!strcmp(str_par, "INITIAL_ATTACH_PROCEDURE")) return INITIAL__ATTACH__PROCEDURE;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Cancellation__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Cancellation__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Cancellation__Type::enum2int(const AAA__3GPP__Cancellation__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Cancellation__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Cancellation__Type::operator AAA__3GPP__Cancellation__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return enum_value;
}

void AAA__3GPP__Cancellation__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Cancellation__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Cancellation_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
  }
}

void AAA__3GPP__Cancellation__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Cancellation__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", enum_value);
}

void AAA__3GPP__Cancellation__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Cancellation__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Cancellation__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Cancellation__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void AAA__3GPP__Cancellation__Type_template::copy_template(const AAA__3GPP__Cancellation__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Cancellation__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Cancellation__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Cancellation__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template()
{
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Cancellation__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Cancellation__Type::enum_type)other_value;
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(AAA__3GPP__Cancellation__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(const AAA__3GPP__Cancellation__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Cancellation__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
single_value = other_value.enum_value;
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(const OPTIONAL<AAA__3GPP__Cancellation__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Cancellation__Type::enum_type)(const AAA__3GPP__Cancellation__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type from an unbound optional field.");
}
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(AAA__3GPP__Cancellation__Type_template* p_precondition, AAA__3GPP__Cancellation__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(Dynamic_Match_Interface<AAA__3GPP__Cancellation__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Cancellation__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Cancellation__Type_template::AAA__3GPP__Cancellation__Type_template(const AAA__3GPP__Cancellation__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Cancellation__Type_template::~AAA__3GPP__Cancellation__Type_template()
{
clean_up();
}

boolean AAA__3GPP__Cancellation__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Cancellation__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Cancellation__Type::UNBOUND_VALUE;
}

void AAA__3GPP__Cancellation__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(int other_value)
{
if (!AAA__3GPP__Cancellation__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Cancellation__Type::enum_type)other_value;
return *this;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(AAA__3GPP__Cancellation__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(const AAA__3GPP__Cancellation__Type& other_value)
{
if (other_value.enum_value == AAA__3GPP__Cancellation__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(const OPTIONAL<AAA__3GPP__Cancellation__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Cancellation__Type::enum_type)(const AAA__3GPP__Cancellation__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
return *this;
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::operator=(const AAA__3GPP__Cancellation__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Cancellation__Type_template::match(AAA__3GPP__Cancellation__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
return FALSE;
}

boolean AAA__3GPP__Cancellation__Type_template::match(const AAA__3GPP__Cancellation__Type& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Cancellation__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Cancellation__Type::enum_type AAA__3GPP__Cancellation__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return single_value;
}

void AAA__3GPP__Cancellation__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Cancellation__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
}

AAA__3GPP__Cancellation__Type_template& AAA__3GPP__Cancellation__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Cancellation__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Cancellation__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Cancellation__Type_template::log_match(const AAA__3GPP__Cancellation__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Cancellation__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
}

void AAA__3GPP__Cancellation__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Cancellation__Type::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Cancellation__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Cancellation__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
}
}

boolean AAA__3GPP__Cancellation__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Cancellation__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Cancellation__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Cancellation__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Cancellation__Type::enum_type enum_val = AAA__3GPP__Cancellation__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Cancellation__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Cancellation_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Cancellation__Type_template* precondition = new AAA__3GPP__Cancellation__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Cancellation__Type_template* implied_template = new AAA__3GPP__Cancellation__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Cancellation__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Cancellation_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Cancellation__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Cancellation_Type");
}

AAA__3GPP__PDN__Type::AAA__3GPP__PDN__Type()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__PDN__Type::AAA__3GPP__PDN__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__PDN__Type::AAA__3GPP__PDN__Type(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__PDN__Type::AAA__3GPP__PDN__Type(const AAA__3GPP__PDN__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
enum_value = other_value.enum_value;
}

AAA__3GPP__PDN__Type& AAA__3GPP__PDN__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__PDN__Type& AAA__3GPP__PDN__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__PDN__Type& AAA__3GPP__PDN__Type::operator=(const AAA__3GPP__PDN__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__PDN__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__PDN__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value == other_value;
}

boolean AAA__3GPP__PDN__Type::operator==(const AAA__3GPP__PDN__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__PDN__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__PDN__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value < other_value;
}

boolean AAA__3GPP__PDN__Type::operator<(const AAA__3GPP__PDN__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__PDN__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__PDN__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value > other_value;
}

boolean AAA__3GPP__PDN__Type::operator>(const AAA__3GPP__PDN__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__PDN__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case IPv4: return "IPv4";
case IPv6: return "IPv6";
case IPv4v6: return "IPv4v6";
case IPv4__OR__IPv6: return "IPv4_OR_IPv6";
default:
return "<unknown>";
}
}

AAA__3GPP__PDN__Type::enum_type AAA__3GPP__PDN__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "IPv4")) return IPv4;
if (!strcmp(str_par, "IPv6")) return IPv6;
if (!strcmp(str_par, "IPv4v6")) return IPv4v6;
if (!strcmp(str_par, "IPv4_OR_IPv6")) return IPv4__OR__IPv6;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__PDN__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__PDN__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__PDN__Type::enum2int(const AAA__3GPP__PDN__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__PDN__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__PDN__Type::operator AAA__3GPP__PDN__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return enum_value;
}

void AAA__3GPP__PDN__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__PDN__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_PDN_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
  }
}

void AAA__3GPP__PDN__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__PDN__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", enum_value);
}

void AAA__3GPP__PDN__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__PDN__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__PDN__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__PDN__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void AAA__3GPP__PDN__Type_template::copy_template(const AAA__3GPP__PDN__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__PDN__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__PDN__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__PDN__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template()
{
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__PDN__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__PDN__Type::enum_type)other_value;
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(AAA__3GPP__PDN__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(const AAA__3GPP__PDN__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__PDN__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
single_value = other_value.enum_value;
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(const OPTIONAL<AAA__3GPP__PDN__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__PDN__Type::enum_type)(const AAA__3GPP__PDN__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type from an unbound optional field.");
}
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(AAA__3GPP__PDN__Type_template* p_precondition, AAA__3GPP__PDN__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(Dynamic_Match_Interface<AAA__3GPP__PDN__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__PDN__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__PDN__Type_template::AAA__3GPP__PDN__Type_template(const AAA__3GPP__PDN__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__PDN__Type_template::~AAA__3GPP__PDN__Type_template()
{
clean_up();
}

boolean AAA__3GPP__PDN__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__PDN__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__PDN__Type::UNBOUND_VALUE;
}

void AAA__3GPP__PDN__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(int other_value)
{
if (!AAA__3GPP__PDN__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__PDN__Type::enum_type)other_value;
return *this;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(AAA__3GPP__PDN__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(const AAA__3GPP__PDN__Type& other_value)
{
if (other_value.enum_value == AAA__3GPP__PDN__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(const OPTIONAL<AAA__3GPP__PDN__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__PDN__Type::enum_type)(const AAA__3GPP__PDN__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
return *this;
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::operator=(const AAA__3GPP__PDN__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__PDN__Type_template::match(AAA__3GPP__PDN__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
return FALSE;
}

boolean AAA__3GPP__PDN__Type_template::match(const AAA__3GPP__PDN__Type& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__PDN__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__PDN__Type::enum_type AAA__3GPP__PDN__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return single_value;
}

void AAA__3GPP__PDN__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__PDN__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
}

AAA__3GPP__PDN__Type_template& AAA__3GPP__PDN__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
return value_list.list_value[list_index];
}

void AAA__3GPP__PDN__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__PDN__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__PDN__Type_template::log_match(const AAA__3GPP__PDN__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__PDN__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
}

void AAA__3GPP__PDN__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__PDN__Type::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__PDN__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__PDN__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
}
}

boolean AAA__3GPP__PDN__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__PDN__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__PDN__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__PDN__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__PDN__Type::enum_type enum_val = AAA__3GPP__PDN__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__PDN__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_PDN_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__PDN__Type_template* precondition = new AAA__3GPP__PDN__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__PDN__Type_template* implied_template = new AAA__3GPP__PDN__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__PDN__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_PDN_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__PDN__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_PDN_Type");
}

DNAS__NONE__Prompt::DNAS__NONE__Prompt()
{
enum_value = UNBOUND_VALUE;
}

DNAS__NONE__Prompt::DNAS__NONE__Prompt(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DNAS__NONE__Prompt::DNAS__NONE__Prompt(enum_type other_value)
{
enum_value = other_value;
}

DNAS__NONE__Prompt::DNAS__NONE__Prompt(const DNAS__NONE__Prompt& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
enum_value = other_value.enum_value;
}

DNAS__NONE__Prompt& DNAS__NONE__Prompt::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DNAS__NONE__Prompt& DNAS__NONE__Prompt::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DNAS__NONE__Prompt& DNAS__NONE__Prompt::operator=(const DNAS__NONE__Prompt& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
enum_value = other_value.enum_value;
return *this;
}

boolean DNAS__NONE__Prompt::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DNAS__NONE__Prompt::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value == other_value;
}

boolean DNAS__NONE__Prompt::operator==(const DNAS__NONE__Prompt& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value == other_value.enum_value;
}

boolean DNAS__NONE__Prompt::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DNAS__NONE__Prompt::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value < other_value;
}

boolean DNAS__NONE__Prompt::operator<(const DNAS__NONE__Prompt& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value < other_value.enum_value;
}

boolean DNAS__NONE__Prompt::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DNAS__NONE__Prompt::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value > other_value;
}

boolean DNAS__NONE__Prompt::operator>(const DNAS__NONE__Prompt& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value > other_value.enum_value;
}

const char *DNAS__NONE__Prompt::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NO__ECHO: return "NO_ECHO";
case ECHO: return "ECHO";
default:
return "<unknown>";
}
}

DNAS__NONE__Prompt::enum_type DNAS__NONE__Prompt::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NO_ECHO")) return NO__ECHO;
if (!strcmp(str_par, "ECHO")) return ECHO;
}
return UNKNOWN_VALUE;
}

boolean DNAS__NONE__Prompt::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DNAS__NONE__Prompt::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DNAS__NONE__Prompt::enum2int(const DNAS__NONE__Prompt& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DNAS__NONE__Prompt::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", int_val);
enum_value = (enum_type)int_val;
}

DNAS__NONE__Prompt::operator DNAS__NONE__Prompt::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return enum_value;
}

void DNAS__NONE__Prompt::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DNAS__NONE__Prompt::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DNAS_NONE_Prompt");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DNAS_NONE_Prompt.");
  }
}

void DNAS__NONE__Prompt::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
text_buf.push_int(enum_value);
}

void DNAS__NONE__Prompt::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", enum_value);
}

void DNAS__NONE__Prompt::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DNAS__NONE__Prompt::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DNAS__NONE__Prompt::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DNAS__NONE__Prompt::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DNAS__NONE__Prompt_template::copy_template(const DNAS__NONE__Prompt_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DNAS__NONE__Prompt_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DNAS__NONE__Prompt_template(*other_value.implication_.precondition);
implication_.implied_template = new DNAS__NONE__Prompt_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template()
{
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DNAS__NONE__Prompt::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt with unknown numeric value %d.", other_value);
single_value = (DNAS__NONE__Prompt::enum_type)other_value;
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(DNAS__NONE__Prompt::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(const DNAS__NONE__Prompt& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DNAS__NONE__Prompt::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
single_value = other_value.enum_value;
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(const OPTIONAL<DNAS__NONE__Prompt>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Prompt::enum_type)(const DNAS__NONE__Prompt&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt from an unbound optional field.");
}
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(DNAS__NONE__Prompt_template* p_precondition, DNAS__NONE__Prompt_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(Dynamic_Match_Interface<DNAS__NONE__Prompt>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DNAS__NONE__Prompt>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DNAS__NONE__Prompt_template::DNAS__NONE__Prompt_template(const DNAS__NONE__Prompt_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DNAS__NONE__Prompt_template::~DNAS__NONE__Prompt_template()
{
clean_up();
}

boolean DNAS__NONE__Prompt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DNAS__NONE__Prompt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DNAS__NONE__Prompt::UNBOUND_VALUE;
}

void DNAS__NONE__Prompt_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(int other_value)
{
if (!DNAS__NONE__Prompt::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Prompt::enum_type)other_value;
return *this;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(DNAS__NONE__Prompt::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(const DNAS__NONE__Prompt& other_value)
{
if (other_value.enum_value == DNAS__NONE__Prompt::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(const OPTIONAL<DNAS__NONE__Prompt>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Prompt::enum_type)(const DNAS__NONE__Prompt&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
return *this;
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::operator=(const DNAS__NONE__Prompt_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DNAS__NONE__Prompt_template::match(DNAS__NONE__Prompt::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
return FALSE;
}

boolean DNAS__NONE__Prompt_template::match(const DNAS__NONE__Prompt& other_value, boolean) const
{
if (other_value.enum_value == DNAS__NONE__Prompt::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt with an unbound value.");
return match(other_value.enum_value);
}

DNAS__NONE__Prompt::enum_type DNAS__NONE__Prompt_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return single_value;
}

void DNAS__NONE__Prompt_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DNAS__NONE__Prompt_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
}

DNAS__NONE__Prompt_template& DNAS__NONE__Prompt_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
return value_list.list_value[list_index];
}

void DNAS__NONE__Prompt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DNAS__NONE__Prompt::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DNAS__NONE__Prompt_template::log_match(const DNAS__NONE__Prompt& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DNAS__NONE__Prompt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
}

void DNAS__NONE__Prompt_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DNAS__NONE__Prompt::enum_type)text_buf.pull_int().get_val();
if (!DNAS__NONE__Prompt::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DNAS__NONE__Prompt_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Prompt.");
}
}

boolean DNAS__NONE__Prompt_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DNAS__NONE__Prompt_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DNAS__NONE__Prompt_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DNAS__NONE__Prompt_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DNAS__NONE__Prompt::enum_type enum_val = DNAS__NONE__Prompt::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DNAS__NONE__Prompt::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DNAS_NONE_Prompt.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DNAS__NONE__Prompt_template* precondition = new DNAS__NONE__Prompt_template;
    precondition->set_param(*m_p->get_elem(0));
    DNAS__NONE__Prompt_template* implied_template = new DNAS__NONE__Prompt_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DNAS__NONE__Prompt_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DNAS_NONE_Prompt");
  }
  is_ifpresent = param.get_ifpresent();
}

void DNAS__NONE__Prompt_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DNAS_NONE_Prompt");
}

DCA__3GPP__PoC__User__Role__info__Units::DCA__3GPP__PoC__User__Role__info__Units()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__PoC__User__Role__info__Units::DCA__3GPP__PoC__User__Role__info__Units(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__PoC__User__Role__info__Units::DCA__3GPP__PoC__User__Role__info__Units(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__PoC__User__Role__info__Units::DCA__3GPP__PoC__User__Role__info__Units(const DCA__3GPP__PoC__User__Role__info__Units& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
enum_value = other_value.enum_value;
}

DCA__3GPP__PoC__User__Role__info__Units& DCA__3GPP__PoC__User__Role__info__Units::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units& DCA__3GPP__PoC__User__Role__info__Units::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units& DCA__3GPP__PoC__User__Role__info__Units::operator=(const DCA__3GPP__PoC__User__Role__info__Units& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator==(const DCA__3GPP__PoC__User__Role__info__Units& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator<(const DCA__3GPP__PoC__User__Role__info__Units& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::operator>(const DCA__3GPP__PoC__User__Role__info__Units& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__PoC__User__Role__info__Units::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case MODERATOR: return "MODERATOR";
case DISPATCHER: return "DISPATCHER";
case SESSION__OWNER: return "SESSION_OWNER";
case SESSION__PARTICIPANT: return "SESSION_PARTICIPANT";
default:
return "<unknown>";
}
}

DCA__3GPP__PoC__User__Role__info__Units::enum_type DCA__3GPP__PoC__User__Role__info__Units::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "MODERATOR")) return MODERATOR;
if (!strcmp(str_par, "DISPATCHER")) return DISPATCHER;
if (!strcmp(str_par, "SESSION_OWNER")) return SESSION__OWNER;
if (!strcmp(str_par, "SESSION_PARTICIPANT")) return SESSION__PARTICIPANT;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__PoC__User__Role__info__Units::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__PoC__User__Role__info__Units::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__PoC__User__Role__info__Units::enum2int(const DCA__3GPP__PoC__User__Role__info__Units& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__PoC__User__Role__info__Units::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__PoC__User__Role__info__Units::operator DCA__3GPP__PoC__User__Role__info__Units::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return enum_value;
}

void DCA__3GPP__PoC__User__Role__info__Units::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__PoC__User__Role__info__Units::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
  }
}

void DCA__3GPP__PoC__User__Role__info__Units::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__PoC__User__Role__info__Units::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", enum_value);
}

void DCA__3GPP__PoC__User__Role__info__Units::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__PoC__User__Role__info__Units::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__PoC__User__Role__info__Units::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__PoC__User__Role__info__Units::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__PoC__User__Role__info__Units_template::copy_template(const DCA__3GPP__PoC__User__Role__info__Units_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__PoC__User__Role__info__Units_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__PoC__User__Role__info__Units_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__PoC__User__Role__info__Units_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template()
{
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__PoC__User__Role__info__Units::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__PoC__User__Role__info__Units::enum_type)other_value;
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(DCA__3GPP__PoC__User__Role__info__Units::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(const DCA__3GPP__PoC__User__Role__info__Units& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__PoC__User__Role__info__Units::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
single_value = other_value.enum_value;
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(const OPTIONAL<DCA__3GPP__PoC__User__Role__info__Units>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__User__Role__info__Units::enum_type)(const DCA__3GPP__PoC__User__Role__info__Units&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units from an unbound optional field.");
}
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(DCA__3GPP__PoC__User__Role__info__Units_template* p_precondition, DCA__3GPP__PoC__User__Role__info__Units_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(Dynamic_Match_Interface<DCA__3GPP__PoC__User__Role__info__Units>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__PoC__User__Role__info__Units>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__PoC__User__Role__info__Units_template::DCA__3GPP__PoC__User__Role__info__Units_template(const DCA__3GPP__PoC__User__Role__info__Units_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__PoC__User__Role__info__Units_template::~DCA__3GPP__PoC__User__Role__info__Units_template()
{
clean_up();
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__PoC__User__Role__info__Units::UNBOUND_VALUE;
}

void DCA__3GPP__PoC__User__Role__info__Units_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(int other_value)
{
if (!DCA__3GPP__PoC__User__Role__info__Units::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__User__Role__info__Units::enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(DCA__3GPP__PoC__User__Role__info__Units::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(const DCA__3GPP__PoC__User__Role__info__Units& other_value)
{
if (other_value.enum_value == DCA__3GPP__PoC__User__Role__info__Units::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(const OPTIONAL<DCA__3GPP__PoC__User__Role__info__Units>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__User__Role__info__Units::enum_type)(const DCA__3GPP__PoC__User__Role__info__Units&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
return *this;
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::operator=(const DCA__3GPP__PoC__User__Role__info__Units_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::match(DCA__3GPP__PoC__User__Role__info__Units::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
return FALSE;
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::match(const DCA__3GPP__PoC__User__Role__info__Units& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__PoC__User__Role__info__Units::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__PoC__User__Role__info__Units::enum_type DCA__3GPP__PoC__User__Role__info__Units_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return single_value;
}

void DCA__3GPP__PoC__User__Role__info__Units_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__PoC__User__Role__info__Units_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
}

DCA__3GPP__PoC__User__Role__info__Units_template& DCA__3GPP__PoC__User__Role__info__Units_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
return value_list.list_value[list_index];
}

void DCA__3GPP__PoC__User__Role__info__Units_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__PoC__User__Role__info__Units::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__PoC__User__Role__info__Units_template::log_match(const DCA__3GPP__PoC__User__Role__info__Units& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__PoC__User__Role__info__Units_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
}

void DCA__3GPP__PoC__User__Role__info__Units_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__PoC__User__Role__info__Units::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__PoC__User__Role__info__Units::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__PoC__User__Role__info__Units_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
}
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__PoC__User__Role__info__Units_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__PoC__User__Role__info__Units_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__PoC__User__Role__info__Units_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__PoC__User__Role__info__Units::enum_type enum_val = DCA__3GPP__PoC__User__Role__info__Units::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__PoC__User__Role__info__Units::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__PoC__User__Role__info__Units_template* precondition = new DCA__3GPP__PoC__User__Role__info__Units_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__PoC__User__Role__info__Units_template* implied_template = new DCA__3GPP__PoC__User__Role__info__Units_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__PoC__User__Role__info__Units_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__PoC__User__Role__info__Units_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_PoC_User_Role_info_Units");
}

PCC__3GPP__Bearer__Operation::PCC__3GPP__Bearer__Operation()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Bearer__Operation::PCC__3GPP__Bearer__Operation(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Bearer__Operation::PCC__3GPP__Bearer__Operation(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Bearer__Operation::PCC__3GPP__Bearer__Operation(const PCC__3GPP__Bearer__Operation& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Bearer__Operation& PCC__3GPP__Bearer__Operation::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Bearer__Operation& PCC__3GPP__Bearer__Operation::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Bearer__Operation& PCC__3GPP__Bearer__Operation::operator=(const PCC__3GPP__Bearer__Operation& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Bearer__Operation::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value == other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator==(const PCC__3GPP__Bearer__Operation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Bearer__Operation::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value < other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator<(const PCC__3GPP__Bearer__Operation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Bearer__Operation::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value > other_value;
}

boolean PCC__3GPP__Bearer__Operation::operator>(const PCC__3GPP__Bearer__Operation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Bearer__Operation::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case TERMINATION: return "TERMINATION";
case ESTABLISHMENT: return "ESTABLISHMENT";
case MODIFICATION: return "MODIFICATION";
default:
return "<unknown>";
}
}

PCC__3GPP__Bearer__Operation::enum_type PCC__3GPP__Bearer__Operation::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "TERMINATION")) return TERMINATION;
if (!strcmp(str_par, "ESTABLISHMENT")) return ESTABLISHMENT;
if (!strcmp(str_par, "MODIFICATION")) return MODIFICATION;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Bearer__Operation::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Bearer__Operation::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Bearer__Operation::enum2int(const PCC__3GPP__Bearer__Operation& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Bearer__Operation::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Bearer__Operation::operator PCC__3GPP__Bearer__Operation::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return enum_value;
}

void PCC__3GPP__Bearer__Operation::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Bearer__Operation::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Bearer_Operation");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
  }
}

void PCC__3GPP__Bearer__Operation::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Bearer__Operation::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", enum_value);
}

void PCC__3GPP__Bearer__Operation::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Bearer__Operation::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Bearer__Operation::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Bearer__Operation::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void PCC__3GPP__Bearer__Operation_template::copy_template(const PCC__3GPP__Bearer__Operation_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Bearer__Operation_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Bearer__Operation_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Bearer__Operation_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template()
{
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Bearer__Operation::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Bearer__Operation::enum_type)other_value;
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(PCC__3GPP__Bearer__Operation::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(const PCC__3GPP__Bearer__Operation& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Bearer__Operation::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
single_value = other_value.enum_value;
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(const OPTIONAL<PCC__3GPP__Bearer__Operation>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Bearer__Operation::enum_type)(const PCC__3GPP__Bearer__Operation&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation from an unbound optional field.");
}
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(PCC__3GPP__Bearer__Operation_template* p_precondition, PCC__3GPP__Bearer__Operation_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(Dynamic_Match_Interface<PCC__3GPP__Bearer__Operation>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Bearer__Operation>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Bearer__Operation_template::PCC__3GPP__Bearer__Operation_template(const PCC__3GPP__Bearer__Operation_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Bearer__Operation_template::~PCC__3GPP__Bearer__Operation_template()
{
clean_up();
}

boolean PCC__3GPP__Bearer__Operation_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Bearer__Operation_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Bearer__Operation::UNBOUND_VALUE;
}

void PCC__3GPP__Bearer__Operation_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(int other_value)
{
if (!PCC__3GPP__Bearer__Operation::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Bearer__Operation::enum_type)other_value;
return *this;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(PCC__3GPP__Bearer__Operation::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(const PCC__3GPP__Bearer__Operation& other_value)
{
if (other_value.enum_value == PCC__3GPP__Bearer__Operation::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(const OPTIONAL<PCC__3GPP__Bearer__Operation>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Bearer__Operation::enum_type)(const PCC__3GPP__Bearer__Operation&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
return *this;
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::operator=(const PCC__3GPP__Bearer__Operation_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Bearer__Operation_template::match(PCC__3GPP__Bearer__Operation::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
return FALSE;
}

boolean PCC__3GPP__Bearer__Operation_template::match(const PCC__3GPP__Bearer__Operation& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Bearer__Operation::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Bearer__Operation::enum_type PCC__3GPP__Bearer__Operation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return single_value;
}

void PCC__3GPP__Bearer__Operation_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Bearer__Operation_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
}

PCC__3GPP__Bearer__Operation_template& PCC__3GPP__Bearer__Operation_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Bearer__Operation_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Bearer__Operation::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Bearer__Operation_template::log_match(const PCC__3GPP__Bearer__Operation& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Bearer__Operation_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
}

void PCC__3GPP__Bearer__Operation_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Bearer__Operation::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Bearer__Operation::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Bearer__Operation_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
}
}

boolean PCC__3GPP__Bearer__Operation_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Bearer__Operation_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Bearer__Operation_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Bearer__Operation_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Bearer__Operation::enum_type enum_val = PCC__3GPP__Bearer__Operation::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Bearer__Operation::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Bearer_Operation.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Bearer__Operation_template* precondition = new PCC__3GPP__Bearer__Operation_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Bearer__Operation_template* implied_template = new PCC__3GPP__Bearer__Operation_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Bearer__Operation_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Bearer_Operation");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Bearer__Operation_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Bearer_Operation");
}

AAA__3GPP__Current__Location__Retrieved::AAA__3GPP__Current__Location__Retrieved()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Current__Location__Retrieved::AAA__3GPP__Current__Location__Retrieved(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Current__Location__Retrieved::AAA__3GPP__Current__Location__Retrieved(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Current__Location__Retrieved::AAA__3GPP__Current__Location__Retrieved(const AAA__3GPP__Current__Location__Retrieved& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Current__Location__Retrieved& AAA__3GPP__Current__Location__Retrieved::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Current__Location__Retrieved& AAA__3GPP__Current__Location__Retrieved::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Current__Location__Retrieved& AAA__3GPP__Current__Location__Retrieved::operator=(const AAA__3GPP__Current__Location__Retrieved& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value == other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator==(const AAA__3GPP__Current__Location__Retrieved& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value < other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator<(const AAA__3GPP__Current__Location__Retrieved& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value > other_value;
}

boolean AAA__3GPP__Current__Location__Retrieved::operator>(const AAA__3GPP__Current__Location__Retrieved& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Current__Location__Retrieved::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ACTIVE__LOCATION__RETRIEVAL: return "ACTIVE_LOCATION_RETRIEVAL";
default:
return "<unknown>";
}
}

AAA__3GPP__Current__Location__Retrieved::enum_type AAA__3GPP__Current__Location__Retrieved::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ACTIVE_LOCATION_RETRIEVAL")) return ACTIVE__LOCATION__RETRIEVAL;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Current__Location__Retrieved::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Current__Location__Retrieved::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Current__Location__Retrieved::enum2int(const AAA__3GPP__Current__Location__Retrieved& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Current__Location__Retrieved::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Current__Location__Retrieved::operator AAA__3GPP__Current__Location__Retrieved::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return enum_value;
}

void AAA__3GPP__Current__Location__Retrieved::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Current__Location__Retrieved::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
  }
}

void AAA__3GPP__Current__Location__Retrieved::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Current__Location__Retrieved::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", enum_value);
}

void AAA__3GPP__Current__Location__Retrieved::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Current__Location__Retrieved::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Current__Location__Retrieved::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Current__Location__Retrieved::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void AAA__3GPP__Current__Location__Retrieved_template::copy_template(const AAA__3GPP__Current__Location__Retrieved_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Current__Location__Retrieved_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Current__Location__Retrieved_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Current__Location__Retrieved_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template()
{
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Current__Location__Retrieved::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Current__Location__Retrieved::enum_type)other_value;
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(AAA__3GPP__Current__Location__Retrieved::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(const AAA__3GPP__Current__Location__Retrieved& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Current__Location__Retrieved::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
single_value = other_value.enum_value;
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(const OPTIONAL<AAA__3GPP__Current__Location__Retrieved>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Current__Location__Retrieved::enum_type)(const AAA__3GPP__Current__Location__Retrieved&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved from an unbound optional field.");
}
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(AAA__3GPP__Current__Location__Retrieved_template* p_precondition, AAA__3GPP__Current__Location__Retrieved_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(Dynamic_Match_Interface<AAA__3GPP__Current__Location__Retrieved>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Current__Location__Retrieved>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Current__Location__Retrieved_template::AAA__3GPP__Current__Location__Retrieved_template(const AAA__3GPP__Current__Location__Retrieved_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Current__Location__Retrieved_template::~AAA__3GPP__Current__Location__Retrieved_template()
{
clean_up();
}

boolean AAA__3GPP__Current__Location__Retrieved_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Current__Location__Retrieved_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Current__Location__Retrieved::UNBOUND_VALUE;
}

void AAA__3GPP__Current__Location__Retrieved_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(int other_value)
{
if (!AAA__3GPP__Current__Location__Retrieved::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Current__Location__Retrieved::enum_type)other_value;
return *this;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(AAA__3GPP__Current__Location__Retrieved::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(const AAA__3GPP__Current__Location__Retrieved& other_value)
{
if (other_value.enum_value == AAA__3GPP__Current__Location__Retrieved::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(const OPTIONAL<AAA__3GPP__Current__Location__Retrieved>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Current__Location__Retrieved::enum_type)(const AAA__3GPP__Current__Location__Retrieved&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
return *this;
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::operator=(const AAA__3GPP__Current__Location__Retrieved_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Current__Location__Retrieved_template::match(AAA__3GPP__Current__Location__Retrieved::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
return FALSE;
}

boolean AAA__3GPP__Current__Location__Retrieved_template::match(const AAA__3GPP__Current__Location__Retrieved& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Current__Location__Retrieved::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Current__Location__Retrieved::enum_type AAA__3GPP__Current__Location__Retrieved_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return single_value;
}

void AAA__3GPP__Current__Location__Retrieved_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Current__Location__Retrieved_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
}

AAA__3GPP__Current__Location__Retrieved_template& AAA__3GPP__Current__Location__Retrieved_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Current__Location__Retrieved_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Current__Location__Retrieved::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Current__Location__Retrieved_template::log_match(const AAA__3GPP__Current__Location__Retrieved& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Current__Location__Retrieved_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
}

void AAA__3GPP__Current__Location__Retrieved_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Current__Location__Retrieved::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Current__Location__Retrieved::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Current__Location__Retrieved_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
}
}

boolean AAA__3GPP__Current__Location__Retrieved_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Current__Location__Retrieved_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Current__Location__Retrieved_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Current__Location__Retrieved_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Current__Location__Retrieved::enum_type enum_val = AAA__3GPP__Current__Location__Retrieved::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Current__Location__Retrieved::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Current__Location__Retrieved_template* precondition = new AAA__3GPP__Current__Location__Retrieved_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Current__Location__Retrieved_template* implied_template = new AAA__3GPP__Current__Location__Retrieved_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Current__Location__Retrieved_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Current__Location__Retrieved_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Current_Location_Retrieved");
}

PCC__3GPP__Packet__Filter__Usage::PCC__3GPP__Packet__Filter__Usage()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Packet__Filter__Usage::PCC__3GPP__Packet__Filter__Usage(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Packet__Filter__Usage::PCC__3GPP__Packet__Filter__Usage(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Packet__Filter__Usage::PCC__3GPP__Packet__Filter__Usage(const PCC__3GPP__Packet__Filter__Usage& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Packet__Filter__Usage& PCC__3GPP__Packet__Filter__Usage::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Packet__Filter__Usage& PCC__3GPP__Packet__Filter__Usage::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Packet__Filter__Usage& PCC__3GPP__Packet__Filter__Usage::operator=(const PCC__3GPP__Packet__Filter__Usage& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value == other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator==(const PCC__3GPP__Packet__Filter__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value < other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator<(const PCC__3GPP__Packet__Filter__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value > other_value;
}

boolean PCC__3GPP__Packet__Filter__Usage::operator>(const PCC__3GPP__Packet__Filter__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Packet__Filter__Usage::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SEND__TO__UE: return "SEND_TO_UE";
default:
return "<unknown>";
}
}

PCC__3GPP__Packet__Filter__Usage::enum_type PCC__3GPP__Packet__Filter__Usage::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SEND_TO_UE")) return SEND__TO__UE;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Packet__Filter__Usage::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Packet__Filter__Usage::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Packet__Filter__Usage::enum2int(const PCC__3GPP__Packet__Filter__Usage& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Packet__Filter__Usage::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Packet__Filter__Usage::operator PCC__3GPP__Packet__Filter__Usage::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return enum_value;
}

void PCC__3GPP__Packet__Filter__Usage::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Packet__Filter__Usage::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
  }
}

void PCC__3GPP__Packet__Filter__Usage::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Packet__Filter__Usage::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", enum_value);
}

void PCC__3GPP__Packet__Filter__Usage::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Packet__Filter__Usage::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Packet__Filter__Usage::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Packet__Filter__Usage::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void PCC__3GPP__Packet__Filter__Usage_template::copy_template(const PCC__3GPP__Packet__Filter__Usage_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Packet__Filter__Usage_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Packet__Filter__Usage_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Packet__Filter__Usage_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template()
{
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Packet__Filter__Usage::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Packet__Filter__Usage::enum_type)other_value;
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(PCC__3GPP__Packet__Filter__Usage::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(const PCC__3GPP__Packet__Filter__Usage& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Packet__Filter__Usage::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
single_value = other_value.enum_value;
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(const OPTIONAL<PCC__3GPP__Packet__Filter__Usage>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Packet__Filter__Usage::enum_type)(const PCC__3GPP__Packet__Filter__Usage&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage from an unbound optional field.");
}
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(PCC__3GPP__Packet__Filter__Usage_template* p_precondition, PCC__3GPP__Packet__Filter__Usage_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(Dynamic_Match_Interface<PCC__3GPP__Packet__Filter__Usage>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Packet__Filter__Usage>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Packet__Filter__Usage_template::PCC__3GPP__Packet__Filter__Usage_template(const PCC__3GPP__Packet__Filter__Usage_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Packet__Filter__Usage_template::~PCC__3GPP__Packet__Filter__Usage_template()
{
clean_up();
}

boolean PCC__3GPP__Packet__Filter__Usage_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Packet__Filter__Usage_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Packet__Filter__Usage::UNBOUND_VALUE;
}

void PCC__3GPP__Packet__Filter__Usage_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(int other_value)
{
if (!PCC__3GPP__Packet__Filter__Usage::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Packet__Filter__Usage::enum_type)other_value;
return *this;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(PCC__3GPP__Packet__Filter__Usage::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(const PCC__3GPP__Packet__Filter__Usage& other_value)
{
if (other_value.enum_value == PCC__3GPP__Packet__Filter__Usage::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(const OPTIONAL<PCC__3GPP__Packet__Filter__Usage>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Packet__Filter__Usage::enum_type)(const PCC__3GPP__Packet__Filter__Usage&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
return *this;
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::operator=(const PCC__3GPP__Packet__Filter__Usage_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Packet__Filter__Usage_template::match(PCC__3GPP__Packet__Filter__Usage::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
return FALSE;
}

boolean PCC__3GPP__Packet__Filter__Usage_template::match(const PCC__3GPP__Packet__Filter__Usage& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Packet__Filter__Usage::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Packet__Filter__Usage::enum_type PCC__3GPP__Packet__Filter__Usage_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return single_value;
}

void PCC__3GPP__Packet__Filter__Usage_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Packet__Filter__Usage_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
}

PCC__3GPP__Packet__Filter__Usage_template& PCC__3GPP__Packet__Filter__Usage_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Packet__Filter__Usage_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Packet__Filter__Usage::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Packet__Filter__Usage_template::log_match(const PCC__3GPP__Packet__Filter__Usage& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Packet__Filter__Usage_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
}

void PCC__3GPP__Packet__Filter__Usage_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Packet__Filter__Usage::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Packet__Filter__Usage::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Packet__Filter__Usage_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
}
}

boolean PCC__3GPP__Packet__Filter__Usage_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Packet__Filter__Usage_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Packet__Filter__Usage_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Packet__Filter__Usage_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Packet__Filter__Usage::enum_type enum_val = PCC__3GPP__Packet__Filter__Usage::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Packet__Filter__Usage::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Packet__Filter__Usage_template* precondition = new PCC__3GPP__Packet__Filter__Usage_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Packet__Filter__Usage_template* implied_template = new PCC__3GPP__Packet__Filter__Usage_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Packet__Filter__Usage_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Packet__Filter__Usage_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Packet_Filter_Usage");
}

AAA__3GPP__RDS__Indicator::AAA__3GPP__RDS__Indicator()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__RDS__Indicator::AAA__3GPP__RDS__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__RDS__Indicator::AAA__3GPP__RDS__Indicator(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__RDS__Indicator::AAA__3GPP__RDS__Indicator(const AAA__3GPP__RDS__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
enum_value = other_value.enum_value;
}

AAA__3GPP__RDS__Indicator& AAA__3GPP__RDS__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__RDS__Indicator& AAA__3GPP__RDS__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__RDS__Indicator& AAA__3GPP__RDS__Indicator::operator=(const AAA__3GPP__RDS__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__RDS__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value == other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator==(const AAA__3GPP__RDS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__RDS__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value < other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator<(const AAA__3GPP__RDS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__RDS__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value > other_value;
}

boolean AAA__3GPP__RDS__Indicator::operator>(const AAA__3GPP__RDS__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__RDS__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case DISABLED: return "DISABLED";
case ENABLED: return "ENABLED";
default:
return "<unknown>";
}
}

AAA__3GPP__RDS__Indicator::enum_type AAA__3GPP__RDS__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "DISABLED")) return DISABLED;
if (!strcmp(str_par, "ENABLED")) return ENABLED;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__RDS__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__RDS__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__RDS__Indicator::enum2int(const AAA__3GPP__RDS__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__RDS__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__RDS__Indicator::operator AAA__3GPP__RDS__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return enum_value;
}

void AAA__3GPP__RDS__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__RDS__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_RDS_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
  }
}

void AAA__3GPP__RDS__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__RDS__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", enum_value);
}

void AAA__3GPP__RDS__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__RDS__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__RDS__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__RDS__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__RDS__Indicator_template::copy_template(const AAA__3GPP__RDS__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__RDS__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__RDS__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__RDS__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template()
{
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__RDS__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__RDS__Indicator::enum_type)other_value;
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(AAA__3GPP__RDS__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(const AAA__3GPP__RDS__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__RDS__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
single_value = other_value.enum_value;
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(const OPTIONAL<AAA__3GPP__RDS__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__RDS__Indicator::enum_type)(const AAA__3GPP__RDS__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator from an unbound optional field.");
}
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(AAA__3GPP__RDS__Indicator_template* p_precondition, AAA__3GPP__RDS__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(Dynamic_Match_Interface<AAA__3GPP__RDS__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__RDS__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__RDS__Indicator_template::AAA__3GPP__RDS__Indicator_template(const AAA__3GPP__RDS__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__RDS__Indicator_template::~AAA__3GPP__RDS__Indicator_template()
{
clean_up();
}

boolean AAA__3GPP__RDS__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__RDS__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__RDS__Indicator::UNBOUND_VALUE;
}

void AAA__3GPP__RDS__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(int other_value)
{
if (!AAA__3GPP__RDS__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__RDS__Indicator::enum_type)other_value;
return *this;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(AAA__3GPP__RDS__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(const AAA__3GPP__RDS__Indicator& other_value)
{
if (other_value.enum_value == AAA__3GPP__RDS__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(const OPTIONAL<AAA__3GPP__RDS__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__RDS__Indicator::enum_type)(const AAA__3GPP__RDS__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
return *this;
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::operator=(const AAA__3GPP__RDS__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__RDS__Indicator_template::match(AAA__3GPP__RDS__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
return FALSE;
}

boolean AAA__3GPP__RDS__Indicator_template::match(const AAA__3GPP__RDS__Indicator& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__RDS__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__RDS__Indicator::enum_type AAA__3GPP__RDS__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return single_value;
}

void AAA__3GPP__RDS__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__RDS__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
}

AAA__3GPP__RDS__Indicator_template& AAA__3GPP__RDS__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
return value_list.list_value[list_index];
}

void AAA__3GPP__RDS__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__RDS__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__RDS__Indicator_template::log_match(const AAA__3GPP__RDS__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__RDS__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
}

void AAA__3GPP__RDS__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__RDS__Indicator::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__RDS__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__RDS__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
}
}

boolean AAA__3GPP__RDS__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__RDS__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__RDS__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__RDS__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__RDS__Indicator::enum_type enum_val = AAA__3GPP__RDS__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__RDS__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_RDS_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__RDS__Indicator_template* precondition = new AAA__3GPP__RDS__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__RDS__Indicator_template* implied_template = new AAA__3GPP__RDS__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__RDS__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_RDS_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__RDS__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_RDS_Indicator");
}

DCA__3GPP__Reply__Path__Requested::DCA__3GPP__Reply__Path__Requested()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Reply__Path__Requested::DCA__3GPP__Reply__Path__Requested(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Reply__Path__Requested::DCA__3GPP__Reply__Path__Requested(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Reply__Path__Requested::DCA__3GPP__Reply__Path__Requested(const DCA__3GPP__Reply__Path__Requested& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Reply__Path__Requested& DCA__3GPP__Reply__Path__Requested::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Reply__Path__Requested& DCA__3GPP__Reply__Path__Requested::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Reply__Path__Requested& DCA__3GPP__Reply__Path__Requested::operator=(const DCA__3GPP__Reply__Path__Requested& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Reply__Path__Requested::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value == other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator==(const DCA__3GPP__Reply__Path__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value < other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator<(const DCA__3GPP__Reply__Path__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value > other_value;
}

boolean DCA__3GPP__Reply__Path__Requested::operator>(const DCA__3GPP__Reply__Path__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Reply__Path__Requested::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NO__REPLY__PATH__SET: return "NO_REPLY_PATH_SET";
case REPLY__PATH__SET: return "REPLY_PATH_SET";
default:
return "<unknown>";
}
}

DCA__3GPP__Reply__Path__Requested::enum_type DCA__3GPP__Reply__Path__Requested::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NO_REPLY_PATH_SET")) return NO__REPLY__PATH__SET;
if (!strcmp(str_par, "REPLY_PATH_SET")) return REPLY__PATH__SET;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Reply__Path__Requested::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Reply__Path__Requested::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Reply__Path__Requested::enum2int(const DCA__3GPP__Reply__Path__Requested& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Reply__Path__Requested::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Reply__Path__Requested::operator DCA__3GPP__Reply__Path__Requested::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return enum_value;
}

void DCA__3GPP__Reply__Path__Requested::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Reply__Path__Requested::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Reply_Path_Requested");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
  }
}

void DCA__3GPP__Reply__Path__Requested::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Reply__Path__Requested::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", enum_value);
}

void DCA__3GPP__Reply__Path__Requested::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Reply__Path__Requested::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Reply__Path__Requested::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Reply__Path__Requested::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Reply__Path__Requested_template::copy_template(const DCA__3GPP__Reply__Path__Requested_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Reply__Path__Requested_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Reply__Path__Requested_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Reply__Path__Requested_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template()
{
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Reply__Path__Requested::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Reply__Path__Requested::enum_type)other_value;
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(DCA__3GPP__Reply__Path__Requested::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(const DCA__3GPP__Reply__Path__Requested& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Reply__Path__Requested::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
single_value = other_value.enum_value;
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(const OPTIONAL<DCA__3GPP__Reply__Path__Requested>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Reply__Path__Requested::enum_type)(const DCA__3GPP__Reply__Path__Requested&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested from an unbound optional field.");
}
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(DCA__3GPP__Reply__Path__Requested_template* p_precondition, DCA__3GPP__Reply__Path__Requested_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(Dynamic_Match_Interface<DCA__3GPP__Reply__Path__Requested>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Reply__Path__Requested>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Reply__Path__Requested_template::DCA__3GPP__Reply__Path__Requested_template(const DCA__3GPP__Reply__Path__Requested_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Reply__Path__Requested_template::~DCA__3GPP__Reply__Path__Requested_template()
{
clean_up();
}

boolean DCA__3GPP__Reply__Path__Requested_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Reply__Path__Requested_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Reply__Path__Requested::UNBOUND_VALUE;
}

void DCA__3GPP__Reply__Path__Requested_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(int other_value)
{
if (!DCA__3GPP__Reply__Path__Requested::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Reply__Path__Requested::enum_type)other_value;
return *this;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(DCA__3GPP__Reply__Path__Requested::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(const DCA__3GPP__Reply__Path__Requested& other_value)
{
if (other_value.enum_value == DCA__3GPP__Reply__Path__Requested::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(const OPTIONAL<DCA__3GPP__Reply__Path__Requested>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Reply__Path__Requested::enum_type)(const DCA__3GPP__Reply__Path__Requested&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
return *this;
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::operator=(const DCA__3GPP__Reply__Path__Requested_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Reply__Path__Requested_template::match(DCA__3GPP__Reply__Path__Requested::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
return FALSE;
}

boolean DCA__3GPP__Reply__Path__Requested_template::match(const DCA__3GPP__Reply__Path__Requested& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Reply__Path__Requested::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Reply__Path__Requested::enum_type DCA__3GPP__Reply__Path__Requested_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return single_value;
}

void DCA__3GPP__Reply__Path__Requested_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Reply__Path__Requested_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
}

DCA__3GPP__Reply__Path__Requested_template& DCA__3GPP__Reply__Path__Requested_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Reply__Path__Requested_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Reply__Path__Requested::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Reply__Path__Requested_template::log_match(const DCA__3GPP__Reply__Path__Requested& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Reply__Path__Requested_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
}

void DCA__3GPP__Reply__Path__Requested_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Reply__Path__Requested::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Reply__Path__Requested::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Reply__Path__Requested_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
}
}

boolean DCA__3GPP__Reply__Path__Requested_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Reply__Path__Requested_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Reply__Path__Requested_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Reply__Path__Requested_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Reply__Path__Requested::enum_type enum_val = DCA__3GPP__Reply__Path__Requested::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Reply__Path__Requested::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Reply_Path_Requested.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Reply__Path__Requested_template* precondition = new DCA__3GPP__Reply__Path__Requested_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Reply__Path__Requested_template* implied_template = new DCA__3GPP__Reply__Path__Requested_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Reply__Path__Requested_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Reply_Path_Requested");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Reply__Path__Requested_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Reply_Path_Requested");
}

DCA__3GPP__Serving__Node__Type::DCA__3GPP__Serving__Node__Type()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Serving__Node__Type::DCA__3GPP__Serving__Node__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Serving__Node__Type::DCA__3GPP__Serving__Node__Type(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Serving__Node__Type::DCA__3GPP__Serving__Node__Type(const DCA__3GPP__Serving__Node__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Serving__Node__Type& DCA__3GPP__Serving__Node__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Serving__Node__Type& DCA__3GPP__Serving__Node__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Serving__Node__Type& DCA__3GPP__Serving__Node__Type::operator=(const DCA__3GPP__Serving__Node__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Serving__Node__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value == other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator==(const DCA__3GPP__Serving__Node__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value < other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator<(const DCA__3GPP__Serving__Node__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value > other_value;
}

boolean DCA__3GPP__Serving__Node__Type::operator>(const DCA__3GPP__Serving__Node__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Serving__Node__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SGSN: return "SGSN";
case PMIPSGW: return "PMIPSGW";
case GTPSGW: return "GTPSGW";
case ePDG: return "ePDG";
case hSGW: return "hSGW";
case MME: return "MME";
case TWAN: return "TWAN";
default:
return "<unknown>";
}
}

DCA__3GPP__Serving__Node__Type::enum_type DCA__3GPP__Serving__Node__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SGSN")) return SGSN;
if (!strcmp(str_par, "PMIPSGW")) return PMIPSGW;
if (!strcmp(str_par, "GTPSGW")) return GTPSGW;
if (!strcmp(str_par, "ePDG")) return ePDG;
if (!strcmp(str_par, "hSGW")) return hSGW;
if (!strcmp(str_par, "MME")) return MME;
if (!strcmp(str_par, "TWAN")) return TWAN;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Serving__Node__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Serving__Node__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Serving__Node__Type::enum2int(const DCA__3GPP__Serving__Node__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Serving__Node__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Serving__Node__Type::operator DCA__3GPP__Serving__Node__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return enum_value;
}

void DCA__3GPP__Serving__Node__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Serving__Node__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Serving_Node_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
  }
}

void DCA__3GPP__Serving__Node__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Serving__Node__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", enum_value);
}

void DCA__3GPP__Serving__Node__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Serving__Node__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Serving__Node__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Serving__Node__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Serving__Node__Type_template::copy_template(const DCA__3GPP__Serving__Node__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Serving__Node__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Serving__Node__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Serving__Node__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template()
{
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Serving__Node__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Serving__Node__Type::enum_type)other_value;
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(DCA__3GPP__Serving__Node__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(const DCA__3GPP__Serving__Node__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Serving__Node__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
single_value = other_value.enum_value;
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(const OPTIONAL<DCA__3GPP__Serving__Node__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Serving__Node__Type::enum_type)(const DCA__3GPP__Serving__Node__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type from an unbound optional field.");
}
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(DCA__3GPP__Serving__Node__Type_template* p_precondition, DCA__3GPP__Serving__Node__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(Dynamic_Match_Interface<DCA__3GPP__Serving__Node__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Serving__Node__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Serving__Node__Type_template::DCA__3GPP__Serving__Node__Type_template(const DCA__3GPP__Serving__Node__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Serving__Node__Type_template::~DCA__3GPP__Serving__Node__Type_template()
{
clean_up();
}

boolean DCA__3GPP__Serving__Node__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Serving__Node__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Serving__Node__Type::UNBOUND_VALUE;
}

void DCA__3GPP__Serving__Node__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(int other_value)
{
if (!DCA__3GPP__Serving__Node__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Serving__Node__Type::enum_type)other_value;
return *this;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(DCA__3GPP__Serving__Node__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(const DCA__3GPP__Serving__Node__Type& other_value)
{
if (other_value.enum_value == DCA__3GPP__Serving__Node__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(const OPTIONAL<DCA__3GPP__Serving__Node__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Serving__Node__Type::enum_type)(const DCA__3GPP__Serving__Node__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
return *this;
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::operator=(const DCA__3GPP__Serving__Node__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Serving__Node__Type_template::match(DCA__3GPP__Serving__Node__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
return FALSE;
}

boolean DCA__3GPP__Serving__Node__Type_template::match(const DCA__3GPP__Serving__Node__Type& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Serving__Node__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Serving__Node__Type::enum_type DCA__3GPP__Serving__Node__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return single_value;
}

void DCA__3GPP__Serving__Node__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Serving__Node__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
}

DCA__3GPP__Serving__Node__Type_template& DCA__3GPP__Serving__Node__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Serving__Node__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Serving__Node__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Serving__Node__Type_template::log_match(const DCA__3GPP__Serving__Node__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Serving__Node__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
}

void DCA__3GPP__Serving__Node__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Serving__Node__Type::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Serving__Node__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Serving__Node__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
}
}

boolean DCA__3GPP__Serving__Node__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Serving__Node__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Serving__Node__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Serving__Node__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Serving__Node__Type::enum_type enum_val = DCA__3GPP__Serving__Node__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Serving__Node__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Serving_Node_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Serving__Node__Type_template* precondition = new DCA__3GPP__Serving__Node__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Serving__Node__Type_template* implied_template = new DCA__3GPP__Serving__Node__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Serving__Node__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Serving_Node_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Serving__Node__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Serving_Node_Type");
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
enum_value = other_value.enum_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator=(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value == other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator==(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value < other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator<(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value > other_value;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator>(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NOT__APPLY: return "NOT_APPLY";
case APPLY: return "APPLY";
default:
return "<unknown>";
}
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NOT_APPLY")) return NOT__APPLY;
if (!strcmp(str_par, "APPLY")) return APPLY;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum2int(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::operator DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return enum_value;
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
  }
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", enum_value);
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::copy_template(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template()
{
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type)other_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
single_value = other_value.enum_value;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(const OPTIONAL<DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type)(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator from an unbound optional field.");
}
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template* p_precondition, DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(Dynamic_Match_Interface<DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::~DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template()
{
clean_up();
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::UNBOUND_VALUE;
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(int other_value)
{
if (!DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type)other_value;
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value)
{
if (other_value.enum_value == DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(const OPTIONAL<DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type)(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
return *this;
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::operator=(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::match(DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
return FALSE;
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::match(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return single_value;
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
}

DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template& DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
return value_list.list_value[list_index];
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::log_match(const DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
}
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::enum_type enum_val = DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template* precondition = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template* implied_template = new DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_CP_CIoT_EPS_Optimisation_Indicator");
}

PCC__3GPP__Resource__Release__Notification::PCC__3GPP__Resource__Release__Notification()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Resource__Release__Notification::PCC__3GPP__Resource__Release__Notification(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Resource__Release__Notification::PCC__3GPP__Resource__Release__Notification(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Resource__Release__Notification::PCC__3GPP__Resource__Release__Notification(const PCC__3GPP__Resource__Release__Notification& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Resource__Release__Notification& PCC__3GPP__Resource__Release__Notification::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Resource__Release__Notification& PCC__3GPP__Resource__Release__Notification::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Resource__Release__Notification& PCC__3GPP__Resource__Release__Notification::operator=(const PCC__3GPP__Resource__Release__Notification& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Resource__Release__Notification::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value == other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator==(const PCC__3GPP__Resource__Release__Notification& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value < other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator<(const PCC__3GPP__Resource__Release__Notification& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value > other_value;
}

boolean PCC__3GPP__Resource__Release__Notification::operator>(const PCC__3GPP__Resource__Release__Notification& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Resource__Release__Notification::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ENABLE__NOTIFICATION: return "ENABLE_NOTIFICATION";
default:
return "<unknown>";
}
}

PCC__3GPP__Resource__Release__Notification::enum_type PCC__3GPP__Resource__Release__Notification::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ENABLE_NOTIFICATION")) return ENABLE__NOTIFICATION;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Resource__Release__Notification::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Resource__Release__Notification::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Resource__Release__Notification::enum2int(const PCC__3GPP__Resource__Release__Notification& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Resource__Release__Notification::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Resource__Release__Notification::operator PCC__3GPP__Resource__Release__Notification::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return enum_value;
}

void PCC__3GPP__Resource__Release__Notification::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Resource__Release__Notification::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Resource_Release_Notification");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
  }
}

void PCC__3GPP__Resource__Release__Notification::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Resource__Release__Notification::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", enum_value);
}

void PCC__3GPP__Resource__Release__Notification::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Resource__Release__Notification::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Resource__Release__Notification::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Resource__Release__Notification::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void PCC__3GPP__Resource__Release__Notification_template::copy_template(const PCC__3GPP__Resource__Release__Notification_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Resource__Release__Notification_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Resource__Release__Notification_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Resource__Release__Notification_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template()
{
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Resource__Release__Notification::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Resource__Release__Notification::enum_type)other_value;
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(PCC__3GPP__Resource__Release__Notification::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(const PCC__3GPP__Resource__Release__Notification& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Resource__Release__Notification::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
single_value = other_value.enum_value;
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(const OPTIONAL<PCC__3GPP__Resource__Release__Notification>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Resource__Release__Notification::enum_type)(const PCC__3GPP__Resource__Release__Notification&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification from an unbound optional field.");
}
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(PCC__3GPP__Resource__Release__Notification_template* p_precondition, PCC__3GPP__Resource__Release__Notification_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(Dynamic_Match_Interface<PCC__3GPP__Resource__Release__Notification>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Resource__Release__Notification>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Resource__Release__Notification_template::PCC__3GPP__Resource__Release__Notification_template(const PCC__3GPP__Resource__Release__Notification_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Resource__Release__Notification_template::~PCC__3GPP__Resource__Release__Notification_template()
{
clean_up();
}

boolean PCC__3GPP__Resource__Release__Notification_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Resource__Release__Notification_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Resource__Release__Notification::UNBOUND_VALUE;
}

void PCC__3GPP__Resource__Release__Notification_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(int other_value)
{
if (!PCC__3GPP__Resource__Release__Notification::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Resource__Release__Notification::enum_type)other_value;
return *this;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(PCC__3GPP__Resource__Release__Notification::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(const PCC__3GPP__Resource__Release__Notification& other_value)
{
if (other_value.enum_value == PCC__3GPP__Resource__Release__Notification::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(const OPTIONAL<PCC__3GPP__Resource__Release__Notification>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Resource__Release__Notification::enum_type)(const PCC__3GPP__Resource__Release__Notification&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
return *this;
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::operator=(const PCC__3GPP__Resource__Release__Notification_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Resource__Release__Notification_template::match(PCC__3GPP__Resource__Release__Notification::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
return FALSE;
}

boolean PCC__3GPP__Resource__Release__Notification_template::match(const PCC__3GPP__Resource__Release__Notification& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Resource__Release__Notification::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Resource__Release__Notification::enum_type PCC__3GPP__Resource__Release__Notification_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return single_value;
}

void PCC__3GPP__Resource__Release__Notification_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Resource__Release__Notification_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
}

PCC__3GPP__Resource__Release__Notification_template& PCC__3GPP__Resource__Release__Notification_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Resource__Release__Notification_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Resource__Release__Notification::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Resource__Release__Notification_template::log_match(const PCC__3GPP__Resource__Release__Notification& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Resource__Release__Notification_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
}

void PCC__3GPP__Resource__Release__Notification_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Resource__Release__Notification::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Resource__Release__Notification::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Resource__Release__Notification_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
}
}

boolean PCC__3GPP__Resource__Release__Notification_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Resource__Release__Notification_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Resource__Release__Notification_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Resource__Release__Notification_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Resource__Release__Notification::enum_type enum_val = PCC__3GPP__Resource__Release__Notification::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Resource__Release__Notification::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Resource_Release_Notification.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Resource__Release__Notification_template* precondition = new PCC__3GPP__Resource__Release__Notification_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Resource__Release__Notification_template* implied_template = new PCC__3GPP__Resource__Release__Notification_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Resource__Release__Notification_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Resource_Release_Notification");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Resource__Release__Notification_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Resource_Release_Notification");
}

AAA__3GPP__Error__Diagnostic::AAA__3GPP__Error__Diagnostic()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Error__Diagnostic::AAA__3GPP__Error__Diagnostic(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Error__Diagnostic::AAA__3GPP__Error__Diagnostic(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Error__Diagnostic::AAA__3GPP__Error__Diagnostic(const AAA__3GPP__Error__Diagnostic& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Error__Diagnostic& AAA__3GPP__Error__Diagnostic::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Error__Diagnostic& AAA__3GPP__Error__Diagnostic::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Error__Diagnostic& AAA__3GPP__Error__Diagnostic::operator=(const AAA__3GPP__Error__Diagnostic& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Error__Diagnostic::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value == other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator==(const AAA__3GPP__Error__Diagnostic& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value < other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator<(const AAA__3GPP__Error__Diagnostic& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value > other_value;
}

boolean AAA__3GPP__Error__Diagnostic::operator>(const AAA__3GPP__Error__Diagnostic& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Error__Diagnostic::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case GPRS__DATA__SUBSCRIBED: return "GPRS_DATA_SUBSCRIBED";
case NO__GPRS__DATA__SUBSCRIBED: return "NO_GPRS_DATA_SUBSCRIBED";
case ODB__ALL__APN: return "ODB_ALL_APN";
case ODB__HPLMN__APN: return "ODB_HPLMN_APN";
case ODB__VPLMN__APN: return "ODB_VPLMN_APN";
default:
return "<unknown>";
}
}

AAA__3GPP__Error__Diagnostic::enum_type AAA__3GPP__Error__Diagnostic::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "GPRS_DATA_SUBSCRIBED")) return GPRS__DATA__SUBSCRIBED;
if (!strcmp(str_par, "NO_GPRS_DATA_SUBSCRIBED")) return NO__GPRS__DATA__SUBSCRIBED;
if (!strcmp(str_par, "ODB_ALL_APN")) return ODB__ALL__APN;
if (!strcmp(str_par, "ODB_HPLMN_APN")) return ODB__HPLMN__APN;
if (!strcmp(str_par, "ODB_VPLMN_APN")) return ODB__VPLMN__APN;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Error__Diagnostic::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Error__Diagnostic::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Error__Diagnostic::enum2int(const AAA__3GPP__Error__Diagnostic& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Error__Diagnostic::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Error__Diagnostic::operator AAA__3GPP__Error__Diagnostic::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return enum_value;
}

void AAA__3GPP__Error__Diagnostic::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Error__Diagnostic::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Error_Diagnostic");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
  }
}

void AAA__3GPP__Error__Diagnostic::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Error__Diagnostic::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", enum_value);
}

void AAA__3GPP__Error__Diagnostic::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Error__Diagnostic::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Error__Diagnostic::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Error__Diagnostic::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void AAA__3GPP__Error__Diagnostic_template::copy_template(const AAA__3GPP__Error__Diagnostic_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Error__Diagnostic_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Error__Diagnostic_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Error__Diagnostic_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template()
{
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Error__Diagnostic::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Error__Diagnostic::enum_type)other_value;
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(AAA__3GPP__Error__Diagnostic::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(const AAA__3GPP__Error__Diagnostic& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Error__Diagnostic::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
single_value = other_value.enum_value;
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(const OPTIONAL<AAA__3GPP__Error__Diagnostic>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Error__Diagnostic::enum_type)(const AAA__3GPP__Error__Diagnostic&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic from an unbound optional field.");
}
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(AAA__3GPP__Error__Diagnostic_template* p_precondition, AAA__3GPP__Error__Diagnostic_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(Dynamic_Match_Interface<AAA__3GPP__Error__Diagnostic>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Error__Diagnostic>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Error__Diagnostic_template::AAA__3GPP__Error__Diagnostic_template(const AAA__3GPP__Error__Diagnostic_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Error__Diagnostic_template::~AAA__3GPP__Error__Diagnostic_template()
{
clean_up();
}

boolean AAA__3GPP__Error__Diagnostic_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Error__Diagnostic_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Error__Diagnostic::UNBOUND_VALUE;
}

void AAA__3GPP__Error__Diagnostic_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(int other_value)
{
if (!AAA__3GPP__Error__Diagnostic::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Error__Diagnostic::enum_type)other_value;
return *this;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(AAA__3GPP__Error__Diagnostic::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(const AAA__3GPP__Error__Diagnostic& other_value)
{
if (other_value.enum_value == AAA__3GPP__Error__Diagnostic::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(const OPTIONAL<AAA__3GPP__Error__Diagnostic>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Error__Diagnostic::enum_type)(const AAA__3GPP__Error__Diagnostic&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
return *this;
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::operator=(const AAA__3GPP__Error__Diagnostic_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Error__Diagnostic_template::match(AAA__3GPP__Error__Diagnostic::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
return FALSE;
}

boolean AAA__3GPP__Error__Diagnostic_template::match(const AAA__3GPP__Error__Diagnostic& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Error__Diagnostic::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Error__Diagnostic::enum_type AAA__3GPP__Error__Diagnostic_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return single_value;
}

void AAA__3GPP__Error__Diagnostic_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Error__Diagnostic_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
}

AAA__3GPP__Error__Diagnostic_template& AAA__3GPP__Error__Diagnostic_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Error__Diagnostic_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Error__Diagnostic::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Error__Diagnostic_template::log_match(const AAA__3GPP__Error__Diagnostic& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Error__Diagnostic_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
}

void AAA__3GPP__Error__Diagnostic_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Error__Diagnostic::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Error__Diagnostic::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Error__Diagnostic_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
}
}

boolean AAA__3GPP__Error__Diagnostic_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Error__Diagnostic_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Error__Diagnostic_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Error__Diagnostic_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Error__Diagnostic::enum_type enum_val = AAA__3GPP__Error__Diagnostic::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Error__Diagnostic::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Error_Diagnostic.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Error__Diagnostic_template* precondition = new AAA__3GPP__Error__Diagnostic_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Error__Diagnostic_template* implied_template = new AAA__3GPP__Error__Diagnostic_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Error__Diagnostic_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Error_Diagnostic");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Error__Diagnostic_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Error_Diagnostic");
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::AAA__3GPP__VPLMN__Dynamic__Address__Allowed()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::AAA__3GPP__VPLMN__Dynamic__Address__Allowed(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::AAA__3GPP__VPLMN__Dynamic__Address__Allowed(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::AAA__3GPP__VPLMN__Dynamic__Address__Allowed(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
enum_value = other_value.enum_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed& AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed& AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed& AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator=(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value == other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator==(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value < other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator<(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value > other_value;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator>(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NOTALLOWED: return "NOTALLOWED";
case ALLOWED: return "ALLOWED";
default:
return "<unknown>";
}
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type AAA__3GPP__VPLMN__Dynamic__Address__Allowed::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NOTALLOWED")) return NOTALLOWED;
if (!strcmp(str_par, "ALLOWED")) return ALLOWED;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum2int(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::operator AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return enum_value;
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
  }
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", enum_value);
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__VPLMN__Dynamic__Address__Allowed::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__VPLMN__Dynamic__Address__Allowed::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::copy_template(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template()
{
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__VPLMN__Dynamic__Address__Allowed::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type)other_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__VPLMN__Dynamic__Address__Allowed::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
single_value = other_value.enum_value;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(const OPTIONAL<AAA__3GPP__VPLMN__Dynamic__Address__Allowed>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type)(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed from an unbound optional field.");
}
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template* p_precondition, AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(Dynamic_Match_Interface<AAA__3GPP__VPLMN__Dynamic__Address__Allowed>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__VPLMN__Dynamic__Address__Allowed>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::~AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template()
{
clean_up();
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__VPLMN__Dynamic__Address__Allowed::UNBOUND_VALUE;
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(int other_value)
{
if (!AAA__3GPP__VPLMN__Dynamic__Address__Allowed::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type)other_value;
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value)
{
if (other_value.enum_value == AAA__3GPP__VPLMN__Dynamic__Address__Allowed::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(const OPTIONAL<AAA__3GPP__VPLMN__Dynamic__Address__Allowed>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type)(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
return *this;
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::operator=(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::match(AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
return FALSE;
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::match(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__VPLMN__Dynamic__Address__Allowed::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return single_value;
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
}

AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template& AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
return value_list.list_value[list_index];
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::log_match(const AAA__3GPP__VPLMN__Dynamic__Address__Allowed& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__VPLMN__Dynamic__Address__Allowed::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
}
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__VPLMN__Dynamic__Address__Allowed::enum_type enum_val = AAA__3GPP__VPLMN__Dynamic__Address__Allowed::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__VPLMN__Dynamic__Address__Allowed::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template* precondition = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template* implied_template = new AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__VPLMN__Dynamic__Address__Allowed_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_VPLMN_Dynamic_Address_Allowed");
}

DCA__3GPP__Local__GW__Inserted__Indication::DCA__3GPP__Local__GW__Inserted__Indication()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Local__GW__Inserted__Indication::DCA__3GPP__Local__GW__Inserted__Indication(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Local__GW__Inserted__Indication::DCA__3GPP__Local__GW__Inserted__Indication(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Local__GW__Inserted__Indication::DCA__3GPP__Local__GW__Inserted__Indication(const DCA__3GPP__Local__GW__Inserted__Indication& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Local__GW__Inserted__Indication& DCA__3GPP__Local__GW__Inserted__Indication::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication& DCA__3GPP__Local__GW__Inserted__Indication::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication& DCA__3GPP__Local__GW__Inserted__Indication::operator=(const DCA__3GPP__Local__GW__Inserted__Indication& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value == other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator==(const DCA__3GPP__Local__GW__Inserted__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value < other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator<(const DCA__3GPP__Local__GW__Inserted__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value > other_value;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::operator>(const DCA__3GPP__Local__GW__Inserted__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Local__GW__Inserted__Indication::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case LOCAL__GW__NOT__INSERTED: return "LOCAL_GW_NOT_INSERTED";
case LOCAL__GW__INSERTED: return "LOCAL_GW_INSERTED";
default:
return "<unknown>";
}
}

DCA__3GPP__Local__GW__Inserted__Indication::enum_type DCA__3GPP__Local__GW__Inserted__Indication::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "LOCAL_GW_NOT_INSERTED")) return LOCAL__GW__NOT__INSERTED;
if (!strcmp(str_par, "LOCAL_GW_INSERTED")) return LOCAL__GW__INSERTED;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Local__GW__Inserted__Indication::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Local__GW__Inserted__Indication::enum2int(const DCA__3GPP__Local__GW__Inserted__Indication& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Local__GW__Inserted__Indication::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Local__GW__Inserted__Indication::operator DCA__3GPP__Local__GW__Inserted__Indication::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return enum_value;
}

void DCA__3GPP__Local__GW__Inserted__Indication::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Local__GW__Inserted__Indication::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
  }
}

void DCA__3GPP__Local__GW__Inserted__Indication::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Local__GW__Inserted__Indication::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", enum_value);
}

void DCA__3GPP__Local__GW__Inserted__Indication::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Local__GW__Inserted__Indication::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Local__GW__Inserted__Indication::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Local__GW__Inserted__Indication::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::copy_template(const DCA__3GPP__Local__GW__Inserted__Indication_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Local__GW__Inserted__Indication_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Local__GW__Inserted__Indication_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Local__GW__Inserted__Indication_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template()
{
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Local__GW__Inserted__Indication::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Local__GW__Inserted__Indication::enum_type)other_value;
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(DCA__3GPP__Local__GW__Inserted__Indication::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(const DCA__3GPP__Local__GW__Inserted__Indication& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Local__GW__Inserted__Indication::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
single_value = other_value.enum_value;
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(const OPTIONAL<DCA__3GPP__Local__GW__Inserted__Indication>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Local__GW__Inserted__Indication::enum_type)(const DCA__3GPP__Local__GW__Inserted__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication from an unbound optional field.");
}
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(DCA__3GPP__Local__GW__Inserted__Indication_template* p_precondition, DCA__3GPP__Local__GW__Inserted__Indication_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(Dynamic_Match_Interface<DCA__3GPP__Local__GW__Inserted__Indication>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Local__GW__Inserted__Indication>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Local__GW__Inserted__Indication_template::DCA__3GPP__Local__GW__Inserted__Indication_template(const DCA__3GPP__Local__GW__Inserted__Indication_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Local__GW__Inserted__Indication_template::~DCA__3GPP__Local__GW__Inserted__Indication_template()
{
clean_up();
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Local__GW__Inserted__Indication::UNBOUND_VALUE;
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(int other_value)
{
if (!DCA__3GPP__Local__GW__Inserted__Indication::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Local__GW__Inserted__Indication::enum_type)other_value;
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(DCA__3GPP__Local__GW__Inserted__Indication::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(const DCA__3GPP__Local__GW__Inserted__Indication& other_value)
{
if (other_value.enum_value == DCA__3GPP__Local__GW__Inserted__Indication::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(const OPTIONAL<DCA__3GPP__Local__GW__Inserted__Indication>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Local__GW__Inserted__Indication::enum_type)(const DCA__3GPP__Local__GW__Inserted__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
return *this;
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::operator=(const DCA__3GPP__Local__GW__Inserted__Indication_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::match(DCA__3GPP__Local__GW__Inserted__Indication::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
return FALSE;
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::match(const DCA__3GPP__Local__GW__Inserted__Indication& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Local__GW__Inserted__Indication::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Local__GW__Inserted__Indication::enum_type DCA__3GPP__Local__GW__Inserted__Indication_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return single_value;
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Local__GW__Inserted__Indication_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
}

DCA__3GPP__Local__GW__Inserted__Indication_template& DCA__3GPP__Local__GW__Inserted__Indication_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Local__GW__Inserted__Indication::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::log_match(const DCA__3GPP__Local__GW__Inserted__Indication& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Local__GW__Inserted__Indication::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Local__GW__Inserted__Indication::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Local__GW__Inserted__Indication_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
}
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Local__GW__Inserted__Indication_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Local__GW__Inserted__Indication_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Local__GW__Inserted__Indication::enum_type enum_val = DCA__3GPP__Local__GW__Inserted__Indication::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Local__GW__Inserted__Indication::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Local__GW__Inserted__Indication_template* precondition = new DCA__3GPP__Local__GW__Inserted__Indication_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Local__GW__Inserted__Indication_template* implied_template = new DCA__3GPP__Local__GW__Inserted__Indication_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Local__GW__Inserted__Indication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Local__GW__Inserted__Indication_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Local_GW_Inserted_Indication");
}

AAA__3GPP__User__State::AAA__3GPP__User__State()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__User__State::AAA__3GPP__User__State(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_User_State with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__User__State::AAA__3GPP__User__State(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__User__State::AAA__3GPP__User__State(const AAA__3GPP__User__State& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
enum_value = other_value.enum_value;
}

AAA__3GPP__User__State& AAA__3GPP__User__State::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__User__State& AAA__3GPP__User__State::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__User__State& AAA__3GPP__User__State::operator=(const AAA__3GPP__User__State& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__User__State::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_User_State comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__User__State::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value == other_value;
}

boolean AAA__3GPP__User__State::operator==(const AAA__3GPP__User__State& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__User__State::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_User_State comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__User__State::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value < other_value;
}

boolean AAA__3GPP__User__State::operator<(const AAA__3GPP__User__State& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__User__State::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_User_State comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__User__State::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value > other_value;
}

boolean AAA__3GPP__User__State::operator>(const AAA__3GPP__User__State& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__User__State::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case DETACHED: return "DETACHED";
case ATTACHED__NOT__REACHABLE__FOR__PAGING: return "ATTACHED_NOT_REACHABLE_FOR_PAGING";
case ATTACHED__REACHABLE__FOR__PAGING: return "ATTACHED_REACHABLE_FOR_PAGING";
case CONNECTED__NOT__REACHABLE__FOR__PAGING: return "CONNECTED_NOT_REACHABLE_FOR_PAGING";
case CONNECTED__REACHABLE__FOR__PAGING: return "CONNECTED_REACHABLE_FOR_PAGING";
case NETWORK__DETERMINED__NOT__REACHABLE: return "NETWORK_DETERMINED_NOT_REACHABLE";
default:
return "<unknown>";
}
}

AAA__3GPP__User__State::enum_type AAA__3GPP__User__State::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "DETACHED")) return DETACHED;
if (!strcmp(str_par, "ATTACHED_NOT_REACHABLE_FOR_PAGING")) return ATTACHED__NOT__REACHABLE__FOR__PAGING;
if (!strcmp(str_par, "ATTACHED_REACHABLE_FOR_PAGING")) return ATTACHED__REACHABLE__FOR__PAGING;
if (!strcmp(str_par, "CONNECTED_NOT_REACHABLE_FOR_PAGING")) return CONNECTED__NOT__REACHABLE__FOR__PAGING;
if (!strcmp(str_par, "CONNECTED_REACHABLE_FOR_PAGING")) return CONNECTED__REACHABLE__FOR__PAGING;
if (!strcmp(str_par, "NETWORK_DETERMINED_NOT_REACHABLE")) return NETWORK__DETERMINED__NOT__REACHABLE;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__User__State::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__User__State::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__User__State::enum2int(const AAA__3GPP__User__State& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__User__State::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__User__State::operator AAA__3GPP__User__State::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return enum_value;
}

void AAA__3GPP__User__State::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__User__State::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_User_State");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_User_State.");
  }
}

void AAA__3GPP__User__State::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__User__State::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", enum_value);
}

void AAA__3GPP__User__State::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__User__State::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__User__State::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__User__State::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void AAA__3GPP__User__State_template::copy_template(const AAA__3GPP__User__State_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__User__State_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__User__State_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__User__State_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template()
{
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__User__State::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__User__State::enum_type)other_value;
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(AAA__3GPP__User__State::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(const AAA__3GPP__User__State& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__User__State::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
single_value = other_value.enum_value;
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(const OPTIONAL<AAA__3GPP__User__State>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__User__State::enum_type)(const AAA__3GPP__User__State&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State from an unbound optional field.");
}
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(AAA__3GPP__User__State_template* p_precondition, AAA__3GPP__User__State_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(Dynamic_Match_Interface<AAA__3GPP__User__State>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__User__State>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__User__State_template::AAA__3GPP__User__State_template(const AAA__3GPP__User__State_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__User__State_template::~AAA__3GPP__User__State_template()
{
clean_up();
}

boolean AAA__3GPP__User__State_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__User__State_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__User__State::UNBOUND_VALUE;
}

void AAA__3GPP__User__State_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(int other_value)
{
if (!AAA__3GPP__User__State::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__User__State::enum_type)other_value;
return *this;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(AAA__3GPP__User__State::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(const AAA__3GPP__User__State& other_value)
{
if (other_value.enum_value == AAA__3GPP__User__State::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_User_State to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(const OPTIONAL<AAA__3GPP__User__State>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__User__State::enum_type)(const AAA__3GPP__User__State&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
return *this;
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::operator=(const AAA__3GPP__User__State_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__User__State_template::match(AAA__3GPP__User__State::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
return FALSE;
}

boolean AAA__3GPP__User__State_template::match(const AAA__3GPP__User__State& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__User__State::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__User__State::enum_type AAA__3GPP__User__State_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return single_value;
}

void AAA__3GPP__User__State_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__User__State_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
}

AAA__3GPP__User__State_template& AAA__3GPP__User__State_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
return value_list.list_value[list_index];
}

void AAA__3GPP__User__State_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__User__State::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__User__State_template::log_match(const AAA__3GPP__User__State& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__User__State_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
}

void AAA__3GPP__User__State_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__User__State::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__User__State::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__User__State_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_User_State.");
}
}

boolean AAA__3GPP__User__State_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__User__State_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__User__State_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__User__State_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__User__State::enum_type enum_val = AAA__3GPP__User__State::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__User__State::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_User_State.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__User__State_template* precondition = new AAA__3GPP__User__State_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__User__State_template* implied_template = new AAA__3GPP__User__State_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__User__State_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_User_State");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__User__State_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_User_State");
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::DCA__3GPP__Monitoring__Event__Configuration__Activity()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::DCA__3GPP__Monitoring__Event__Configuration__Activity(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::DCA__3GPP__Monitoring__Event__Configuration__Activity(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::DCA__3GPP__Monitoring__Event__Configuration__Activity(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity& DCA__3GPP__Monitoring__Event__Configuration__Activity::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity& DCA__3GPP__Monitoring__Event__Configuration__Activity::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity& DCA__3GPP__Monitoring__Event__Configuration__Activity::operator=(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value == other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator==(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value < other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator<(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value > other_value;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::operator>(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CREATE: return "CREATE";
case TRANSFER: return "TRANSFER";
case UPDATE: return "UPDATE";
case DELETE: return "DELETE";
default:
return "<unknown>";
}
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type DCA__3GPP__Monitoring__Event__Configuration__Activity::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CREATE")) return CREATE;
if (!strcmp(str_par, "TRANSFER")) return TRANSFER;
if (!strcmp(str_par, "UPDATE")) return UPDATE;
if (!strcmp(str_par, "DELETE")) return DELETE;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Monitoring__Event__Configuration__Activity::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Monitoring__Event__Configuration__Activity::enum2int(const DCA__3GPP__Monitoring__Event__Configuration__Activity& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::operator DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return enum_value;
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
  }
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", enum_value);
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Monitoring__Event__Configuration__Activity::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Monitoring__Event__Configuration__Activity::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::copy_template(const DCA__3GPP__Monitoring__Event__Configuration__Activity_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template()
{
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Monitoring__Event__Configuration__Activity::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type)other_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Configuration__Activity::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
single_value = other_value.enum_value;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(const OPTIONAL<DCA__3GPP__Monitoring__Event__Configuration__Activity>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type)(const DCA__3GPP__Monitoring__Event__Configuration__Activity&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity from an unbound optional field.");
}
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(DCA__3GPP__Monitoring__Event__Configuration__Activity_template* p_precondition, DCA__3GPP__Monitoring__Event__Configuration__Activity_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(Dynamic_Match_Interface<DCA__3GPP__Monitoring__Event__Configuration__Activity>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Monitoring__Event__Configuration__Activity>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::DCA__3GPP__Monitoring__Event__Configuration__Activity_template(const DCA__3GPP__Monitoring__Event__Configuration__Activity_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template::~DCA__3GPP__Monitoring__Event__Configuration__Activity_template()
{
clean_up();
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Monitoring__Event__Configuration__Activity::UNBOUND_VALUE;
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(int other_value)
{
if (!DCA__3GPP__Monitoring__Event__Configuration__Activity::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type)other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value)
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Configuration__Activity::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(const OPTIONAL<DCA__3GPP__Monitoring__Event__Configuration__Activity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type)(const DCA__3GPP__Monitoring__Event__Configuration__Activity&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
return *this;
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::operator=(const DCA__3GPP__Monitoring__Event__Configuration__Activity_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::match(DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
return FALSE;
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::match(const DCA__3GPP__Monitoring__Event__Configuration__Activity& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Configuration__Activity::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type DCA__3GPP__Monitoring__Event__Configuration__Activity_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return single_value;
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
}

DCA__3GPP__Monitoring__Event__Configuration__Activity_template& DCA__3GPP__Monitoring__Event__Configuration__Activity_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::log_match(const DCA__3GPP__Monitoring__Event__Configuration__Activity& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Monitoring__Event__Configuration__Activity::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
}
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Monitoring__Event__Configuration__Activity_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Monitoring__Event__Configuration__Activity_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Monitoring__Event__Configuration__Activity::enum_type enum_val = DCA__3GPP__Monitoring__Event__Configuration__Activity::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Monitoring__Event__Configuration__Activity::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Monitoring__Event__Configuration__Activity_template* precondition = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Monitoring__Event__Configuration__Activity_template* implied_template = new DCA__3GPP__Monitoring__Event__Configuration__Activity_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Monitoring__Event__Configuration__Activity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Monitoring__Event__Configuration__Activity_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Configuration_Activity");
}

AAA__3GPP__Trust__Relationship__Update::AAA__3GPP__Trust__Relationship__Update()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Trust__Relationship__Update::AAA__3GPP__Trust__Relationship__Update(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Trust__Relationship__Update::AAA__3GPP__Trust__Relationship__Update(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Trust__Relationship__Update::AAA__3GPP__Trust__Relationship__Update(const AAA__3GPP__Trust__Relationship__Update& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Trust__Relationship__Update& AAA__3GPP__Trust__Relationship__Update::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Trust__Relationship__Update& AAA__3GPP__Trust__Relationship__Update::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Trust__Relationship__Update& AAA__3GPP__Trust__Relationship__Update::operator=(const AAA__3GPP__Trust__Relationship__Update& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value == other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator==(const AAA__3GPP__Trust__Relationship__Update& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value < other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator<(const AAA__3GPP__Trust__Relationship__Update& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value > other_value;
}

boolean AAA__3GPP__Trust__Relationship__Update::operator>(const AAA__3GPP__Trust__Relationship__Update& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Trust__Relationship__Update::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case REQUEST__UPDATE: return "REQUEST_UPDATE";
default:
return "<unknown>";
}
}

AAA__3GPP__Trust__Relationship__Update::enum_type AAA__3GPP__Trust__Relationship__Update::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "REQUEST_UPDATE")) return REQUEST__UPDATE;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Trust__Relationship__Update::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Trust__Relationship__Update::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Trust__Relationship__Update::enum2int(const AAA__3GPP__Trust__Relationship__Update& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Trust__Relationship__Update::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Trust__Relationship__Update::operator AAA__3GPP__Trust__Relationship__Update::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return enum_value;
}

void AAA__3GPP__Trust__Relationship__Update::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Trust__Relationship__Update::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
  }
}

void AAA__3GPP__Trust__Relationship__Update::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Trust__Relationship__Update::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", enum_value);
}

void AAA__3GPP__Trust__Relationship__Update::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Trust__Relationship__Update::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Trust__Relationship__Update::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Trust__Relationship__Update::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void AAA__3GPP__Trust__Relationship__Update_template::copy_template(const AAA__3GPP__Trust__Relationship__Update_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Trust__Relationship__Update_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Trust__Relationship__Update_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Trust__Relationship__Update_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template()
{
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Trust__Relationship__Update::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Trust__Relationship__Update::enum_type)other_value;
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(AAA__3GPP__Trust__Relationship__Update::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(const AAA__3GPP__Trust__Relationship__Update& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Trust__Relationship__Update::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
single_value = other_value.enum_value;
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(const OPTIONAL<AAA__3GPP__Trust__Relationship__Update>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Trust__Relationship__Update::enum_type)(const AAA__3GPP__Trust__Relationship__Update&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update from an unbound optional field.");
}
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(AAA__3GPP__Trust__Relationship__Update_template* p_precondition, AAA__3GPP__Trust__Relationship__Update_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(Dynamic_Match_Interface<AAA__3GPP__Trust__Relationship__Update>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Trust__Relationship__Update>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Trust__Relationship__Update_template::AAA__3GPP__Trust__Relationship__Update_template(const AAA__3GPP__Trust__Relationship__Update_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Trust__Relationship__Update_template::~AAA__3GPP__Trust__Relationship__Update_template()
{
clean_up();
}

boolean AAA__3GPP__Trust__Relationship__Update_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Trust__Relationship__Update_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Trust__Relationship__Update::UNBOUND_VALUE;
}

void AAA__3GPP__Trust__Relationship__Update_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(int other_value)
{
if (!AAA__3GPP__Trust__Relationship__Update::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Trust__Relationship__Update::enum_type)other_value;
return *this;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(AAA__3GPP__Trust__Relationship__Update::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(const AAA__3GPP__Trust__Relationship__Update& other_value)
{
if (other_value.enum_value == AAA__3GPP__Trust__Relationship__Update::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(const OPTIONAL<AAA__3GPP__Trust__Relationship__Update>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Trust__Relationship__Update::enum_type)(const AAA__3GPP__Trust__Relationship__Update&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
return *this;
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::operator=(const AAA__3GPP__Trust__Relationship__Update_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Trust__Relationship__Update_template::match(AAA__3GPP__Trust__Relationship__Update::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
return FALSE;
}

boolean AAA__3GPP__Trust__Relationship__Update_template::match(const AAA__3GPP__Trust__Relationship__Update& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Trust__Relationship__Update::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Trust__Relationship__Update::enum_type AAA__3GPP__Trust__Relationship__Update_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return single_value;
}

void AAA__3GPP__Trust__Relationship__Update_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Trust__Relationship__Update_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
}

AAA__3GPP__Trust__Relationship__Update_template& AAA__3GPP__Trust__Relationship__Update_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Trust__Relationship__Update_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Trust__Relationship__Update::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Trust__Relationship__Update_template::log_match(const AAA__3GPP__Trust__Relationship__Update& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Trust__Relationship__Update_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
}

void AAA__3GPP__Trust__Relationship__Update_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Trust__Relationship__Update::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Trust__Relationship__Update::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Trust__Relationship__Update_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
}
}

boolean AAA__3GPP__Trust__Relationship__Update_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Trust__Relationship__Update_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Trust__Relationship__Update_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Trust__Relationship__Update_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Trust__Relationship__Update::enum_type enum_val = AAA__3GPP__Trust__Relationship__Update::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Trust__Relationship__Update::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Trust__Relationship__Update_template* precondition = new AAA__3GPP__Trust__Relationship__Update_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Trust__Relationship__Update_template* implied_template = new AAA__3GPP__Trust__Relationship__Update_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Trust__Relationship__Update_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Trust__Relationship__Update_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Trust_Relationship_Update");
}

DCA__3GPP__Session__Direction::DCA__3GPP__Session__Direction()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Session__Direction::DCA__3GPP__Session__Direction(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Session__Direction::DCA__3GPP__Session__Direction(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Session__Direction::DCA__3GPP__Session__Direction(const DCA__3GPP__Session__Direction& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Session__Direction& DCA__3GPP__Session__Direction::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Session__Direction& DCA__3GPP__Session__Direction::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Session__Direction& DCA__3GPP__Session__Direction::operator=(const DCA__3GPP__Session__Direction& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Session__Direction::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Session__Direction::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value == other_value;
}

boolean DCA__3GPP__Session__Direction::operator==(const DCA__3GPP__Session__Direction& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Session__Direction::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Session__Direction::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value < other_value;
}

boolean DCA__3GPP__Session__Direction::operator<(const DCA__3GPP__Session__Direction& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Session__Direction::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Session__Direction::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value > other_value;
}

boolean DCA__3GPP__Session__Direction::operator>(const DCA__3GPP__Session__Direction& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Session__Direction::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case Inbound: return "Inbound";
case Outbound: return "Outbound";
default:
return "<unknown>";
}
}

DCA__3GPP__Session__Direction::enum_type DCA__3GPP__Session__Direction::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "Inbound")) return Inbound;
if (!strcmp(str_par, "Outbound")) return Outbound;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Session__Direction::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Session__Direction::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Session__Direction::enum2int(const DCA__3GPP__Session__Direction& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Session__Direction::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Session__Direction::operator DCA__3GPP__Session__Direction::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return enum_value;
}

void DCA__3GPP__Session__Direction::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Session__Direction::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Session_Direction");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
  }
}

void DCA__3GPP__Session__Direction::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Session__Direction::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", enum_value);
}

void DCA__3GPP__Session__Direction::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Session__Direction::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Session__Direction::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Session__Direction::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Session__Direction_template::copy_template(const DCA__3GPP__Session__Direction_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Session__Direction_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Session__Direction_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Session__Direction_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template()
{
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Session__Direction::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Session__Direction::enum_type)other_value;
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(DCA__3GPP__Session__Direction::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(const DCA__3GPP__Session__Direction& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Session__Direction::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
single_value = other_value.enum_value;
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(const OPTIONAL<DCA__3GPP__Session__Direction>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Session__Direction::enum_type)(const DCA__3GPP__Session__Direction&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction from an unbound optional field.");
}
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(DCA__3GPP__Session__Direction_template* p_precondition, DCA__3GPP__Session__Direction_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(Dynamic_Match_Interface<DCA__3GPP__Session__Direction>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Session__Direction>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Session__Direction_template::DCA__3GPP__Session__Direction_template(const DCA__3GPP__Session__Direction_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Session__Direction_template::~DCA__3GPP__Session__Direction_template()
{
clean_up();
}

boolean DCA__3GPP__Session__Direction_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Session__Direction_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Session__Direction::UNBOUND_VALUE;
}

void DCA__3GPP__Session__Direction_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(int other_value)
{
if (!DCA__3GPP__Session__Direction::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Session__Direction::enum_type)other_value;
return *this;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(DCA__3GPP__Session__Direction::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(const DCA__3GPP__Session__Direction& other_value)
{
if (other_value.enum_value == DCA__3GPP__Session__Direction::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(const OPTIONAL<DCA__3GPP__Session__Direction>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Session__Direction::enum_type)(const DCA__3GPP__Session__Direction&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
return *this;
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::operator=(const DCA__3GPP__Session__Direction_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Session__Direction_template::match(DCA__3GPP__Session__Direction::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
return FALSE;
}

boolean DCA__3GPP__Session__Direction_template::match(const DCA__3GPP__Session__Direction& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Session__Direction::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Session__Direction::enum_type DCA__3GPP__Session__Direction_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return single_value;
}

void DCA__3GPP__Session__Direction_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Session__Direction_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
}

DCA__3GPP__Session__Direction_template& DCA__3GPP__Session__Direction_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Session__Direction_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Session__Direction::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Session__Direction_template::log_match(const DCA__3GPP__Session__Direction& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Session__Direction_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
}

void DCA__3GPP__Session__Direction_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Session__Direction::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Session__Direction::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Session__Direction_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
}
}

boolean DCA__3GPP__Session__Direction_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Session__Direction_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Session__Direction_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Session__Direction_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Session__Direction::enum_type enum_val = DCA__3GPP__Session__Direction::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Session__Direction::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Session_Direction.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Session__Direction_template* precondition = new DCA__3GPP__Session__Direction_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Session__Direction_template* implied_template = new DCA__3GPP__Session__Direction_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Session__Direction_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Session_Direction");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Session__Direction_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Session_Direction");
}

PCC__3GPP__Session__Linking__Indicator::PCC__3GPP__Session__Linking__Indicator()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Session__Linking__Indicator::PCC__3GPP__Session__Linking__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Session__Linking__Indicator::PCC__3GPP__Session__Linking__Indicator(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Session__Linking__Indicator::PCC__3GPP__Session__Linking__Indicator(const PCC__3GPP__Session__Linking__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Session__Linking__Indicator& PCC__3GPP__Session__Linking__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Session__Linking__Indicator& PCC__3GPP__Session__Linking__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Session__Linking__Indicator& PCC__3GPP__Session__Linking__Indicator::operator=(const PCC__3GPP__Session__Linking__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value == other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator==(const PCC__3GPP__Session__Linking__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value < other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator<(const PCC__3GPP__Session__Linking__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value > other_value;
}

boolean PCC__3GPP__Session__Linking__Indicator::operator>(const PCC__3GPP__Session__Linking__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Session__Linking__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SESSION__LINKING__IMMEDIATE: return "SESSION_LINKING_IMMEDIATE";
case SESSION__LINKING__DEFERRED: return "SESSION_LINKING_DEFERRED";
case SESSION__LINKING__INVALID: return "SESSION_LINKING_INVALID";
default:
return "<unknown>";
}
}

PCC__3GPP__Session__Linking__Indicator::enum_type PCC__3GPP__Session__Linking__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SESSION_LINKING_IMMEDIATE")) return SESSION__LINKING__IMMEDIATE;
if (!strcmp(str_par, "SESSION_LINKING_DEFERRED")) return SESSION__LINKING__DEFERRED;
if (!strcmp(str_par, "SESSION_LINKING_INVALID")) return SESSION__LINKING__INVALID;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Session__Linking__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 100:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Session__Linking__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Session__Linking__Indicator::enum2int(const PCC__3GPP__Session__Linking__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Session__Linking__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Session__Linking__Indicator::operator PCC__3GPP__Session__Linking__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return enum_value;
}

void PCC__3GPP__Session__Linking__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Session__Linking__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
  }
}

void PCC__3GPP__Session__Linking__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Session__Linking__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", enum_value);
}

void PCC__3GPP__Session__Linking__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Session__Linking__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Session__Linking__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 7, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Session__Linking__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 7);
}

void PCC__3GPP__Session__Linking__Indicator_template::copy_template(const PCC__3GPP__Session__Linking__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Session__Linking__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Session__Linking__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Session__Linking__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template()
{
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Session__Linking__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Session__Linking__Indicator::enum_type)other_value;
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(PCC__3GPP__Session__Linking__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(const PCC__3GPP__Session__Linking__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Session__Linking__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
single_value = other_value.enum_value;
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(const OPTIONAL<PCC__3GPP__Session__Linking__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Session__Linking__Indicator::enum_type)(const PCC__3GPP__Session__Linking__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator from an unbound optional field.");
}
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(PCC__3GPP__Session__Linking__Indicator_template* p_precondition, PCC__3GPP__Session__Linking__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(Dynamic_Match_Interface<PCC__3GPP__Session__Linking__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Session__Linking__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Session__Linking__Indicator_template::PCC__3GPP__Session__Linking__Indicator_template(const PCC__3GPP__Session__Linking__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Session__Linking__Indicator_template::~PCC__3GPP__Session__Linking__Indicator_template()
{
clean_up();
}

boolean PCC__3GPP__Session__Linking__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Session__Linking__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Session__Linking__Indicator::UNBOUND_VALUE;
}

void PCC__3GPP__Session__Linking__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(int other_value)
{
if (!PCC__3GPP__Session__Linking__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Session__Linking__Indicator::enum_type)other_value;
return *this;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(PCC__3GPP__Session__Linking__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(const PCC__3GPP__Session__Linking__Indicator& other_value)
{
if (other_value.enum_value == PCC__3GPP__Session__Linking__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(const OPTIONAL<PCC__3GPP__Session__Linking__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Session__Linking__Indicator::enum_type)(const PCC__3GPP__Session__Linking__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
return *this;
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::operator=(const PCC__3GPP__Session__Linking__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Session__Linking__Indicator_template::match(PCC__3GPP__Session__Linking__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
return FALSE;
}

boolean PCC__3GPP__Session__Linking__Indicator_template::match(const PCC__3GPP__Session__Linking__Indicator& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Session__Linking__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Session__Linking__Indicator::enum_type PCC__3GPP__Session__Linking__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return single_value;
}

void PCC__3GPP__Session__Linking__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Session__Linking__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
}

PCC__3GPP__Session__Linking__Indicator_template& PCC__3GPP__Session__Linking__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Session__Linking__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Session__Linking__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Session__Linking__Indicator_template::log_match(const PCC__3GPP__Session__Linking__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Session__Linking__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
}

void PCC__3GPP__Session__Linking__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Session__Linking__Indicator::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Session__Linking__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Session__Linking__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
}
}

boolean PCC__3GPP__Session__Linking__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Session__Linking__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Session__Linking__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Session__Linking__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Session__Linking__Indicator::enum_type enum_val = PCC__3GPP__Session__Linking__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Session__Linking__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Session__Linking__Indicator_template* precondition = new PCC__3GPP__Session__Linking__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Session__Linking__Indicator_template* implied_template = new PCC__3GPP__Session__Linking__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Session__Linking__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Session__Linking__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Session_Linking_Indicator");
}

PCC__3GPP__QoS__Negotiation::PCC__3GPP__QoS__Negotiation()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__QoS__Negotiation::PCC__3GPP__QoS__Negotiation(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__QoS__Negotiation::PCC__3GPP__QoS__Negotiation(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__QoS__Negotiation::PCC__3GPP__QoS__Negotiation(const PCC__3GPP__QoS__Negotiation& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
enum_value = other_value.enum_value;
}

PCC__3GPP__QoS__Negotiation& PCC__3GPP__QoS__Negotiation::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__QoS__Negotiation& PCC__3GPP__QoS__Negotiation::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__QoS__Negotiation& PCC__3GPP__QoS__Negotiation::operator=(const PCC__3GPP__QoS__Negotiation& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__QoS__Negotiation::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value == other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator==(const PCC__3GPP__QoS__Negotiation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value < other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator<(const PCC__3GPP__QoS__Negotiation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value > other_value;
}

boolean PCC__3GPP__QoS__Negotiation::operator>(const PCC__3GPP__QoS__Negotiation& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__QoS__Negotiation::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NO__QoS__NEGOTIATION: return "NO_QoS_NEGOTIATION";
case QoS__NEGOTIATION__SUPPORTED: return "QoS_NEGOTIATION_SUPPORTED";
default:
return "<unknown>";
}
}

PCC__3GPP__QoS__Negotiation::enum_type PCC__3GPP__QoS__Negotiation::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NO_QoS_NEGOTIATION")) return NO__QoS__NEGOTIATION;
if (!strcmp(str_par, "QoS_NEGOTIATION_SUPPORTED")) return QoS__NEGOTIATION__SUPPORTED;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__QoS__Negotiation::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__QoS__Negotiation::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__QoS__Negotiation::enum2int(const PCC__3GPP__QoS__Negotiation& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__QoS__Negotiation::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__QoS__Negotiation::operator PCC__3GPP__QoS__Negotiation::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return enum_value;
}

void PCC__3GPP__QoS__Negotiation::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__QoS__Negotiation::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_QoS_Negotiation");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
  }
}

void PCC__3GPP__QoS__Negotiation::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__QoS__Negotiation::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", enum_value);
}

void PCC__3GPP__QoS__Negotiation::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__QoS__Negotiation::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__QoS__Negotiation::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__QoS__Negotiation::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void PCC__3GPP__QoS__Negotiation_template::copy_template(const PCC__3GPP__QoS__Negotiation_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__QoS__Negotiation_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__QoS__Negotiation_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__QoS__Negotiation_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template()
{
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__QoS__Negotiation::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__QoS__Negotiation::enum_type)other_value;
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(PCC__3GPP__QoS__Negotiation::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(const PCC__3GPP__QoS__Negotiation& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__QoS__Negotiation::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
single_value = other_value.enum_value;
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(const OPTIONAL<PCC__3GPP__QoS__Negotiation>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__QoS__Negotiation::enum_type)(const PCC__3GPP__QoS__Negotiation&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation from an unbound optional field.");
}
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(PCC__3GPP__QoS__Negotiation_template* p_precondition, PCC__3GPP__QoS__Negotiation_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(Dynamic_Match_Interface<PCC__3GPP__QoS__Negotiation>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__QoS__Negotiation>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__QoS__Negotiation_template::PCC__3GPP__QoS__Negotiation_template(const PCC__3GPP__QoS__Negotiation_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__QoS__Negotiation_template::~PCC__3GPP__QoS__Negotiation_template()
{
clean_up();
}

boolean PCC__3GPP__QoS__Negotiation_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__QoS__Negotiation_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__QoS__Negotiation::UNBOUND_VALUE;
}

void PCC__3GPP__QoS__Negotiation_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(int other_value)
{
if (!PCC__3GPP__QoS__Negotiation::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__QoS__Negotiation::enum_type)other_value;
return *this;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(PCC__3GPP__QoS__Negotiation::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(const PCC__3GPP__QoS__Negotiation& other_value)
{
if (other_value.enum_value == PCC__3GPP__QoS__Negotiation::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(const OPTIONAL<PCC__3GPP__QoS__Negotiation>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__QoS__Negotiation::enum_type)(const PCC__3GPP__QoS__Negotiation&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
return *this;
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::operator=(const PCC__3GPP__QoS__Negotiation_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__QoS__Negotiation_template::match(PCC__3GPP__QoS__Negotiation::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
return FALSE;
}

boolean PCC__3GPP__QoS__Negotiation_template::match(const PCC__3GPP__QoS__Negotiation& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__QoS__Negotiation::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__QoS__Negotiation::enum_type PCC__3GPP__QoS__Negotiation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return single_value;
}

void PCC__3GPP__QoS__Negotiation_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__QoS__Negotiation_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
}

PCC__3GPP__QoS__Negotiation_template& PCC__3GPP__QoS__Negotiation_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
return value_list.list_value[list_index];
}

void PCC__3GPP__QoS__Negotiation_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__QoS__Negotiation::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__QoS__Negotiation_template::log_match(const PCC__3GPP__QoS__Negotiation& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__QoS__Negotiation_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
}

void PCC__3GPP__QoS__Negotiation_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__QoS__Negotiation::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__QoS__Negotiation::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__QoS__Negotiation_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
}
}

boolean PCC__3GPP__QoS__Negotiation_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__QoS__Negotiation_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__QoS__Negotiation_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__QoS__Negotiation_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__QoS__Negotiation::enum_type enum_val = PCC__3GPP__QoS__Negotiation::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__QoS__Negotiation::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_QoS_Negotiation.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__QoS__Negotiation_template* precondition = new PCC__3GPP__QoS__Negotiation_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__QoS__Negotiation_template* implied_template = new PCC__3GPP__QoS__Negotiation_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__QoS__Negotiation_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_QoS_Negotiation");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__QoS__Negotiation_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_QoS_Negotiation");
}

AAA__3GPP__LIPA__Permission::AAA__3GPP__LIPA__Permission()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__LIPA__Permission::AAA__3GPP__LIPA__Permission(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__LIPA__Permission::AAA__3GPP__LIPA__Permission(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__LIPA__Permission::AAA__3GPP__LIPA__Permission(const AAA__3GPP__LIPA__Permission& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
enum_value = other_value.enum_value;
}

AAA__3GPP__LIPA__Permission& AAA__3GPP__LIPA__Permission::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__LIPA__Permission& AAA__3GPP__LIPA__Permission::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__LIPA__Permission& AAA__3GPP__LIPA__Permission::operator=(const AAA__3GPP__LIPA__Permission& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__LIPA__Permission::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value == other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator==(const AAA__3GPP__LIPA__Permission& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__LIPA__Permission::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value < other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator<(const AAA__3GPP__LIPA__Permission& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__LIPA__Permission::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value > other_value;
}

boolean AAA__3GPP__LIPA__Permission::operator>(const AAA__3GPP__LIPA__Permission& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__LIPA__Permission::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case LIPA__PROHIBITED: return "LIPA_PROHIBITED";
case LIPA__ONLY: return "LIPA_ONLY";
case LIPA__CONDITIONAL: return "LIPA_CONDITIONAL";
default:
return "<unknown>";
}
}

AAA__3GPP__LIPA__Permission::enum_type AAA__3GPP__LIPA__Permission::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "LIPA_PROHIBITED")) return LIPA__PROHIBITED;
if (!strcmp(str_par, "LIPA_ONLY")) return LIPA__ONLY;
if (!strcmp(str_par, "LIPA_CONDITIONAL")) return LIPA__CONDITIONAL;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__LIPA__Permission::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__LIPA__Permission::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__LIPA__Permission::enum2int(const AAA__3GPP__LIPA__Permission& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__LIPA__Permission::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__LIPA__Permission::operator AAA__3GPP__LIPA__Permission::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return enum_value;
}

void AAA__3GPP__LIPA__Permission::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__LIPA__Permission::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_LIPA_Permission");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
  }
}

void AAA__3GPP__LIPA__Permission::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__LIPA__Permission::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", enum_value);
}

void AAA__3GPP__LIPA__Permission::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__LIPA__Permission::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__LIPA__Permission::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__LIPA__Permission::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__LIPA__Permission_template::copy_template(const AAA__3GPP__LIPA__Permission_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__LIPA__Permission_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__LIPA__Permission_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__LIPA__Permission_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template()
{
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__LIPA__Permission::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__LIPA__Permission::enum_type)other_value;
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(AAA__3GPP__LIPA__Permission::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(const AAA__3GPP__LIPA__Permission& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__LIPA__Permission::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
single_value = other_value.enum_value;
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(const OPTIONAL<AAA__3GPP__LIPA__Permission>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__LIPA__Permission::enum_type)(const AAA__3GPP__LIPA__Permission&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission from an unbound optional field.");
}
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(AAA__3GPP__LIPA__Permission_template* p_precondition, AAA__3GPP__LIPA__Permission_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(Dynamic_Match_Interface<AAA__3GPP__LIPA__Permission>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__LIPA__Permission>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__LIPA__Permission_template::AAA__3GPP__LIPA__Permission_template(const AAA__3GPP__LIPA__Permission_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__LIPA__Permission_template::~AAA__3GPP__LIPA__Permission_template()
{
clean_up();
}

boolean AAA__3GPP__LIPA__Permission_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__LIPA__Permission_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__LIPA__Permission::UNBOUND_VALUE;
}

void AAA__3GPP__LIPA__Permission_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(int other_value)
{
if (!AAA__3GPP__LIPA__Permission::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__LIPA__Permission::enum_type)other_value;
return *this;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(AAA__3GPP__LIPA__Permission::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(const AAA__3GPP__LIPA__Permission& other_value)
{
if (other_value.enum_value == AAA__3GPP__LIPA__Permission::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(const OPTIONAL<AAA__3GPP__LIPA__Permission>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__LIPA__Permission::enum_type)(const AAA__3GPP__LIPA__Permission&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
return *this;
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::operator=(const AAA__3GPP__LIPA__Permission_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__LIPA__Permission_template::match(AAA__3GPP__LIPA__Permission::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
return FALSE;
}

boolean AAA__3GPP__LIPA__Permission_template::match(const AAA__3GPP__LIPA__Permission& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__LIPA__Permission::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__LIPA__Permission::enum_type AAA__3GPP__LIPA__Permission_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return single_value;
}

void AAA__3GPP__LIPA__Permission_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__LIPA__Permission_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
}

AAA__3GPP__LIPA__Permission_template& AAA__3GPP__LIPA__Permission_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
return value_list.list_value[list_index];
}

void AAA__3GPP__LIPA__Permission_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__LIPA__Permission::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__LIPA__Permission_template::log_match(const AAA__3GPP__LIPA__Permission& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__LIPA__Permission_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
}

void AAA__3GPP__LIPA__Permission_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__LIPA__Permission::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__LIPA__Permission::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__LIPA__Permission_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
}
}

boolean AAA__3GPP__LIPA__Permission_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__LIPA__Permission_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__LIPA__Permission_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__LIPA__Permission_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__LIPA__Permission::enum_type enum_val = AAA__3GPP__LIPA__Permission::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__LIPA__Permission::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_LIPA_Permission.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__LIPA__Permission_template* precondition = new AAA__3GPP__LIPA__Permission_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__LIPA__Permission_template* implied_template = new AAA__3GPP__LIPA__Permission_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__LIPA__Permission_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_LIPA_Permission");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__LIPA__Permission_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_LIPA_Permission");
}

CxDx__3GPP__Multiple__Registration__Indication::CxDx__3GPP__Multiple__Registration__Indication()
{
enum_value = UNBOUND_VALUE;
}

CxDx__3GPP__Multiple__Registration__Indication::CxDx__3GPP__Multiple__Registration__Indication(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

CxDx__3GPP__Multiple__Registration__Indication::CxDx__3GPP__Multiple__Registration__Indication(enum_type other_value)
{
enum_value = other_value;
}

CxDx__3GPP__Multiple__Registration__Indication::CxDx__3GPP__Multiple__Registration__Indication(const CxDx__3GPP__Multiple__Registration__Indication& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
enum_value = other_value.enum_value;
}

CxDx__3GPP__Multiple__Registration__Indication& CxDx__3GPP__Multiple__Registration__Indication::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication& CxDx__3GPP__Multiple__Registration__Indication::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication& CxDx__3GPP__Multiple__Registration__Indication::operator=(const CxDx__3GPP__Multiple__Registration__Indication& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
enum_value = other_value.enum_value;
return *this;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value == other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator==(const CxDx__3GPP__Multiple__Registration__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value == other_value.enum_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value < other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator<(const CxDx__3GPP__Multiple__Registration__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value < other_value.enum_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value > other_value;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::operator>(const CxDx__3GPP__Multiple__Registration__Indication& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value > other_value.enum_value;
}

const char *CxDx__3GPP__Multiple__Registration__Indication::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NOT__MULTIPLE__REGISTRATION: return "NOT_MULTIPLE_REGISTRATION";
case MULTIPLE__REGISTRATION: return "MULTIPLE_REGISTRATION";
default:
return "<unknown>";
}
}

CxDx__3GPP__Multiple__Registration__Indication::enum_type CxDx__3GPP__Multiple__Registration__Indication::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NOT_MULTIPLE_REGISTRATION")) return NOT__MULTIPLE__REGISTRATION;
if (!strcmp(str_par, "MULTIPLE_REGISTRATION")) return MULTIPLE__REGISTRATION;
}
return UNKNOWN_VALUE;
}

boolean CxDx__3GPP__Multiple__Registration__Indication::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int CxDx__3GPP__Multiple__Registration__Indication::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CxDx__3GPP__Multiple__Registration__Indication::enum2int(const CxDx__3GPP__Multiple__Registration__Indication& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void CxDx__3GPP__Multiple__Registration__Indication::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", int_val);
enum_value = (enum_type)int_val;
}

CxDx__3GPP__Multiple__Registration__Indication::operator CxDx__3GPP__Multiple__Registration__Indication::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return enum_value;
}

void CxDx__3GPP__Multiple__Registration__Indication::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CxDx__3GPP__Multiple__Registration__Indication::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
  }
}

void CxDx__3GPP__Multiple__Registration__Indication::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
text_buf.push_int(enum_value);
}

void CxDx__3GPP__Multiple__Registration__Indication::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", enum_value);
}

void CxDx__3GPP__Multiple__Registration__Indication::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CxDx__3GPP__Multiple__Registration__Indication::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CxDx__3GPP__Multiple__Registration__Indication::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CxDx__3GPP__Multiple__Registration__Indication::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void CxDx__3GPP__Multiple__Registration__Indication_template::copy_template(const CxDx__3GPP__Multiple__Registration__Indication_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CxDx__3GPP__Multiple__Registration__Indication_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CxDx__3GPP__Multiple__Registration__Indication_template(*other_value.implication_.precondition);
implication_.implied_template = new CxDx__3GPP__Multiple__Registration__Indication_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template()
{
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!CxDx__3GPP__Multiple__Registration__Indication::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication with unknown numeric value %d.", other_value);
single_value = (CxDx__3GPP__Multiple__Registration__Indication::enum_type)other_value;
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(CxDx__3GPP__Multiple__Registration__Indication::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(const CxDx__3GPP__Multiple__Registration__Indication& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CxDx__3GPP__Multiple__Registration__Indication::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
single_value = other_value.enum_value;
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(const OPTIONAL<CxDx__3GPP__Multiple__Registration__Indication>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Multiple__Registration__Indication::enum_type)(const CxDx__3GPP__Multiple__Registration__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication from an unbound optional field.");
}
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(CxDx__3GPP__Multiple__Registration__Indication_template* p_precondition, CxDx__3GPP__Multiple__Registration__Indication_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(Dynamic_Match_Interface<CxDx__3GPP__Multiple__Registration__Indication>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<CxDx__3GPP__Multiple__Registration__Indication>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

CxDx__3GPP__Multiple__Registration__Indication_template::CxDx__3GPP__Multiple__Registration__Indication_template(const CxDx__3GPP__Multiple__Registration__Indication_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

CxDx__3GPP__Multiple__Registration__Indication_template::~CxDx__3GPP__Multiple__Registration__Indication_template()
{
clean_up();
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != CxDx__3GPP__Multiple__Registration__Indication::UNBOUND_VALUE;
}

void CxDx__3GPP__Multiple__Registration__Indication_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(int other_value)
{
if (!CxDx__3GPP__Multiple__Registration__Indication::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Multiple__Registration__Indication::enum_type)other_value;
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(CxDx__3GPP__Multiple__Registration__Indication::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(const CxDx__3GPP__Multiple__Registration__Indication& other_value)
{
if (other_value.enum_value == CxDx__3GPP__Multiple__Registration__Indication::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(const OPTIONAL<CxDx__3GPP__Multiple__Registration__Indication>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Multiple__Registration__Indication::enum_type)(const CxDx__3GPP__Multiple__Registration__Indication&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
return *this;
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::operator=(const CxDx__3GPP__Multiple__Registration__Indication_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::match(CxDx__3GPP__Multiple__Registration__Indication::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
return FALSE;
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::match(const CxDx__3GPP__Multiple__Registration__Indication& other_value, boolean) const
{
if (other_value.enum_value == CxDx__3GPP__Multiple__Registration__Indication::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication with an unbound value.");
return match(other_value.enum_value);
}

CxDx__3GPP__Multiple__Registration__Indication::enum_type CxDx__3GPP__Multiple__Registration__Indication_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return single_value;
}

void CxDx__3GPP__Multiple__Registration__Indication_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CxDx__3GPP__Multiple__Registration__Indication_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
}

CxDx__3GPP__Multiple__Registration__Indication_template& CxDx__3GPP__Multiple__Registration__Indication_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
return value_list.list_value[list_index];
}

void CxDx__3GPP__Multiple__Registration__Indication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(CxDx__3GPP__Multiple__Registration__Indication::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CxDx__3GPP__Multiple__Registration__Indication_template::log_match(const CxDx__3GPP__Multiple__Registration__Indication& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void CxDx__3GPP__Multiple__Registration__Indication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
}

void CxDx__3GPP__Multiple__Registration__Indication_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CxDx__3GPP__Multiple__Registration__Indication::enum_type)text_buf.pull_int().get_val();
if (!CxDx__3GPP__Multiple__Registration__Indication::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CxDx__3GPP__Multiple__Registration__Indication_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
}
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CxDx__3GPP__Multiple__Registration__Indication_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void CxDx__3GPP__Multiple__Registration__Indication_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CxDx__3GPP__Multiple__Registration__Indication_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CxDx__3GPP__Multiple__Registration__Indication::enum_type enum_val = CxDx__3GPP__Multiple__Registration__Indication::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CxDx__3GPP__Multiple__Registration__Indication::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CxDx__3GPP__Multiple__Registration__Indication_template* precondition = new CxDx__3GPP__Multiple__Registration__Indication_template;
    precondition->set_param(*m_p->get_elem(0));
    CxDx__3GPP__Multiple__Registration__Indication_template* implied_template = new CxDx__3GPP__Multiple__Registration__Indication_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CxDx__3GPP__Multiple__Registration__Indication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication");
  }
  is_ifpresent = param.get_ifpresent();
}

void CxDx__3GPP__Multiple__Registration__Indication_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.CxDx_3GPP_Multiple_Registration_Indication");
}

DCA__3GPP__IMSI__Unauthenticated__Flag::DCA__3GPP__IMSI__Unauthenticated__Flag()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__IMSI__Unauthenticated__Flag::DCA__3GPP__IMSI__Unauthenticated__Flag(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag::DCA__3GPP__IMSI__Unauthenticated__Flag(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag::DCA__3GPP__IMSI__Unauthenticated__Flag(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
enum_value = other_value.enum_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag& DCA__3GPP__IMSI__Unauthenticated__Flag::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag& DCA__3GPP__IMSI__Unauthenticated__Flag::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag& DCA__3GPP__IMSI__Unauthenticated__Flag::operator=(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value == other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator==(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value < other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator<(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value > other_value;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::operator>(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__IMSI__Unauthenticated__Flag::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case AUTHENTICATED: return "AUTHENTICATED";
case UNAUTHENTICATED: return "UNAUTHENTICATED";
default:
return "<unknown>";
}
}

DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type DCA__3GPP__IMSI__Unauthenticated__Flag::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "AUTHENTICATED")) return AUTHENTICATED;
if (!strcmp(str_par, "UNAUTHENTICATED")) return UNAUTHENTICATED;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__IMSI__Unauthenticated__Flag::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__IMSI__Unauthenticated__Flag::enum2int(const DCA__3GPP__IMSI__Unauthenticated__Flag& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__IMSI__Unauthenticated__Flag::operator DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return enum_value;
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
  }
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", enum_value);
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__IMSI__Unauthenticated__Flag::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__IMSI__Unauthenticated__Flag::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__IMSI__Unauthenticated__Flag::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::copy_template(const DCA__3GPP__IMSI__Unauthenticated__Flag_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__IMSI__Unauthenticated__Flag_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__IMSI__Unauthenticated__Flag_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__IMSI__Unauthenticated__Flag_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template()
{
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__IMSI__Unauthenticated__Flag::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type)other_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__IMSI__Unauthenticated__Flag::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
single_value = other_value.enum_value;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(const OPTIONAL<DCA__3GPP__IMSI__Unauthenticated__Flag>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type)(const DCA__3GPP__IMSI__Unauthenticated__Flag&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag from an unbound optional field.");
}
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(DCA__3GPP__IMSI__Unauthenticated__Flag_template* p_precondition, DCA__3GPP__IMSI__Unauthenticated__Flag_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(Dynamic_Match_Interface<DCA__3GPP__IMSI__Unauthenticated__Flag>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__IMSI__Unauthenticated__Flag>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::DCA__3GPP__IMSI__Unauthenticated__Flag_template(const DCA__3GPP__IMSI__Unauthenticated__Flag_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template::~DCA__3GPP__IMSI__Unauthenticated__Flag_template()
{
clean_up();
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__IMSI__Unauthenticated__Flag::UNBOUND_VALUE;
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(int other_value)
{
if (!DCA__3GPP__IMSI__Unauthenticated__Flag::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type)other_value;
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value)
{
if (other_value.enum_value == DCA__3GPP__IMSI__Unauthenticated__Flag::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(const OPTIONAL<DCA__3GPP__IMSI__Unauthenticated__Flag>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type)(const DCA__3GPP__IMSI__Unauthenticated__Flag&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
return *this;
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::operator=(const DCA__3GPP__IMSI__Unauthenticated__Flag_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::match(DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
return FALSE;
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::match(const DCA__3GPP__IMSI__Unauthenticated__Flag& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__IMSI__Unauthenticated__Flag::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type DCA__3GPP__IMSI__Unauthenticated__Flag_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return single_value;
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__IMSI__Unauthenticated__Flag_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
}

DCA__3GPP__IMSI__Unauthenticated__Flag_template& DCA__3GPP__IMSI__Unauthenticated__Flag_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
return value_list.list_value[list_index];
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__IMSI__Unauthenticated__Flag::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::log_match(const DCA__3GPP__IMSI__Unauthenticated__Flag& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__IMSI__Unauthenticated__Flag::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__IMSI__Unauthenticated__Flag_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
}
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__IMSI__Unauthenticated__Flag_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__IMSI__Unauthenticated__Flag_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__IMSI__Unauthenticated__Flag::enum_type enum_val = DCA__3GPP__IMSI__Unauthenticated__Flag::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__IMSI__Unauthenticated__Flag::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__IMSI__Unauthenticated__Flag_template* precondition = new DCA__3GPP__IMSI__Unauthenticated__Flag_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__IMSI__Unauthenticated__Flag_template* implied_template = new DCA__3GPP__IMSI__Unauthenticated__Flag_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__IMSI__Unauthenticated__Flag_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__IMSI__Unauthenticated__Flag_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_IMSI_Unauthenticated_Flag");
}

AAA__3GPP__AN__Trusted::AAA__3GPP__AN__Trusted()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__AN__Trusted::AAA__3GPP__AN__Trusted(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__AN__Trusted::AAA__3GPP__AN__Trusted(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__AN__Trusted::AAA__3GPP__AN__Trusted(const AAA__3GPP__AN__Trusted& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
enum_value = other_value.enum_value;
}

AAA__3GPP__AN__Trusted& AAA__3GPP__AN__Trusted::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__AN__Trusted& AAA__3GPP__AN__Trusted::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__AN__Trusted& AAA__3GPP__AN__Trusted::operator=(const AAA__3GPP__AN__Trusted& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__AN__Trusted::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__AN__Trusted::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value == other_value;
}

boolean AAA__3GPP__AN__Trusted::operator==(const AAA__3GPP__AN__Trusted& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__AN__Trusted::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__AN__Trusted::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value < other_value;
}

boolean AAA__3GPP__AN__Trusted::operator<(const AAA__3GPP__AN__Trusted& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__AN__Trusted::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__AN__Trusted::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value > other_value;
}

boolean AAA__3GPP__AN__Trusted::operator>(const AAA__3GPP__AN__Trusted& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__AN__Trusted::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case TRUSTED: return "TRUSTED";
case UNTRUSTED: return "UNTRUSTED";
default:
return "<unknown>";
}
}

AAA__3GPP__AN__Trusted::enum_type AAA__3GPP__AN__Trusted::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "TRUSTED")) return TRUSTED;
if (!strcmp(str_par, "UNTRUSTED")) return UNTRUSTED;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__AN__Trusted::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__AN__Trusted::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__AN__Trusted::enum2int(const AAA__3GPP__AN__Trusted& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__AN__Trusted::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__AN__Trusted::operator AAA__3GPP__AN__Trusted::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return enum_value;
}

void AAA__3GPP__AN__Trusted::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__AN__Trusted::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_AN_Trusted");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
  }
}

void AAA__3GPP__AN__Trusted::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__AN__Trusted::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", enum_value);
}

void AAA__3GPP__AN__Trusted::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__AN__Trusted::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__AN__Trusted::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__AN__Trusted::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__AN__Trusted_template::copy_template(const AAA__3GPP__AN__Trusted_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__AN__Trusted_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__AN__Trusted_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__AN__Trusted_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template()
{
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__AN__Trusted::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__AN__Trusted::enum_type)other_value;
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(AAA__3GPP__AN__Trusted::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(const AAA__3GPP__AN__Trusted& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__AN__Trusted::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
single_value = other_value.enum_value;
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(const OPTIONAL<AAA__3GPP__AN__Trusted>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__AN__Trusted::enum_type)(const AAA__3GPP__AN__Trusted&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted from an unbound optional field.");
}
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(AAA__3GPP__AN__Trusted_template* p_precondition, AAA__3GPP__AN__Trusted_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(Dynamic_Match_Interface<AAA__3GPP__AN__Trusted>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__AN__Trusted>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__AN__Trusted_template::AAA__3GPP__AN__Trusted_template(const AAA__3GPP__AN__Trusted_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__AN__Trusted_template::~AAA__3GPP__AN__Trusted_template()
{
clean_up();
}

boolean AAA__3GPP__AN__Trusted_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__AN__Trusted_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__AN__Trusted::UNBOUND_VALUE;
}

void AAA__3GPP__AN__Trusted_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(int other_value)
{
if (!AAA__3GPP__AN__Trusted::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__AN__Trusted::enum_type)other_value;
return *this;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(AAA__3GPP__AN__Trusted::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(const AAA__3GPP__AN__Trusted& other_value)
{
if (other_value.enum_value == AAA__3GPP__AN__Trusted::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(const OPTIONAL<AAA__3GPP__AN__Trusted>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__AN__Trusted::enum_type)(const AAA__3GPP__AN__Trusted&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
return *this;
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::operator=(const AAA__3GPP__AN__Trusted_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__AN__Trusted_template::match(AAA__3GPP__AN__Trusted::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
return FALSE;
}

boolean AAA__3GPP__AN__Trusted_template::match(const AAA__3GPP__AN__Trusted& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__AN__Trusted::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__AN__Trusted::enum_type AAA__3GPP__AN__Trusted_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return single_value;
}

void AAA__3GPP__AN__Trusted_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__AN__Trusted_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
}

AAA__3GPP__AN__Trusted_template& AAA__3GPP__AN__Trusted_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
return value_list.list_value[list_index];
}

void AAA__3GPP__AN__Trusted_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__AN__Trusted::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__AN__Trusted_template::log_match(const AAA__3GPP__AN__Trusted& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__AN__Trusted_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
}

void AAA__3GPP__AN__Trusted_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__AN__Trusted::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__AN__Trusted::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__AN__Trusted_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
}
}

boolean AAA__3GPP__AN__Trusted_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__AN__Trusted_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__AN__Trusted_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__AN__Trusted_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__AN__Trusted::enum_type enum_val = AAA__3GPP__AN__Trusted::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__AN__Trusted::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_AN_Trusted.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__AN__Trusted_template* precondition = new AAA__3GPP__AN__Trusted_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__AN__Trusted_template* implied_template = new AAA__3GPP__AN__Trusted_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__AN__Trusted_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_AN_Trusted");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__AN__Trusted_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_AN_Trusted");
}

DCA__3GPP__Monitoring__Event__Funtionality::DCA__3GPP__Monitoring__Event__Funtionality()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Monitoring__Event__Funtionality::DCA__3GPP__Monitoring__Event__Funtionality(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Monitoring__Event__Funtionality::DCA__3GPP__Monitoring__Event__Funtionality(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Monitoring__Event__Funtionality::DCA__3GPP__Monitoring__Event__Funtionality(const DCA__3GPP__Monitoring__Event__Funtionality& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Monitoring__Event__Funtionality& DCA__3GPP__Monitoring__Event__Funtionality::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality& DCA__3GPP__Monitoring__Event__Funtionality::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality& DCA__3GPP__Monitoring__Event__Funtionality::operator=(const DCA__3GPP__Monitoring__Event__Funtionality& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value == other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator==(const DCA__3GPP__Monitoring__Event__Funtionality& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value < other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator<(const DCA__3GPP__Monitoring__Event__Funtionality& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value > other_value;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::operator>(const DCA__3GPP__Monitoring__Event__Funtionality& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Monitoring__Event__Funtionality::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CONFIGURATION: return "CONFIGURATION";
case REPORTING: return "REPORTING";
default:
return "<unknown>";
}
}

DCA__3GPP__Monitoring__Event__Funtionality::enum_type DCA__3GPP__Monitoring__Event__Funtionality::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CONFIGURATION")) return CONFIGURATION;
if (!strcmp(str_par, "REPORTING")) return REPORTING;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Monitoring__Event__Funtionality::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Monitoring__Event__Funtionality::enum2int(const DCA__3GPP__Monitoring__Event__Funtionality& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Monitoring__Event__Funtionality::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Monitoring__Event__Funtionality::operator DCA__3GPP__Monitoring__Event__Funtionality::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return enum_value;
}

void DCA__3GPP__Monitoring__Event__Funtionality::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Monitoring__Event__Funtionality::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
  }
}

void DCA__3GPP__Monitoring__Event__Funtionality::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Monitoring__Event__Funtionality::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", enum_value);
}

void DCA__3GPP__Monitoring__Event__Funtionality::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Monitoring__Event__Funtionality::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Monitoring__Event__Funtionality::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Monitoring__Event__Funtionality::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::copy_template(const DCA__3GPP__Monitoring__Event__Funtionality_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Monitoring__Event__Funtionality_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Monitoring__Event__Funtionality_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Monitoring__Event__Funtionality_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template()
{
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Monitoring__Event__Funtionality::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Monitoring__Event__Funtionality::enum_type)other_value;
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(DCA__3GPP__Monitoring__Event__Funtionality::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(const DCA__3GPP__Monitoring__Event__Funtionality& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Funtionality::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
single_value = other_value.enum_value;
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(const OPTIONAL<DCA__3GPP__Monitoring__Event__Funtionality>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Funtionality::enum_type)(const DCA__3GPP__Monitoring__Event__Funtionality&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality from an unbound optional field.");
}
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(DCA__3GPP__Monitoring__Event__Funtionality_template* p_precondition, DCA__3GPP__Monitoring__Event__Funtionality_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(Dynamic_Match_Interface<DCA__3GPP__Monitoring__Event__Funtionality>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Monitoring__Event__Funtionality>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Monitoring__Event__Funtionality_template::DCA__3GPP__Monitoring__Event__Funtionality_template(const DCA__3GPP__Monitoring__Event__Funtionality_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Monitoring__Event__Funtionality_template::~DCA__3GPP__Monitoring__Event__Funtionality_template()
{
clean_up();
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Monitoring__Event__Funtionality::UNBOUND_VALUE;
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(int other_value)
{
if (!DCA__3GPP__Monitoring__Event__Funtionality::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Funtionality::enum_type)other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(DCA__3GPP__Monitoring__Event__Funtionality::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(const DCA__3GPP__Monitoring__Event__Funtionality& other_value)
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Funtionality::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(const OPTIONAL<DCA__3GPP__Monitoring__Event__Funtionality>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Monitoring__Event__Funtionality::enum_type)(const DCA__3GPP__Monitoring__Event__Funtionality&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
return *this;
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::operator=(const DCA__3GPP__Monitoring__Event__Funtionality_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::match(DCA__3GPP__Monitoring__Event__Funtionality::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
return FALSE;
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::match(const DCA__3GPP__Monitoring__Event__Funtionality& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Monitoring__Event__Funtionality::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Monitoring__Event__Funtionality::enum_type DCA__3GPP__Monitoring__Event__Funtionality_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return single_value;
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Monitoring__Event__Funtionality_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
}

DCA__3GPP__Monitoring__Event__Funtionality_template& DCA__3GPP__Monitoring__Event__Funtionality_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Monitoring__Event__Funtionality::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::log_match(const DCA__3GPP__Monitoring__Event__Funtionality& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Monitoring__Event__Funtionality::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Monitoring__Event__Funtionality::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Monitoring__Event__Funtionality_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
}
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Monitoring__Event__Funtionality_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Monitoring__Event__Funtionality_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Monitoring__Event__Funtionality::enum_type enum_val = DCA__3GPP__Monitoring__Event__Funtionality::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Monitoring__Event__Funtionality::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Monitoring__Event__Funtionality_template* precondition = new DCA__3GPP__Monitoring__Event__Funtionality_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Monitoring__Event__Funtionality_template* implied_template = new DCA__3GPP__Monitoring__Event__Funtionality_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Monitoring__Event__Funtionality_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Monitoring__Event__Funtionality_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Monitoring_Event_Funtionality");
}

RX__3GPP__Rx__Request__Type::RX__3GPP__Rx__Request__Type()
{
enum_value = UNBOUND_VALUE;
}

RX__3GPP__Rx__Request__Type::RX__3GPP__Rx__Request__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

RX__3GPP__Rx__Request__Type::RX__3GPP__Rx__Request__Type(enum_type other_value)
{
enum_value = other_value;
}

RX__3GPP__Rx__Request__Type::RX__3GPP__Rx__Request__Type(const RX__3GPP__Rx__Request__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
enum_value = other_value.enum_value;
}

RX__3GPP__Rx__Request__Type& RX__3GPP__Rx__Request__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

RX__3GPP__Rx__Request__Type& RX__3GPP__Rx__Request__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

RX__3GPP__Rx__Request__Type& RX__3GPP__Rx__Request__Type::operator=(const RX__3GPP__Rx__Request__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean RX__3GPP__Rx__Request__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value == other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator==(const RX__3GPP__Rx__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value == other_value.enum_value;
}

boolean RX__3GPP__Rx__Request__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value < other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator<(const RX__3GPP__Rx__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value < other_value.enum_value;
}

boolean RX__3GPP__Rx__Request__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value > other_value;
}

boolean RX__3GPP__Rx__Request__Type::operator>(const RX__3GPP__Rx__Request__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value > other_value.enum_value;
}

const char *RX__3GPP__Rx__Request__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case INITIAL__REQUEST: return "INITIAL_REQUEST";
case UPDATE__REQUEST: return "UPDATE_REQUEST";
case PCSCF__RESTORATION: return "PCSCF_RESTORATION";
default:
return "<unknown>";
}
}

RX__3GPP__Rx__Request__Type::enum_type RX__3GPP__Rx__Request__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "INITIAL_REQUEST")) return INITIAL__REQUEST;
if (!strcmp(str_par, "UPDATE_REQUEST")) return UPDATE__REQUEST;
if (!strcmp(str_par, "PCSCF_RESTORATION")) return PCSCF__RESTORATION;
}
return UNKNOWN_VALUE;
}

boolean RX__3GPP__Rx__Request__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int RX__3GPP__Rx__Request__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RX__3GPP__Rx__Request__Type::enum2int(const RX__3GPP__Rx__Request__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void RX__3GPP__Rx__Request__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", int_val);
enum_value = (enum_type)int_val;
}

RX__3GPP__Rx__Request__Type::operator RX__3GPP__Rx__Request__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return enum_value;
}

void RX__3GPP__Rx__Request__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void RX__3GPP__Rx__Request__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.RX_3GPP_Rx_Request_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
  }
}

void RX__3GPP__Rx__Request__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
text_buf.push_int(enum_value);
}

void RX__3GPP__Rx__Request__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", enum_value);
}

void RX__3GPP__Rx__Request__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RX__3GPP__Rx__Request__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RX__3GPP__Rx__Request__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RX__3GPP__Rx__Request__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void RX__3GPP__Rx__Request__Type_template::copy_template(const RX__3GPP__Rx__Request__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RX__3GPP__Rx__Request__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RX__3GPP__Rx__Request__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new RX__3GPP__Rx__Request__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template()
{
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!RX__3GPP__Rx__Request__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type with unknown numeric value %d.", other_value);
single_value = (RX__3GPP__Rx__Request__Type::enum_type)other_value;
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(RX__3GPP__Rx__Request__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(const RX__3GPP__Rx__Request__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RX__3GPP__Rx__Request__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
single_value = other_value.enum_value;
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(const OPTIONAL<RX__3GPP__Rx__Request__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Rx__Request__Type::enum_type)(const RX__3GPP__Rx__Request__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type from an unbound optional field.");
}
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(RX__3GPP__Rx__Request__Type_template* p_precondition, RX__3GPP__Rx__Request__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(Dynamic_Match_Interface<RX__3GPP__Rx__Request__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RX__3GPP__Rx__Request__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RX__3GPP__Rx__Request__Type_template::RX__3GPP__Rx__Request__Type_template(const RX__3GPP__Rx__Request__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

RX__3GPP__Rx__Request__Type_template::~RX__3GPP__Rx__Request__Type_template()
{
clean_up();
}

boolean RX__3GPP__Rx__Request__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean RX__3GPP__Rx__Request__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != RX__3GPP__Rx__Request__Type::UNBOUND_VALUE;
}

void RX__3GPP__Rx__Request__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(int other_value)
{
if (!RX__3GPP__Rx__Request__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Rx__Request__Type::enum_type)other_value;
return *this;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(RX__3GPP__Rx__Request__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(const RX__3GPP__Rx__Request__Type& other_value)
{
if (other_value.enum_value == RX__3GPP__Rx__Request__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(const OPTIONAL<RX__3GPP__Rx__Request__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Rx__Request__Type::enum_type)(const RX__3GPP__Rx__Request__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
return *this;
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::operator=(const RX__3GPP__Rx__Request__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RX__3GPP__Rx__Request__Type_template::match(RX__3GPP__Rx__Request__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
return FALSE;
}

boolean RX__3GPP__Rx__Request__Type_template::match(const RX__3GPP__Rx__Request__Type& other_value, boolean) const
{
if (other_value.enum_value == RX__3GPP__Rx__Request__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type with an unbound value.");
return match(other_value.enum_value);
}

RX__3GPP__Rx__Request__Type::enum_type RX__3GPP__Rx__Request__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return single_value;
}

void RX__3GPP__Rx__Request__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RX__3GPP__Rx__Request__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
}

RX__3GPP__Rx__Request__Type_template& RX__3GPP__Rx__Request__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
return value_list.list_value[list_index];
}

void RX__3GPP__Rx__Request__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RX__3GPP__Rx__Request__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RX__3GPP__Rx__Request__Type_template::log_match(const RX__3GPP__Rx__Request__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void RX__3GPP__Rx__Request__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
}

void RX__3GPP__Rx__Request__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RX__3GPP__Rx__Request__Type::enum_type)text_buf.pull_int().get_val();
if (!RX__3GPP__Rx__Request__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RX__3GPP__Rx__Request__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
}
}

boolean RX__3GPP__Rx__Request__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RX__3GPP__Rx__Request__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void RX__3GPP__Rx__Request__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RX__3GPP__Rx__Request__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    RX__3GPP__Rx__Request__Type::enum_type enum_val = RX__3GPP__Rx__Request__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RX__3GPP__Rx__Request__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_Rx_Request_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RX__3GPP__Rx__Request__Type_template* precondition = new RX__3GPP__Rx__Request__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    RX__3GPP__Rx__Request__Type_template* implied_template = new RX__3GPP__Rx__Request__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RX__3GPP__Rx__Request__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.RX_3GPP_Rx_Request_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void RX__3GPP__Rx__Request__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.RX_3GPP_Rx_Request_Type");
}

AAA__3GPP__Transport__Access__Type::AAA__3GPP__Transport__Access__Type()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Transport__Access__Type::AAA__3GPP__Transport__Access__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Transport__Access__Type::AAA__3GPP__Transport__Access__Type(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Transport__Access__Type::AAA__3GPP__Transport__Access__Type(const AAA__3GPP__Transport__Access__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Transport__Access__Type& AAA__3GPP__Transport__Access__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Transport__Access__Type& AAA__3GPP__Transport__Access__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Transport__Access__Type& AAA__3GPP__Transport__Access__Type::operator=(const AAA__3GPP__Transport__Access__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Transport__Access__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value == other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator==(const AAA__3GPP__Transport__Access__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value < other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator<(const AAA__3GPP__Transport__Access__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value > other_value;
}

boolean AAA__3GPP__Transport__Access__Type::operator>(const AAA__3GPP__Transport__Access__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Transport__Access__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case BBF: return "BBF";
default:
return "<unknown>";
}
}

AAA__3GPP__Transport__Access__Type::enum_type AAA__3GPP__Transport__Access__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "BBF")) return BBF;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Transport__Access__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Transport__Access__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Transport__Access__Type::enum2int(const AAA__3GPP__Transport__Access__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Transport__Access__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Transport__Access__Type::operator AAA__3GPP__Transport__Access__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return enum_value;
}

void AAA__3GPP__Transport__Access__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Transport__Access__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Transport_Access_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
  }
}

void AAA__3GPP__Transport__Access__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Transport__Access__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", enum_value);
}

void AAA__3GPP__Transport__Access__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Transport__Access__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Transport__Access__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Transport__Access__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void AAA__3GPP__Transport__Access__Type_template::copy_template(const AAA__3GPP__Transport__Access__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Transport__Access__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Transport__Access__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Transport__Access__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template()
{
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Transport__Access__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Transport__Access__Type::enum_type)other_value;
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(AAA__3GPP__Transport__Access__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(const AAA__3GPP__Transport__Access__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Transport__Access__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
single_value = other_value.enum_value;
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(const OPTIONAL<AAA__3GPP__Transport__Access__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Transport__Access__Type::enum_type)(const AAA__3GPP__Transport__Access__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type from an unbound optional field.");
}
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(AAA__3GPP__Transport__Access__Type_template* p_precondition, AAA__3GPP__Transport__Access__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(Dynamic_Match_Interface<AAA__3GPP__Transport__Access__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Transport__Access__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Transport__Access__Type_template::AAA__3GPP__Transport__Access__Type_template(const AAA__3GPP__Transport__Access__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Transport__Access__Type_template::~AAA__3GPP__Transport__Access__Type_template()
{
clean_up();
}

boolean AAA__3GPP__Transport__Access__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Transport__Access__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Transport__Access__Type::UNBOUND_VALUE;
}

void AAA__3GPP__Transport__Access__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(int other_value)
{
if (!AAA__3GPP__Transport__Access__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Transport__Access__Type::enum_type)other_value;
return *this;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(AAA__3GPP__Transport__Access__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(const AAA__3GPP__Transport__Access__Type& other_value)
{
if (other_value.enum_value == AAA__3GPP__Transport__Access__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(const OPTIONAL<AAA__3GPP__Transport__Access__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Transport__Access__Type::enum_type)(const AAA__3GPP__Transport__Access__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
return *this;
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::operator=(const AAA__3GPP__Transport__Access__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Transport__Access__Type_template::match(AAA__3GPP__Transport__Access__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
return FALSE;
}

boolean AAA__3GPP__Transport__Access__Type_template::match(const AAA__3GPP__Transport__Access__Type& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Transport__Access__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Transport__Access__Type::enum_type AAA__3GPP__Transport__Access__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return single_value;
}

void AAA__3GPP__Transport__Access__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Transport__Access__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
}

AAA__3GPP__Transport__Access__Type_template& AAA__3GPP__Transport__Access__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Transport__Access__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Transport__Access__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Transport__Access__Type_template::log_match(const AAA__3GPP__Transport__Access__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Transport__Access__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
}

void AAA__3GPP__Transport__Access__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Transport__Access__Type::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Transport__Access__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Transport__Access__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
}
}

boolean AAA__3GPP__Transport__Access__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Transport__Access__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Transport__Access__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Transport__Access__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Transport__Access__Type::enum_type enum_val = AAA__3GPP__Transport__Access__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Transport__Access__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Transport_Access_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Transport__Access__Type_template* precondition = new AAA__3GPP__Transport__Access__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Transport__Access__Type_template* implied_template = new AAA__3GPP__Transport__Access__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Transport__Access__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Transport_Access_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Transport__Access__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Transport_Access_Type");
}

PCC__3GPP__Usage__Monitoring__Level::PCC__3GPP__Usage__Monitoring__Level()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Usage__Monitoring__Level::PCC__3GPP__Usage__Monitoring__Level(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Usage__Monitoring__Level::PCC__3GPP__Usage__Monitoring__Level(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Usage__Monitoring__Level::PCC__3GPP__Usage__Monitoring__Level(const PCC__3GPP__Usage__Monitoring__Level& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Usage__Monitoring__Level& PCC__3GPP__Usage__Monitoring__Level::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Level& PCC__3GPP__Usage__Monitoring__Level::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Level& PCC__3GPP__Usage__Monitoring__Level::operator=(const PCC__3GPP__Usage__Monitoring__Level& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value == other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator==(const PCC__3GPP__Usage__Monitoring__Level& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value < other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator<(const PCC__3GPP__Usage__Monitoring__Level& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value > other_value;
}

boolean PCC__3GPP__Usage__Monitoring__Level::operator>(const PCC__3GPP__Usage__Monitoring__Level& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Usage__Monitoring__Level::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SESSION__LEVEL: return "SESSION_LEVEL";
case PCC__RULE__LEVEL: return "PCC_RULE_LEVEL";
case ADC__RULE__LEVEL: return "ADC_RULE_LEVEL";
default:
return "<unknown>";
}
}

PCC__3GPP__Usage__Monitoring__Level::enum_type PCC__3GPP__Usage__Monitoring__Level::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SESSION_LEVEL")) return SESSION__LEVEL;
if (!strcmp(str_par, "PCC_RULE_LEVEL")) return PCC__RULE__LEVEL;
if (!strcmp(str_par, "ADC_RULE_LEVEL")) return ADC__RULE__LEVEL;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Usage__Monitoring__Level::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Usage__Monitoring__Level::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Usage__Monitoring__Level::enum2int(const PCC__3GPP__Usage__Monitoring__Level& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Usage__Monitoring__Level::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Usage__Monitoring__Level::operator PCC__3GPP__Usage__Monitoring__Level::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return enum_value;
}

void PCC__3GPP__Usage__Monitoring__Level::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Usage__Monitoring__Level::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
  }
}

void PCC__3GPP__Usage__Monitoring__Level::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Usage__Monitoring__Level::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", enum_value);
}

void PCC__3GPP__Usage__Monitoring__Level::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Usage__Monitoring__Level::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Usage__Monitoring__Level::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Usage__Monitoring__Level::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void PCC__3GPP__Usage__Monitoring__Level_template::copy_template(const PCC__3GPP__Usage__Monitoring__Level_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Level_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Usage__Monitoring__Level_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Usage__Monitoring__Level_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template()
{
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Usage__Monitoring__Level::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Usage__Monitoring__Level::enum_type)other_value;
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(PCC__3GPP__Usage__Monitoring__Level::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(const PCC__3GPP__Usage__Monitoring__Level& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Level::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
single_value = other_value.enum_value;
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(const OPTIONAL<PCC__3GPP__Usage__Monitoring__Level>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Level::enum_type)(const PCC__3GPP__Usage__Monitoring__Level&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level from an unbound optional field.");
}
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(PCC__3GPP__Usage__Monitoring__Level_template* p_precondition, PCC__3GPP__Usage__Monitoring__Level_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(Dynamic_Match_Interface<PCC__3GPP__Usage__Monitoring__Level>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Usage__Monitoring__Level>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Usage__Monitoring__Level_template::PCC__3GPP__Usage__Monitoring__Level_template(const PCC__3GPP__Usage__Monitoring__Level_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Usage__Monitoring__Level_template::~PCC__3GPP__Usage__Monitoring__Level_template()
{
clean_up();
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Usage__Monitoring__Level::UNBOUND_VALUE;
}

void PCC__3GPP__Usage__Monitoring__Level_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(int other_value)
{
if (!PCC__3GPP__Usage__Monitoring__Level::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Level::enum_type)other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(PCC__3GPP__Usage__Monitoring__Level::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(const PCC__3GPP__Usage__Monitoring__Level& other_value)
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Level::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(const OPTIONAL<PCC__3GPP__Usage__Monitoring__Level>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Usage__Monitoring__Level::enum_type)(const PCC__3GPP__Usage__Monitoring__Level&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
return *this;
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::operator=(const PCC__3GPP__Usage__Monitoring__Level_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::match(PCC__3GPP__Usage__Monitoring__Level::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
return FALSE;
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::match(const PCC__3GPP__Usage__Monitoring__Level& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Usage__Monitoring__Level::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Usage__Monitoring__Level::enum_type PCC__3GPP__Usage__Monitoring__Level_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return single_value;
}

void PCC__3GPP__Usage__Monitoring__Level_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Level_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
}

PCC__3GPP__Usage__Monitoring__Level_template& PCC__3GPP__Usage__Monitoring__Level_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Usage__Monitoring__Level_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Usage__Monitoring__Level::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Usage__Monitoring__Level_template::log_match(const PCC__3GPP__Usage__Monitoring__Level& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Usage__Monitoring__Level_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
}

void PCC__3GPP__Usage__Monitoring__Level_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Usage__Monitoring__Level::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Usage__Monitoring__Level::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Usage__Monitoring__Level_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
}
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Usage__Monitoring__Level_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Usage__Monitoring__Level_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Usage__Monitoring__Level_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Usage__Monitoring__Level::enum_type enum_val = PCC__3GPP__Usage__Monitoring__Level::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Usage__Monitoring__Level::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Usage__Monitoring__Level_template* precondition = new PCC__3GPP__Usage__Monitoring__Level_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Usage__Monitoring__Level_template* implied_template = new PCC__3GPP__Usage__Monitoring__Level_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Usage__Monitoring__Level_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Usage__Monitoring__Level_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Usage_Monitoring_Level");
}

AAA__3GPP__Collection__Period__RRM__LTE::AAA__3GPP__Collection__Period__RRM__LTE()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Collection__Period__RRM__LTE::AAA__3GPP__Collection__Period__RRM__LTE(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Collection__Period__RRM__LTE::AAA__3GPP__Collection__Period__RRM__LTE(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Collection__Period__RRM__LTE::AAA__3GPP__Collection__Period__RRM__LTE(const AAA__3GPP__Collection__Period__RRM__LTE& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Collection__Period__RRM__LTE& AAA__3GPP__Collection__Period__RRM__LTE::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE& AAA__3GPP__Collection__Period__RRM__LTE::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE& AAA__3GPP__Collection__Period__RRM__LTE::operator=(const AAA__3GPP__Collection__Period__RRM__LTE& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value == other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator==(const AAA__3GPP__Collection__Period__RRM__LTE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value < other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator<(const AAA__3GPP__Collection__Period__RRM__LTE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value > other_value;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::operator>(const AAA__3GPP__Collection__Period__RRM__LTE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Collection__Period__RRM__LTE::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PERIOD__1024__ms: return "PERIOD_1024_ms";
case PERIOD__1280__ms: return "PERIOD_1280_ms";
case PERIOD__2048__ms: return "PERIOD_2048_ms";
case PERIOD__2560__ms: return "PERIOD_2560_ms";
case PERIOD__5120__ms: return "PERIOD_5120_ms";
case PERIOD__10240__ms: return "PERIOD_10240_ms";
case PERIOD__1__min: return "PERIOD_1_min";
default:
return "<unknown>";
}
}

AAA__3GPP__Collection__Period__RRM__LTE::enum_type AAA__3GPP__Collection__Period__RRM__LTE::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PERIOD_1024_ms")) return PERIOD__1024__ms;
if (!strcmp(str_par, "PERIOD_1280_ms")) return PERIOD__1280__ms;
if (!strcmp(str_par, "PERIOD_2048_ms")) return PERIOD__2048__ms;
if (!strcmp(str_par, "PERIOD_2560_ms")) return PERIOD__2560__ms;
if (!strcmp(str_par, "PERIOD_5120_ms")) return PERIOD__5120__ms;
if (!strcmp(str_par, "PERIOD_10240_ms")) return PERIOD__10240__ms;
if (!strcmp(str_par, "PERIOD_1_min")) return PERIOD__1__min;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Collection__Period__RRM__LTE::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Collection__Period__RRM__LTE::enum2int(const AAA__3GPP__Collection__Period__RRM__LTE& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Collection__Period__RRM__LTE::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Collection__Period__RRM__LTE::operator AAA__3GPP__Collection__Period__RRM__LTE::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return enum_value;
}

void AAA__3GPP__Collection__Period__RRM__LTE::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Collection__Period__RRM__LTE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
  }
}

void AAA__3GPP__Collection__Period__RRM__LTE::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Collection__Period__RRM__LTE::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", enum_value);
}

void AAA__3GPP__Collection__Period__RRM__LTE::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Collection__Period__RRM__LTE::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Collection__Period__RRM__LTE::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Collection__Period__RRM__LTE::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::copy_template(const AAA__3GPP__Collection__Period__RRM__LTE_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Collection__Period__RRM__LTE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Collection__Period__RRM__LTE_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Collection__Period__RRM__LTE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template()
{
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Collection__Period__RRM__LTE::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Collection__Period__RRM__LTE::enum_type)other_value;
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(AAA__3GPP__Collection__Period__RRM__LTE::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(const AAA__3GPP__Collection__Period__RRM__LTE& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Collection__Period__RRM__LTE::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
single_value = other_value.enum_value;
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(const OPTIONAL<AAA__3GPP__Collection__Period__RRM__LTE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Collection__Period__RRM__LTE::enum_type)(const AAA__3GPP__Collection__Period__RRM__LTE&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE from an unbound optional field.");
}
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(AAA__3GPP__Collection__Period__RRM__LTE_template* p_precondition, AAA__3GPP__Collection__Period__RRM__LTE_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(Dynamic_Match_Interface<AAA__3GPP__Collection__Period__RRM__LTE>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Collection__Period__RRM__LTE>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Collection__Period__RRM__LTE_template::AAA__3GPP__Collection__Period__RRM__LTE_template(const AAA__3GPP__Collection__Period__RRM__LTE_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Collection__Period__RRM__LTE_template::~AAA__3GPP__Collection__Period__RRM__LTE_template()
{
clean_up();
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Collection__Period__RRM__LTE::UNBOUND_VALUE;
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(int other_value)
{
if (!AAA__3GPP__Collection__Period__RRM__LTE::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Collection__Period__RRM__LTE::enum_type)other_value;
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(AAA__3GPP__Collection__Period__RRM__LTE::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(const AAA__3GPP__Collection__Period__RRM__LTE& other_value)
{
if (other_value.enum_value == AAA__3GPP__Collection__Period__RRM__LTE::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(const OPTIONAL<AAA__3GPP__Collection__Period__RRM__LTE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Collection__Period__RRM__LTE::enum_type)(const AAA__3GPP__Collection__Period__RRM__LTE&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
return *this;
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::operator=(const AAA__3GPP__Collection__Period__RRM__LTE_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::match(AAA__3GPP__Collection__Period__RRM__LTE::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
return FALSE;
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::match(const AAA__3GPP__Collection__Period__RRM__LTE& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Collection__Period__RRM__LTE::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Collection__Period__RRM__LTE::enum_type AAA__3GPP__Collection__Period__RRM__LTE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return single_value;
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Collection__Period__RRM__LTE_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
}

AAA__3GPP__Collection__Period__RRM__LTE_template& AAA__3GPP__Collection__Period__RRM__LTE_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Collection__Period__RRM__LTE::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::log_match(const AAA__3GPP__Collection__Period__RRM__LTE& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Collection__Period__RRM__LTE::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Collection__Period__RRM__LTE::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Collection__Period__RRM__LTE_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
}
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Collection__Period__RRM__LTE_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Collection__Period__RRM__LTE_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Collection__Period__RRM__LTE::enum_type enum_val = AAA__3GPP__Collection__Period__RRM__LTE::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Collection__Period__RRM__LTE::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Collection__Period__RRM__LTE_template* precondition = new AAA__3GPP__Collection__Period__RRM__LTE_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Collection__Period__RRM__LTE_template* implied_template = new AAA__3GPP__Collection__Period__RRM__LTE_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Collection__Period__RRM__LTE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Collection__Period__RRM__LTE_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Collection_Period_RRM_LTE");
}

AAA__3GPP__Subscriber__Status::AAA__3GPP__Subscriber__Status()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Subscriber__Status::AAA__3GPP__Subscriber__Status(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Subscriber__Status::AAA__3GPP__Subscriber__Status(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Subscriber__Status::AAA__3GPP__Subscriber__Status(const AAA__3GPP__Subscriber__Status& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Subscriber__Status& AAA__3GPP__Subscriber__Status::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Subscriber__Status& AAA__3GPP__Subscriber__Status::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Subscriber__Status& AAA__3GPP__Subscriber__Status::operator=(const AAA__3GPP__Subscriber__Status& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Subscriber__Status::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value == other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator==(const AAA__3GPP__Subscriber__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Subscriber__Status::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value < other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator<(const AAA__3GPP__Subscriber__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Subscriber__Status::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value > other_value;
}

boolean AAA__3GPP__Subscriber__Status::operator>(const AAA__3GPP__Subscriber__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Subscriber__Status::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SERVICE__GRANTED: return "SERVICE_GRANTED";
case OPERATOR__DETERMINED__BARRING: return "OPERATOR_DETERMINED_BARRING";
default:
return "<unknown>";
}
}

AAA__3GPP__Subscriber__Status::enum_type AAA__3GPP__Subscriber__Status::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SERVICE_GRANTED")) return SERVICE__GRANTED;
if (!strcmp(str_par, "OPERATOR_DETERMINED_BARRING")) return OPERATOR__DETERMINED__BARRING;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Subscriber__Status::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Subscriber__Status::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Subscriber__Status::enum2int(const AAA__3GPP__Subscriber__Status& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Subscriber__Status::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Subscriber__Status::operator AAA__3GPP__Subscriber__Status::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return enum_value;
}

void AAA__3GPP__Subscriber__Status::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Subscriber__Status::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Subscriber_Status");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
  }
}

void AAA__3GPP__Subscriber__Status::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Subscriber__Status::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", enum_value);
}

void AAA__3GPP__Subscriber__Status::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Subscriber__Status::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Subscriber__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Subscriber__Status::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__Subscriber__Status_template::copy_template(const AAA__3GPP__Subscriber__Status_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Subscriber__Status_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Subscriber__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Subscriber__Status_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template()
{
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Subscriber__Status::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Subscriber__Status::enum_type)other_value;
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(AAA__3GPP__Subscriber__Status::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(const AAA__3GPP__Subscriber__Status& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Subscriber__Status::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
single_value = other_value.enum_value;
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(const OPTIONAL<AAA__3GPP__Subscriber__Status>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Subscriber__Status::enum_type)(const AAA__3GPP__Subscriber__Status&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status from an unbound optional field.");
}
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(AAA__3GPP__Subscriber__Status_template* p_precondition, AAA__3GPP__Subscriber__Status_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(Dynamic_Match_Interface<AAA__3GPP__Subscriber__Status>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Subscriber__Status>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Subscriber__Status_template::AAA__3GPP__Subscriber__Status_template(const AAA__3GPP__Subscriber__Status_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Subscriber__Status_template::~AAA__3GPP__Subscriber__Status_template()
{
clean_up();
}

boolean AAA__3GPP__Subscriber__Status_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Subscriber__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Subscriber__Status::UNBOUND_VALUE;
}

void AAA__3GPP__Subscriber__Status_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(int other_value)
{
if (!AAA__3GPP__Subscriber__Status::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Subscriber__Status::enum_type)other_value;
return *this;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(AAA__3GPP__Subscriber__Status::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(const AAA__3GPP__Subscriber__Status& other_value)
{
if (other_value.enum_value == AAA__3GPP__Subscriber__Status::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(const OPTIONAL<AAA__3GPP__Subscriber__Status>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Subscriber__Status::enum_type)(const AAA__3GPP__Subscriber__Status&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
return *this;
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::operator=(const AAA__3GPP__Subscriber__Status_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Subscriber__Status_template::match(AAA__3GPP__Subscriber__Status::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
return FALSE;
}

boolean AAA__3GPP__Subscriber__Status_template::match(const AAA__3GPP__Subscriber__Status& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Subscriber__Status::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Subscriber__Status::enum_type AAA__3GPP__Subscriber__Status_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return single_value;
}

void AAA__3GPP__Subscriber__Status_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Subscriber__Status_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
}

AAA__3GPP__Subscriber__Status_template& AAA__3GPP__Subscriber__Status_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Subscriber__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Subscriber__Status::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Subscriber__Status_template::log_match(const AAA__3GPP__Subscriber__Status& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Subscriber__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
}

void AAA__3GPP__Subscriber__Status_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Subscriber__Status::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Subscriber__Status::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Subscriber__Status_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
}
}

boolean AAA__3GPP__Subscriber__Status_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Subscriber__Status_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Subscriber__Status_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Subscriber__Status_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Subscriber__Status::enum_type enum_val = AAA__3GPP__Subscriber__Status::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Subscriber__Status::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Subscriber_Status.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Subscriber__Status_template* precondition = new AAA__3GPP__Subscriber__Status_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Subscriber__Status_template* implied_template = new AAA__3GPP__Subscriber__Status_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Subscriber__Status_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Subscriber_Status");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Subscriber__Status_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Subscriber_Status");
}

DCC__NONE__Tariff__Change__Usage::DCC__NONE__Tariff__Change__Usage()
{
enum_value = UNBOUND_VALUE;
}

DCC__NONE__Tariff__Change__Usage::DCC__NONE__Tariff__Change__Usage(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCC__NONE__Tariff__Change__Usage::DCC__NONE__Tariff__Change__Usage(enum_type other_value)
{
enum_value = other_value;
}

DCC__NONE__Tariff__Change__Usage::DCC__NONE__Tariff__Change__Usage(const DCC__NONE__Tariff__Change__Usage& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
enum_value = other_value.enum_value;
}

DCC__NONE__Tariff__Change__Usage& DCC__NONE__Tariff__Change__Usage::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCC__NONE__Tariff__Change__Usage& DCC__NONE__Tariff__Change__Usage::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCC__NONE__Tariff__Change__Usage& DCC__NONE__Tariff__Change__Usage::operator=(const DCC__NONE__Tariff__Change__Usage& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCC__NONE__Tariff__Change__Usage::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value == other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator==(const DCC__NONE__Tariff__Change__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value == other_value.enum_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value < other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator<(const DCC__NONE__Tariff__Change__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value < other_value.enum_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value > other_value;
}

boolean DCC__NONE__Tariff__Change__Usage::operator>(const DCC__NONE__Tariff__Change__Usage& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value > other_value.enum_value;
}

const char *DCC__NONE__Tariff__Change__Usage::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case UNIT__BEFORE__TARIFF__CHANGE: return "UNIT_BEFORE_TARIFF_CHANGE";
case UNIT__AFTER__TARIFF__CHANGE: return "UNIT_AFTER_TARIFF_CHANGE";
case UNIT__INDETERMINATE: return "UNIT_INDETERMINATE";
default:
return "<unknown>";
}
}

DCC__NONE__Tariff__Change__Usage::enum_type DCC__NONE__Tariff__Change__Usage::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "UNIT_BEFORE_TARIFF_CHANGE")) return UNIT__BEFORE__TARIFF__CHANGE;
if (!strcmp(str_par, "UNIT_AFTER_TARIFF_CHANGE")) return UNIT__AFTER__TARIFF__CHANGE;
if (!strcmp(str_par, "UNIT_INDETERMINATE")) return UNIT__INDETERMINATE;
}
return UNKNOWN_VALUE;
}

boolean DCC__NONE__Tariff__Change__Usage::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int DCC__NONE__Tariff__Change__Usage::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCC__NONE__Tariff__Change__Usage::enum2int(const DCC__NONE__Tariff__Change__Usage& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCC__NONE__Tariff__Change__Usage::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", int_val);
enum_value = (enum_type)int_val;
}

DCC__NONE__Tariff__Change__Usage::operator DCC__NONE__Tariff__Change__Usage::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return enum_value;
}

void DCC__NONE__Tariff__Change__Usage::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCC__NONE__Tariff__Change__Usage::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCC_NONE_Tariff_Change_Usage");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
  }
}

void DCC__NONE__Tariff__Change__Usage::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
text_buf.push_int(enum_value);
}

void DCC__NONE__Tariff__Change__Usage::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", enum_value);
}

void DCC__NONE__Tariff__Change__Usage::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCC__NONE__Tariff__Change__Usage::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCC__NONE__Tariff__Change__Usage::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCC__NONE__Tariff__Change__Usage::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCC__NONE__Tariff__Change__Usage_template::copy_template(const DCC__NONE__Tariff__Change__Usage_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCC__NONE__Tariff__Change__Usage_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCC__NONE__Tariff__Change__Usage_template(*other_value.implication_.precondition);
implication_.implied_template = new DCC__NONE__Tariff__Change__Usage_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template()
{
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCC__NONE__Tariff__Change__Usage::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage with unknown numeric value %d.", other_value);
single_value = (DCC__NONE__Tariff__Change__Usage::enum_type)other_value;
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(DCC__NONE__Tariff__Change__Usage::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(const DCC__NONE__Tariff__Change__Usage& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCC__NONE__Tariff__Change__Usage::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
single_value = other_value.enum_value;
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(const OPTIONAL<DCC__NONE__Tariff__Change__Usage>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__Tariff__Change__Usage::enum_type)(const DCC__NONE__Tariff__Change__Usage&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage from an unbound optional field.");
}
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(DCC__NONE__Tariff__Change__Usage_template* p_precondition, DCC__NONE__Tariff__Change__Usage_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(Dynamic_Match_Interface<DCC__NONE__Tariff__Change__Usage>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCC__NONE__Tariff__Change__Usage>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCC__NONE__Tariff__Change__Usage_template::DCC__NONE__Tariff__Change__Usage_template(const DCC__NONE__Tariff__Change__Usage_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCC__NONE__Tariff__Change__Usage_template::~DCC__NONE__Tariff__Change__Usage_template()
{
clean_up();
}

boolean DCC__NONE__Tariff__Change__Usage_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCC__NONE__Tariff__Change__Usage_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCC__NONE__Tariff__Change__Usage::UNBOUND_VALUE;
}

void DCC__NONE__Tariff__Change__Usage_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(int other_value)
{
if (!DCC__NONE__Tariff__Change__Usage::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__Tariff__Change__Usage::enum_type)other_value;
return *this;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(DCC__NONE__Tariff__Change__Usage::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(const DCC__NONE__Tariff__Change__Usage& other_value)
{
if (other_value.enum_value == DCC__NONE__Tariff__Change__Usage::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(const OPTIONAL<DCC__NONE__Tariff__Change__Usage>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCC__NONE__Tariff__Change__Usage::enum_type)(const DCC__NONE__Tariff__Change__Usage&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
return *this;
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::operator=(const DCC__NONE__Tariff__Change__Usage_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCC__NONE__Tariff__Change__Usage_template::match(DCC__NONE__Tariff__Change__Usage::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
return FALSE;
}

boolean DCC__NONE__Tariff__Change__Usage_template::match(const DCC__NONE__Tariff__Change__Usage& other_value, boolean) const
{
if (other_value.enum_value == DCC__NONE__Tariff__Change__Usage::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage with an unbound value.");
return match(other_value.enum_value);
}

DCC__NONE__Tariff__Change__Usage::enum_type DCC__NONE__Tariff__Change__Usage_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return single_value;
}

void DCC__NONE__Tariff__Change__Usage_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCC__NONE__Tariff__Change__Usage_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
}

DCC__NONE__Tariff__Change__Usage_template& DCC__NONE__Tariff__Change__Usage_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
return value_list.list_value[list_index];
}

void DCC__NONE__Tariff__Change__Usage_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCC__NONE__Tariff__Change__Usage::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCC__NONE__Tariff__Change__Usage_template::log_match(const DCC__NONE__Tariff__Change__Usage& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCC__NONE__Tariff__Change__Usage_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
}

void DCC__NONE__Tariff__Change__Usage_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCC__NONE__Tariff__Change__Usage::enum_type)text_buf.pull_int().get_val();
if (!DCC__NONE__Tariff__Change__Usage::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCC__NONE__Tariff__Change__Usage_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
}
}

boolean DCC__NONE__Tariff__Change__Usage_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCC__NONE__Tariff__Change__Usage_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCC__NONE__Tariff__Change__Usage_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCC__NONE__Tariff__Change__Usage_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCC__NONE__Tariff__Change__Usage::enum_type enum_val = DCC__NONE__Tariff__Change__Usage::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCC__NONE__Tariff__Change__Usage::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCC_NONE_Tariff_Change_Usage.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCC__NONE__Tariff__Change__Usage_template* precondition = new DCC__NONE__Tariff__Change__Usage_template;
    precondition->set_param(*m_p->get_elem(0));
    DCC__NONE__Tariff__Change__Usage_template* implied_template = new DCC__NONE__Tariff__Change__Usage_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCC__NONE__Tariff__Change__Usage_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCC_NONE_Tariff_Change_Usage");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCC__NONE__Tariff__Change__Usage_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCC_NONE_Tariff_Change_Usage");
}

DCA__3GPP__Read__Reply__Report__Requested::DCA__3GPP__Read__Reply__Report__Requested()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Read__Reply__Report__Requested::DCA__3GPP__Read__Reply__Report__Requested(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Read__Reply__Report__Requested::DCA__3GPP__Read__Reply__Report__Requested(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Read__Reply__Report__Requested::DCA__3GPP__Read__Reply__Report__Requested(const DCA__3GPP__Read__Reply__Report__Requested& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Read__Reply__Report__Requested& DCA__3GPP__Read__Reply__Report__Requested::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested& DCA__3GPP__Read__Reply__Report__Requested::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested& DCA__3GPP__Read__Reply__Report__Requested::operator=(const DCA__3GPP__Read__Reply__Report__Requested& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value == other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator==(const DCA__3GPP__Read__Reply__Report__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value < other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator<(const DCA__3GPP__Read__Reply__Report__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value > other_value;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::operator>(const DCA__3GPP__Read__Reply__Report__Requested& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Read__Reply__Report__Requested::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NO: return "NO";
case YES: return "YES";
default:
return "<unknown>";
}
}

DCA__3GPP__Read__Reply__Report__Requested::enum_type DCA__3GPP__Read__Reply__Report__Requested::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NO")) return NO;
if (!strcmp(str_par, "YES")) return YES;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Read__Reply__Report__Requested::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Read__Reply__Report__Requested::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Read__Reply__Report__Requested::enum2int(const DCA__3GPP__Read__Reply__Report__Requested& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Read__Reply__Report__Requested::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Read__Reply__Report__Requested::operator DCA__3GPP__Read__Reply__Report__Requested::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return enum_value;
}

void DCA__3GPP__Read__Reply__Report__Requested::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Read__Reply__Report__Requested::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
  }
}

void DCA__3GPP__Read__Reply__Report__Requested::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Read__Reply__Report__Requested::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", enum_value);
}

void DCA__3GPP__Read__Reply__Report__Requested::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Read__Reply__Report__Requested::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Read__Reply__Report__Requested::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Read__Reply__Report__Requested::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Read__Reply__Report__Requested_template::copy_template(const DCA__3GPP__Read__Reply__Report__Requested_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Read__Reply__Report__Requested_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Read__Reply__Report__Requested_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Read__Reply__Report__Requested_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template()
{
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Read__Reply__Report__Requested::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Read__Reply__Report__Requested::enum_type)other_value;
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(DCA__3GPP__Read__Reply__Report__Requested::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(const DCA__3GPP__Read__Reply__Report__Requested& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Read__Reply__Report__Requested::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
single_value = other_value.enum_value;
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(const OPTIONAL<DCA__3GPP__Read__Reply__Report__Requested>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Read__Reply__Report__Requested::enum_type)(const DCA__3GPP__Read__Reply__Report__Requested&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested from an unbound optional field.");
}
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(DCA__3GPP__Read__Reply__Report__Requested_template* p_precondition, DCA__3GPP__Read__Reply__Report__Requested_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(Dynamic_Match_Interface<DCA__3GPP__Read__Reply__Report__Requested>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Read__Reply__Report__Requested>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Read__Reply__Report__Requested_template::DCA__3GPP__Read__Reply__Report__Requested_template(const DCA__3GPP__Read__Reply__Report__Requested_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Read__Reply__Report__Requested_template::~DCA__3GPP__Read__Reply__Report__Requested_template()
{
clean_up();
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Read__Reply__Report__Requested::UNBOUND_VALUE;
}

void DCA__3GPP__Read__Reply__Report__Requested_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(int other_value)
{
if (!DCA__3GPP__Read__Reply__Report__Requested::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Read__Reply__Report__Requested::enum_type)other_value;
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(DCA__3GPP__Read__Reply__Report__Requested::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(const DCA__3GPP__Read__Reply__Report__Requested& other_value)
{
if (other_value.enum_value == DCA__3GPP__Read__Reply__Report__Requested::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(const OPTIONAL<DCA__3GPP__Read__Reply__Report__Requested>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Read__Reply__Report__Requested::enum_type)(const DCA__3GPP__Read__Reply__Report__Requested&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
return *this;
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::operator=(const DCA__3GPP__Read__Reply__Report__Requested_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::match(DCA__3GPP__Read__Reply__Report__Requested::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
return FALSE;
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::match(const DCA__3GPP__Read__Reply__Report__Requested& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Read__Reply__Report__Requested::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Read__Reply__Report__Requested::enum_type DCA__3GPP__Read__Reply__Report__Requested_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return single_value;
}

void DCA__3GPP__Read__Reply__Report__Requested_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Read__Reply__Report__Requested_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
}

DCA__3GPP__Read__Reply__Report__Requested_template& DCA__3GPP__Read__Reply__Report__Requested_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Read__Reply__Report__Requested_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Read__Reply__Report__Requested::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Read__Reply__Report__Requested_template::log_match(const DCA__3GPP__Read__Reply__Report__Requested& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Read__Reply__Report__Requested_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
}

void DCA__3GPP__Read__Reply__Report__Requested_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Read__Reply__Report__Requested::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Read__Reply__Report__Requested::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Read__Reply__Report__Requested_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
}
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Read__Reply__Report__Requested_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Read__Reply__Report__Requested_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Read__Reply__Report__Requested_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Read__Reply__Report__Requested::enum_type enum_val = DCA__3GPP__Read__Reply__Report__Requested::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Read__Reply__Report__Requested::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Read__Reply__Report__Requested_template* precondition = new DCA__3GPP__Read__Reply__Report__Requested_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Read__Reply__Report__Requested_template* implied_template = new DCA__3GPP__Read__Reply__Report__Requested_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Read__Reply__Report__Requested_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Read__Reply__Report__Requested_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Read_Reply_Report_Requested");
}

CxDx__3GPP__User__Data__Already__Available::CxDx__3GPP__User__Data__Already__Available()
{
enum_value = UNBOUND_VALUE;
}

CxDx__3GPP__User__Data__Already__Available::CxDx__3GPP__User__Data__Already__Available(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

CxDx__3GPP__User__Data__Already__Available::CxDx__3GPP__User__Data__Already__Available(enum_type other_value)
{
enum_value = other_value;
}

CxDx__3GPP__User__Data__Already__Available::CxDx__3GPP__User__Data__Already__Available(const CxDx__3GPP__User__Data__Already__Available& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
enum_value = other_value.enum_value;
}

CxDx__3GPP__User__Data__Already__Available& CxDx__3GPP__User__Data__Already__Available::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

CxDx__3GPP__User__Data__Already__Available& CxDx__3GPP__User__Data__Already__Available::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

CxDx__3GPP__User__Data__Already__Available& CxDx__3GPP__User__Data__Already__Available::operator=(const CxDx__3GPP__User__Data__Already__Available& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
enum_value = other_value.enum_value;
return *this;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value == other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator==(const CxDx__3GPP__User__Data__Already__Available& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value == other_value.enum_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value < other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator<(const CxDx__3GPP__User__Data__Already__Available& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value < other_value.enum_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value > other_value;
}

boolean CxDx__3GPP__User__Data__Already__Available::operator>(const CxDx__3GPP__User__Data__Already__Available& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value > other_value.enum_value;
}

const char *CxDx__3GPP__User__Data__Already__Available::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case USER__DATA__NOT__AVAILABLE: return "USER_DATA_NOT_AVAILABLE";
case USER__DATA__ALREADY__AVAILABLE: return "USER_DATA_ALREADY_AVAILABLE";
default:
return "<unknown>";
}
}

CxDx__3GPP__User__Data__Already__Available::enum_type CxDx__3GPP__User__Data__Already__Available::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "USER_DATA_NOT_AVAILABLE")) return USER__DATA__NOT__AVAILABLE;
if (!strcmp(str_par, "USER_DATA_ALREADY_AVAILABLE")) return USER__DATA__ALREADY__AVAILABLE;
}
return UNKNOWN_VALUE;
}

boolean CxDx__3GPP__User__Data__Already__Available::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int CxDx__3GPP__User__Data__Already__Available::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CxDx__3GPP__User__Data__Already__Available::enum2int(const CxDx__3GPP__User__Data__Already__Available& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void CxDx__3GPP__User__Data__Already__Available::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", int_val);
enum_value = (enum_type)int_val;
}

CxDx__3GPP__User__Data__Already__Available::operator CxDx__3GPP__User__Data__Already__Available::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return enum_value;
}

void CxDx__3GPP__User__Data__Already__Available::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CxDx__3GPP__User__Data__Already__Available::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
  }
}

void CxDx__3GPP__User__Data__Already__Available::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
text_buf.push_int(enum_value);
}

void CxDx__3GPP__User__Data__Already__Available::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", enum_value);
}

void CxDx__3GPP__User__Data__Already__Available::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CxDx__3GPP__User__Data__Already__Available::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CxDx__3GPP__User__Data__Already__Available::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CxDx__3GPP__User__Data__Already__Available::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void CxDx__3GPP__User__Data__Already__Available_template::copy_template(const CxDx__3GPP__User__Data__Already__Available_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CxDx__3GPP__User__Data__Already__Available_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CxDx__3GPP__User__Data__Already__Available_template(*other_value.implication_.precondition);
implication_.implied_template = new CxDx__3GPP__User__Data__Already__Available_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template()
{
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!CxDx__3GPP__User__Data__Already__Available::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available with unknown numeric value %d.", other_value);
single_value = (CxDx__3GPP__User__Data__Already__Available::enum_type)other_value;
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(CxDx__3GPP__User__Data__Already__Available::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(const CxDx__3GPP__User__Data__Already__Available& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CxDx__3GPP__User__Data__Already__Available::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
single_value = other_value.enum_value;
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(const OPTIONAL<CxDx__3GPP__User__Data__Already__Available>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__User__Data__Already__Available::enum_type)(const CxDx__3GPP__User__Data__Already__Available&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available from an unbound optional field.");
}
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(CxDx__3GPP__User__Data__Already__Available_template* p_precondition, CxDx__3GPP__User__Data__Already__Available_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(Dynamic_Match_Interface<CxDx__3GPP__User__Data__Already__Available>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<CxDx__3GPP__User__Data__Already__Available>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

CxDx__3GPP__User__Data__Already__Available_template::CxDx__3GPP__User__Data__Already__Available_template(const CxDx__3GPP__User__Data__Already__Available_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

CxDx__3GPP__User__Data__Already__Available_template::~CxDx__3GPP__User__Data__Already__Available_template()
{
clean_up();
}

boolean CxDx__3GPP__User__Data__Already__Available_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean CxDx__3GPP__User__Data__Already__Available_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != CxDx__3GPP__User__Data__Already__Available::UNBOUND_VALUE;
}

void CxDx__3GPP__User__Data__Already__Available_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(int other_value)
{
if (!CxDx__3GPP__User__Data__Already__Available::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__User__Data__Already__Available::enum_type)other_value;
return *this;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(CxDx__3GPP__User__Data__Already__Available::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(const CxDx__3GPP__User__Data__Already__Available& other_value)
{
if (other_value.enum_value == CxDx__3GPP__User__Data__Already__Available::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(const OPTIONAL<CxDx__3GPP__User__Data__Already__Available>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__User__Data__Already__Available::enum_type)(const CxDx__3GPP__User__Data__Already__Available&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
return *this;
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::operator=(const CxDx__3GPP__User__Data__Already__Available_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CxDx__3GPP__User__Data__Already__Available_template::match(CxDx__3GPP__User__Data__Already__Available::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
return FALSE;
}

boolean CxDx__3GPP__User__Data__Already__Available_template::match(const CxDx__3GPP__User__Data__Already__Available& other_value, boolean) const
{
if (other_value.enum_value == CxDx__3GPP__User__Data__Already__Available::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available with an unbound value.");
return match(other_value.enum_value);
}

CxDx__3GPP__User__Data__Already__Available::enum_type CxDx__3GPP__User__Data__Already__Available_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return single_value;
}

void CxDx__3GPP__User__Data__Already__Available_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CxDx__3GPP__User__Data__Already__Available_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
}

CxDx__3GPP__User__Data__Already__Available_template& CxDx__3GPP__User__Data__Already__Available_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
return value_list.list_value[list_index];
}

void CxDx__3GPP__User__Data__Already__Available_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(CxDx__3GPP__User__Data__Already__Available::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CxDx__3GPP__User__Data__Already__Available_template::log_match(const CxDx__3GPP__User__Data__Already__Available& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void CxDx__3GPP__User__Data__Already__Available_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
}

void CxDx__3GPP__User__Data__Already__Available_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CxDx__3GPP__User__Data__Already__Available::enum_type)text_buf.pull_int().get_val();
if (!CxDx__3GPP__User__Data__Already__Available::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CxDx__3GPP__User__Data__Already__Available_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
}
}

boolean CxDx__3GPP__User__Data__Already__Available_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CxDx__3GPP__User__Data__Already__Available_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void CxDx__3GPP__User__Data__Already__Available_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CxDx__3GPP__User__Data__Already__Available_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CxDx__3GPP__User__Data__Already__Available::enum_type enum_val = CxDx__3GPP__User__Data__Already__Available::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CxDx__3GPP__User__Data__Already__Available::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CxDx__3GPP__User__Data__Already__Available_template* precondition = new CxDx__3GPP__User__Data__Already__Available_template;
    precondition->set_param(*m_p->get_elem(0));
    CxDx__3GPP__User__Data__Already__Available_template* implied_template = new CxDx__3GPP__User__Data__Already__Available_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CxDx__3GPP__User__Data__Already__Available_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available");
  }
  is_ifpresent = param.get_ifpresent();
}

void CxDx__3GPP__User__Data__Already__Available_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.CxDx_3GPP_User_Data_Already_Available");
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::DCA__3GPP__Charging__Characteristics__Selection__Mode()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::DCA__3GPP__Charging__Characteristics__Selection__Mode(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::DCA__3GPP__Charging__Characteristics__Selection__Mode(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::DCA__3GPP__Charging__Characteristics__Selection__Mode(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode& DCA__3GPP__Charging__Characteristics__Selection__Mode::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode& DCA__3GPP__Charging__Characteristics__Selection__Mode::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode& DCA__3GPP__Charging__Characteristics__Selection__Mode::operator=(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value == other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator==(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value < other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator<(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value > other_value;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::operator>(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SERVING__NODE__SUPPLIED: return "SERVING_NODE_SUPPLIED";
case SUBSCRIPTION__SPECIFIC: return "SUBSCRIPTION_SPECIFIC";
case APN__SPECIFIC: return "APN_SPECIFIC";
case HOME__DEFAULT: return "HOME_DEFAULT";
case ROAMING__DEFAULT: return "ROAMING_DEFAULT";
case VISITING__DEFAULT: return "VISITING_DEFAULT";
default:
return "<unknown>";
}
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type DCA__3GPP__Charging__Characteristics__Selection__Mode::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SERVING_NODE_SUPPLIED")) return SERVING__NODE__SUPPLIED;
if (!strcmp(str_par, "SUBSCRIPTION_SPECIFIC")) return SUBSCRIPTION__SPECIFIC;
if (!strcmp(str_par, "APN_SPECIFIC")) return APN__SPECIFIC;
if (!strcmp(str_par, "HOME_DEFAULT")) return HOME__DEFAULT;
if (!strcmp(str_par, "ROAMING_DEFAULT")) return ROAMING__DEFAULT;
if (!strcmp(str_par, "VISITING_DEFAULT")) return VISITING__DEFAULT;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Charging__Characteristics__Selection__Mode::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Charging__Characteristics__Selection__Mode::enum2int(const DCA__3GPP__Charging__Characteristics__Selection__Mode& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::operator DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return enum_value;
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
  }
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", enum_value);
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Charging__Characteristics__Selection__Mode::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Charging__Characteristics__Selection__Mode::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::copy_template(const DCA__3GPP__Charging__Characteristics__Selection__Mode_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template()
{
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Charging__Characteristics__Selection__Mode::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type)other_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Charging__Characteristics__Selection__Mode::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
single_value = other_value.enum_value;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(const OPTIONAL<DCA__3GPP__Charging__Characteristics__Selection__Mode>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type)(const DCA__3GPP__Charging__Characteristics__Selection__Mode&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode from an unbound optional field.");
}
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(DCA__3GPP__Charging__Characteristics__Selection__Mode_template* p_precondition, DCA__3GPP__Charging__Characteristics__Selection__Mode_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(Dynamic_Match_Interface<DCA__3GPP__Charging__Characteristics__Selection__Mode>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Charging__Characteristics__Selection__Mode>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::DCA__3GPP__Charging__Characteristics__Selection__Mode_template(const DCA__3GPP__Charging__Characteristics__Selection__Mode_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template::~DCA__3GPP__Charging__Characteristics__Selection__Mode_template()
{
clean_up();
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Charging__Characteristics__Selection__Mode::UNBOUND_VALUE;
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(int other_value)
{
if (!DCA__3GPP__Charging__Characteristics__Selection__Mode::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type)other_value;
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value)
{
if (other_value.enum_value == DCA__3GPP__Charging__Characteristics__Selection__Mode::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(const OPTIONAL<DCA__3GPP__Charging__Characteristics__Selection__Mode>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type)(const DCA__3GPP__Charging__Characteristics__Selection__Mode&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
return *this;
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::operator=(const DCA__3GPP__Charging__Characteristics__Selection__Mode_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::match(DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
return FALSE;
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::match(const DCA__3GPP__Charging__Characteristics__Selection__Mode& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Charging__Characteristics__Selection__Mode::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type DCA__3GPP__Charging__Characteristics__Selection__Mode_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return single_value;
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
}

DCA__3GPP__Charging__Characteristics__Selection__Mode_template& DCA__3GPP__Charging__Characteristics__Selection__Mode_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::log_match(const DCA__3GPP__Charging__Characteristics__Selection__Mode& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Charging__Characteristics__Selection__Mode::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
}
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Charging__Characteristics__Selection__Mode_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Charging__Characteristics__Selection__Mode_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Charging__Characteristics__Selection__Mode::enum_type enum_val = DCA__3GPP__Charging__Characteristics__Selection__Mode::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Charging__Characteristics__Selection__Mode::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Charging__Characteristics__Selection__Mode_template* precondition = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Charging__Characteristics__Selection__Mode_template* implied_template = new DCA__3GPP__Charging__Characteristics__Selection__Mode_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Charging__Characteristics__Selection__Mode_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Charging__Characteristics__Selection__Mode_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Charging_Characteristics_Selection_Mode");
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::AAA__3GPP__All__APN__Configurations__Included__Indicator()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::AAA__3GPP__All__APN__Configurations__Included__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::AAA__3GPP__All__APN__Configurations__Included__Indicator(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::AAA__3GPP__All__APN__Configurations__Included__Indicator(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
enum_value = other_value.enum_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator& AAA__3GPP__All__APN__Configurations__Included__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator& AAA__3GPP__All__APN__Configurations__Included__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator& AAA__3GPP__All__APN__Configurations__Included__Indicator::operator=(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value == other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator==(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value < other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator<(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value > other_value;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::operator>(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case All__APN__CONFIGURATIONS__INCLUDED: return "All_APN_CONFIGURATIONS_INCLUDED";
case MODIFIED__ADDED__APN__CONFIGURATIONS__INCLUDED: return "MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED";
default:
return "<unknown>";
}
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type AAA__3GPP__All__APN__Configurations__Included__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "All_APN_CONFIGURATIONS_INCLUDED")) return All__APN__CONFIGURATIONS__INCLUDED;
if (!strcmp(str_par, "MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED")) return MODIFIED__ADDED__APN__CONFIGURATIONS__INCLUDED;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__All__APN__Configurations__Included__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__All__APN__Configurations__Included__Indicator::enum2int(const AAA__3GPP__All__APN__Configurations__Included__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::operator AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return enum_value;
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
  }
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", enum_value);
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__All__APN__Configurations__Included__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__All__APN__Configurations__Included__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::copy_template(const AAA__3GPP__All__APN__Configurations__Included__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template()
{
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__All__APN__Configurations__Included__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type)other_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__All__APN__Configurations__Included__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
single_value = other_value.enum_value;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(const OPTIONAL<AAA__3GPP__All__APN__Configurations__Included__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type)(const AAA__3GPP__All__APN__Configurations__Included__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator from an unbound optional field.");
}
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(AAA__3GPP__All__APN__Configurations__Included__Indicator_template* p_precondition, AAA__3GPP__All__APN__Configurations__Included__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(Dynamic_Match_Interface<AAA__3GPP__All__APN__Configurations__Included__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__All__APN__Configurations__Included__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::AAA__3GPP__All__APN__Configurations__Included__Indicator_template(const AAA__3GPP__All__APN__Configurations__Included__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template::~AAA__3GPP__All__APN__Configurations__Included__Indicator_template()
{
clean_up();
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__All__APN__Configurations__Included__Indicator::UNBOUND_VALUE;
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(int other_value)
{
if (!AAA__3GPP__All__APN__Configurations__Included__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type)other_value;
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value)
{
if (other_value.enum_value == AAA__3GPP__All__APN__Configurations__Included__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(const OPTIONAL<AAA__3GPP__All__APN__Configurations__Included__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type)(const AAA__3GPP__All__APN__Configurations__Included__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
return *this;
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::operator=(const AAA__3GPP__All__APN__Configurations__Included__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::match(AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
return FALSE;
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::match(const AAA__3GPP__All__APN__Configurations__Included__Indicator& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__All__APN__Configurations__Included__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type AAA__3GPP__All__APN__Configurations__Included__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return single_value;
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
}

AAA__3GPP__All__APN__Configurations__Included__Indicator_template& AAA__3GPP__All__APN__Configurations__Included__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
return value_list.list_value[list_index];
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::log_match(const AAA__3GPP__All__APN__Configurations__Included__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__All__APN__Configurations__Included__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
}
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__All__APN__Configurations__Included__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__All__APN__Configurations__Included__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__All__APN__Configurations__Included__Indicator::enum_type enum_val = AAA__3GPP__All__APN__Configurations__Included__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__All__APN__Configurations__Included__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__All__APN__Configurations__Included__Indicator_template* precondition = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__All__APN__Configurations__Included__Indicator_template* implied_template = new AAA__3GPP__All__APN__Configurations__Included__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__All__APN__Configurations__Included__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__All__APN__Configurations__Included__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_All_APN_Configurations_Included_Indicator");
}

DCA__3GPP__Charge__Reason__Code::DCA__3GPP__Charge__Reason__Code()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Charge__Reason__Code::DCA__3GPP__Charge__Reason__Code(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Charge__Reason__Code::DCA__3GPP__Charge__Reason__Code(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Charge__Reason__Code::DCA__3GPP__Charge__Reason__Code(const DCA__3GPP__Charge__Reason__Code& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Charge__Reason__Code& DCA__3GPP__Charge__Reason__Code::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Charge__Reason__Code& DCA__3GPP__Charge__Reason__Code::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Charge__Reason__Code& DCA__3GPP__Charge__Reason__Code::operator=(const DCA__3GPP__Charge__Reason__Code& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Charge__Reason__Code::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value == other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator==(const DCA__3GPP__Charge__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value < other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator<(const DCA__3GPP__Charge__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value > other_value;
}

boolean DCA__3GPP__Charge__Reason__Code::operator>(const DCA__3GPP__Charge__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Charge__Reason__Code::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case UNKNOWN: return "UNKNOWN";
case USAGE: return "USAGE";
case COMMUNICATION__ATTEMPT__CHARGE: return "COMMUNICATION_ATTEMPT_CHARGE";
case SETUP__CHARGE: return "SETUP_CHARGE";
case ADD__ON__CHARGE: return "ADD_ON_CHARGE";
default:
return "<unknown>";
}
}

DCA__3GPP__Charge__Reason__Code::enum_type DCA__3GPP__Charge__Reason__Code::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "UNKNOWN")) return UNKNOWN;
if (!strcmp(str_par, "USAGE")) return USAGE;
if (!strcmp(str_par, "COMMUNICATION_ATTEMPT_CHARGE")) return COMMUNICATION__ATTEMPT__CHARGE;
if (!strcmp(str_par, "SETUP_CHARGE")) return SETUP__CHARGE;
if (!strcmp(str_par, "ADD_ON_CHARGE")) return ADD__ON__CHARGE;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Charge__Reason__Code::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Charge__Reason__Code::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Charge__Reason__Code::enum2int(const DCA__3GPP__Charge__Reason__Code& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Charge__Reason__Code::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Charge__Reason__Code::operator DCA__3GPP__Charge__Reason__Code::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return enum_value;
}

void DCA__3GPP__Charge__Reason__Code::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Charge__Reason__Code::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Charge_Reason_Code");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
  }
}

void DCA__3GPP__Charge__Reason__Code::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Charge__Reason__Code::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", enum_value);
}

void DCA__3GPP__Charge__Reason__Code::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Charge__Reason__Code::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Charge__Reason__Code::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Charge__Reason__Code::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Charge__Reason__Code_template::copy_template(const DCA__3GPP__Charge__Reason__Code_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Charge__Reason__Code_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Charge__Reason__Code_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Charge__Reason__Code_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template()
{
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Charge__Reason__Code::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Charge__Reason__Code::enum_type)other_value;
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(DCA__3GPP__Charge__Reason__Code::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(const DCA__3GPP__Charge__Reason__Code& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Charge__Reason__Code::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
single_value = other_value.enum_value;
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(const OPTIONAL<DCA__3GPP__Charge__Reason__Code>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charge__Reason__Code::enum_type)(const DCA__3GPP__Charge__Reason__Code&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code from an unbound optional field.");
}
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(DCA__3GPP__Charge__Reason__Code_template* p_precondition, DCA__3GPP__Charge__Reason__Code_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(Dynamic_Match_Interface<DCA__3GPP__Charge__Reason__Code>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Charge__Reason__Code>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Charge__Reason__Code_template::DCA__3GPP__Charge__Reason__Code_template(const DCA__3GPP__Charge__Reason__Code_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Charge__Reason__Code_template::~DCA__3GPP__Charge__Reason__Code_template()
{
clean_up();
}

boolean DCA__3GPP__Charge__Reason__Code_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Charge__Reason__Code_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Charge__Reason__Code::UNBOUND_VALUE;
}

void DCA__3GPP__Charge__Reason__Code_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(int other_value)
{
if (!DCA__3GPP__Charge__Reason__Code::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charge__Reason__Code::enum_type)other_value;
return *this;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(DCA__3GPP__Charge__Reason__Code::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(const DCA__3GPP__Charge__Reason__Code& other_value)
{
if (other_value.enum_value == DCA__3GPP__Charge__Reason__Code::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(const OPTIONAL<DCA__3GPP__Charge__Reason__Code>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Charge__Reason__Code::enum_type)(const DCA__3GPP__Charge__Reason__Code&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
return *this;
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::operator=(const DCA__3GPP__Charge__Reason__Code_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Charge__Reason__Code_template::match(DCA__3GPP__Charge__Reason__Code::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
return FALSE;
}

boolean DCA__3GPP__Charge__Reason__Code_template::match(const DCA__3GPP__Charge__Reason__Code& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Charge__Reason__Code::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Charge__Reason__Code::enum_type DCA__3GPP__Charge__Reason__Code_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return single_value;
}

void DCA__3GPP__Charge__Reason__Code_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Charge__Reason__Code_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
}

DCA__3GPP__Charge__Reason__Code_template& DCA__3GPP__Charge__Reason__Code_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Charge__Reason__Code_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Charge__Reason__Code::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Charge__Reason__Code_template::log_match(const DCA__3GPP__Charge__Reason__Code& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Charge__Reason__Code_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
}

void DCA__3GPP__Charge__Reason__Code_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Charge__Reason__Code::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Charge__Reason__Code::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Charge__Reason__Code_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
}
}

boolean DCA__3GPP__Charge__Reason__Code_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Charge__Reason__Code_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Charge__Reason__Code_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Charge__Reason__Code_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Charge__Reason__Code::enum_type enum_val = DCA__3GPP__Charge__Reason__Code::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Charge__Reason__Code::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Charge_Reason_Code.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Charge__Reason__Code_template* precondition = new DCA__3GPP__Charge__Reason__Code_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Charge__Reason__Code_template* implied_template = new DCA__3GPP__Charge__Reason__Code_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Charge__Reason__Code_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Charge_Reason_Code");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Charge__Reason__Code_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Charge_Reason_Code");
}

DCA__3GPP__PoC__Change__Conditions::DCA__3GPP__PoC__Change__Conditions()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__PoC__Change__Conditions::DCA__3GPP__PoC__Change__Conditions(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__PoC__Change__Conditions::DCA__3GPP__PoC__Change__Conditions(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__PoC__Change__Conditions::DCA__3GPP__PoC__Change__Conditions(const DCA__3GPP__PoC__Change__Conditions& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
enum_value = other_value.enum_value;
}

DCA__3GPP__PoC__Change__Conditions& DCA__3GPP__PoC__Change__Conditions::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__Change__Conditions& DCA__3GPP__PoC__Change__Conditions::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__PoC__Change__Conditions& DCA__3GPP__PoC__Change__Conditions::operator=(const DCA__3GPP__PoC__Change__Conditions& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator==(const DCA__3GPP__PoC__Change__Conditions& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator<(const DCA__3GPP__PoC__Change__Conditions& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__Change__Conditions::operator>(const DCA__3GPP__PoC__Change__Conditions& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__PoC__Change__Conditions::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SERVICE__CHANGE: return "SERVICE_CHANGE";
case VOLUME__LIMIT: return "VOLUME_LIMIT";
case TIME__LIMIT: return "TIME_LIMIT";
case NUMBER__OF__TALK__BURST__LIMIT: return "NUMBER_OF_TALK_BURST_LIMIT";
case NUMBER__OF__ACTIVE__PARTICIPANTS: return "NUMBER_OF_ACTIVE_PARTICIPANTS";
case TARIFF__TIME: return "TARIFF_TIME";
default:
return "<unknown>";
}
}

DCA__3GPP__PoC__Change__Conditions::enum_type DCA__3GPP__PoC__Change__Conditions::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SERVICE_CHANGE")) return SERVICE__CHANGE;
if (!strcmp(str_par, "VOLUME_LIMIT")) return VOLUME__LIMIT;
if (!strcmp(str_par, "TIME_LIMIT")) return TIME__LIMIT;
if (!strcmp(str_par, "NUMBER_OF_TALK_BURST_LIMIT")) return NUMBER__OF__TALK__BURST__LIMIT;
if (!strcmp(str_par, "NUMBER_OF_ACTIVE_PARTICIPANTS")) return NUMBER__OF__ACTIVE__PARTICIPANTS;
if (!strcmp(str_par, "TARIFF_TIME")) return TARIFF__TIME;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__PoC__Change__Conditions::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__PoC__Change__Conditions::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__PoC__Change__Conditions::enum2int(const DCA__3GPP__PoC__Change__Conditions& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__PoC__Change__Conditions::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__PoC__Change__Conditions::operator DCA__3GPP__PoC__Change__Conditions::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return enum_value;
}

void DCA__3GPP__PoC__Change__Conditions::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__PoC__Change__Conditions::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
  }
}

void DCA__3GPP__PoC__Change__Conditions::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__PoC__Change__Conditions::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", enum_value);
}

void DCA__3GPP__PoC__Change__Conditions::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__PoC__Change__Conditions::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__PoC__Change__Conditions::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__PoC__Change__Conditions::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__PoC__Change__Conditions_template::copy_template(const DCA__3GPP__PoC__Change__Conditions_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__PoC__Change__Conditions_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__PoC__Change__Conditions_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__PoC__Change__Conditions_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template()
{
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__PoC__Change__Conditions::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__PoC__Change__Conditions::enum_type)other_value;
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(DCA__3GPP__PoC__Change__Conditions::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(const DCA__3GPP__PoC__Change__Conditions& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__PoC__Change__Conditions::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
single_value = other_value.enum_value;
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(const OPTIONAL<DCA__3GPP__PoC__Change__Conditions>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Change__Conditions::enum_type)(const DCA__3GPP__PoC__Change__Conditions&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions from an unbound optional field.");
}
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(DCA__3GPP__PoC__Change__Conditions_template* p_precondition, DCA__3GPP__PoC__Change__Conditions_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(Dynamic_Match_Interface<DCA__3GPP__PoC__Change__Conditions>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__PoC__Change__Conditions>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__PoC__Change__Conditions_template::DCA__3GPP__PoC__Change__Conditions_template(const DCA__3GPP__PoC__Change__Conditions_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__PoC__Change__Conditions_template::~DCA__3GPP__PoC__Change__Conditions_template()
{
clean_up();
}

boolean DCA__3GPP__PoC__Change__Conditions_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__PoC__Change__Conditions_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__PoC__Change__Conditions::UNBOUND_VALUE;
}

void DCA__3GPP__PoC__Change__Conditions_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(int other_value)
{
if (!DCA__3GPP__PoC__Change__Conditions::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Change__Conditions::enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(DCA__3GPP__PoC__Change__Conditions::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(const DCA__3GPP__PoC__Change__Conditions& other_value)
{
if (other_value.enum_value == DCA__3GPP__PoC__Change__Conditions::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(const OPTIONAL<DCA__3GPP__PoC__Change__Conditions>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Change__Conditions::enum_type)(const DCA__3GPP__PoC__Change__Conditions&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
return *this;
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::operator=(const DCA__3GPP__PoC__Change__Conditions_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__PoC__Change__Conditions_template::match(DCA__3GPP__PoC__Change__Conditions::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
return FALSE;
}

boolean DCA__3GPP__PoC__Change__Conditions_template::match(const DCA__3GPP__PoC__Change__Conditions& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__PoC__Change__Conditions::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__PoC__Change__Conditions::enum_type DCA__3GPP__PoC__Change__Conditions_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return single_value;
}

void DCA__3GPP__PoC__Change__Conditions_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__PoC__Change__Conditions_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
}

DCA__3GPP__PoC__Change__Conditions_template& DCA__3GPP__PoC__Change__Conditions_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
return value_list.list_value[list_index];
}

void DCA__3GPP__PoC__Change__Conditions_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__PoC__Change__Conditions::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__PoC__Change__Conditions_template::log_match(const DCA__3GPP__PoC__Change__Conditions& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__PoC__Change__Conditions_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
}

void DCA__3GPP__PoC__Change__Conditions_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__PoC__Change__Conditions::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__PoC__Change__Conditions::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__PoC__Change__Conditions_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
}
}

boolean DCA__3GPP__PoC__Change__Conditions_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__PoC__Change__Conditions_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__PoC__Change__Conditions_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__PoC__Change__Conditions_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__PoC__Change__Conditions::enum_type enum_val = DCA__3GPP__PoC__Change__Conditions::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__PoC__Change__Conditions::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__PoC__Change__Conditions_template* precondition = new DCA__3GPP__PoC__Change__Conditions_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__PoC__Change__Conditions_template* implied_template = new DCA__3GPP__PoC__Change__Conditions_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__PoC__Change__Conditions_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__PoC__Change__Conditions_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_PoC_Change_Conditions");
}

DNAS__NONE__Accounting__Auth__Method::DNAS__NONE__Accounting__Auth__Method()
{
enum_value = UNBOUND_VALUE;
}

DNAS__NONE__Accounting__Auth__Method::DNAS__NONE__Accounting__Auth__Method(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DNAS__NONE__Accounting__Auth__Method::DNAS__NONE__Accounting__Auth__Method(enum_type other_value)
{
enum_value = other_value;
}

DNAS__NONE__Accounting__Auth__Method::DNAS__NONE__Accounting__Auth__Method(const DNAS__NONE__Accounting__Auth__Method& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
enum_value = other_value.enum_value;
}

DNAS__NONE__Accounting__Auth__Method& DNAS__NONE__Accounting__Auth__Method::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DNAS__NONE__Accounting__Auth__Method& DNAS__NONE__Accounting__Auth__Method::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DNAS__NONE__Accounting__Auth__Method& DNAS__NONE__Accounting__Auth__Method::operator=(const DNAS__NONE__Accounting__Auth__Method& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
enum_value = other_value.enum_value;
return *this;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value == other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator==(const DNAS__NONE__Accounting__Auth__Method& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value == other_value.enum_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value < other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator<(const DNAS__NONE__Accounting__Auth__Method& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value < other_value.enum_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value > other_value;
}

boolean DNAS__NONE__Accounting__Auth__Method::operator>(const DNAS__NONE__Accounting__Auth__Method& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value > other_value.enum_value;
}

const char *DNAS__NONE__Accounting__Auth__Method::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PAP: return "PAP";
case CHAP: return "CHAP";
case MS__CHAP__1: return "MS_CHAP_1";
case MS__CHAP__2: return "MS_CHAP_2";
case EAP: return "EAP";
case None: return "None";
default:
return "<unknown>";
}
}

DNAS__NONE__Accounting__Auth__Method::enum_type DNAS__NONE__Accounting__Auth__Method::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PAP")) return PAP;
if (!strcmp(str_par, "CHAP")) return CHAP;
if (!strcmp(str_par, "MS_CHAP_1")) return MS__CHAP__1;
if (!strcmp(str_par, "MS_CHAP_2")) return MS__CHAP__2;
if (!strcmp(str_par, "EAP")) return EAP;
if (!strcmp(str_par, "None")) return None;
}
return UNKNOWN_VALUE;
}

boolean DNAS__NONE__Accounting__Auth__Method::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 7:
return TRUE;
default:
return FALSE;
}
}

int DNAS__NONE__Accounting__Auth__Method::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DNAS__NONE__Accounting__Auth__Method::enum2int(const DNAS__NONE__Accounting__Auth__Method& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DNAS__NONE__Accounting__Auth__Method::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", int_val);
enum_value = (enum_type)int_val;
}

DNAS__NONE__Accounting__Auth__Method::operator DNAS__NONE__Accounting__Auth__Method::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return enum_value;
}

void DNAS__NONE__Accounting__Auth__Method::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DNAS__NONE__Accounting__Auth__Method::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
  }
}

void DNAS__NONE__Accounting__Auth__Method::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
text_buf.push_int(enum_value);
}

void DNAS__NONE__Accounting__Auth__Method::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", enum_value);
}

void DNAS__NONE__Accounting__Auth__Method::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DNAS__NONE__Accounting__Auth__Method::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DNAS__NONE__Accounting__Auth__Method::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DNAS__NONE__Accounting__Auth__Method::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DNAS__NONE__Accounting__Auth__Method_template::copy_template(const DNAS__NONE__Accounting__Auth__Method_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DNAS__NONE__Accounting__Auth__Method_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DNAS__NONE__Accounting__Auth__Method_template(*other_value.implication_.precondition);
implication_.implied_template = new DNAS__NONE__Accounting__Auth__Method_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template()
{
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DNAS__NONE__Accounting__Auth__Method::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method with unknown numeric value %d.", other_value);
single_value = (DNAS__NONE__Accounting__Auth__Method::enum_type)other_value;
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(DNAS__NONE__Accounting__Auth__Method::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(const DNAS__NONE__Accounting__Auth__Method& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DNAS__NONE__Accounting__Auth__Method::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
single_value = other_value.enum_value;
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(const OPTIONAL<DNAS__NONE__Accounting__Auth__Method>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Accounting__Auth__Method::enum_type)(const DNAS__NONE__Accounting__Auth__Method&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method from an unbound optional field.");
}
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(DNAS__NONE__Accounting__Auth__Method_template* p_precondition, DNAS__NONE__Accounting__Auth__Method_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(Dynamic_Match_Interface<DNAS__NONE__Accounting__Auth__Method>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DNAS__NONE__Accounting__Auth__Method>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DNAS__NONE__Accounting__Auth__Method_template::DNAS__NONE__Accounting__Auth__Method_template(const DNAS__NONE__Accounting__Auth__Method_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DNAS__NONE__Accounting__Auth__Method_template::~DNAS__NONE__Accounting__Auth__Method_template()
{
clean_up();
}

boolean DNAS__NONE__Accounting__Auth__Method_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DNAS__NONE__Accounting__Auth__Method_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DNAS__NONE__Accounting__Auth__Method::UNBOUND_VALUE;
}

void DNAS__NONE__Accounting__Auth__Method_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(int other_value)
{
if (!DNAS__NONE__Accounting__Auth__Method::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Accounting__Auth__Method::enum_type)other_value;
return *this;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(DNAS__NONE__Accounting__Auth__Method::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(const DNAS__NONE__Accounting__Auth__Method& other_value)
{
if (other_value.enum_value == DNAS__NONE__Accounting__Auth__Method::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(const OPTIONAL<DNAS__NONE__Accounting__Auth__Method>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DNAS__NONE__Accounting__Auth__Method::enum_type)(const DNAS__NONE__Accounting__Auth__Method&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
return *this;
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::operator=(const DNAS__NONE__Accounting__Auth__Method_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DNAS__NONE__Accounting__Auth__Method_template::match(DNAS__NONE__Accounting__Auth__Method::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
return FALSE;
}

boolean DNAS__NONE__Accounting__Auth__Method_template::match(const DNAS__NONE__Accounting__Auth__Method& other_value, boolean) const
{
if (other_value.enum_value == DNAS__NONE__Accounting__Auth__Method::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method with an unbound value.");
return match(other_value.enum_value);
}

DNAS__NONE__Accounting__Auth__Method::enum_type DNAS__NONE__Accounting__Auth__Method_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return single_value;
}

void DNAS__NONE__Accounting__Auth__Method_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DNAS__NONE__Accounting__Auth__Method_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
}

DNAS__NONE__Accounting__Auth__Method_template& DNAS__NONE__Accounting__Auth__Method_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
return value_list.list_value[list_index];
}

void DNAS__NONE__Accounting__Auth__Method_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DNAS__NONE__Accounting__Auth__Method::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DNAS__NONE__Accounting__Auth__Method_template::log_match(const DNAS__NONE__Accounting__Auth__Method& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DNAS__NONE__Accounting__Auth__Method_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
}

void DNAS__NONE__Accounting__Auth__Method_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DNAS__NONE__Accounting__Auth__Method::enum_type)text_buf.pull_int().get_val();
if (!DNAS__NONE__Accounting__Auth__Method::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DNAS__NONE__Accounting__Auth__Method_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
}
}

boolean DNAS__NONE__Accounting__Auth__Method_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DNAS__NONE__Accounting__Auth__Method_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DNAS__NONE__Accounting__Auth__Method_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DNAS__NONE__Accounting__Auth__Method_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DNAS__NONE__Accounting__Auth__Method::enum_type enum_val = DNAS__NONE__Accounting__Auth__Method::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DNAS__NONE__Accounting__Auth__Method::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DNAS__NONE__Accounting__Auth__Method_template* precondition = new DNAS__NONE__Accounting__Auth__Method_template;
    precondition->set_param(*m_p->get_elem(0));
    DNAS__NONE__Accounting__Auth__Method_template* implied_template = new DNAS__NONE__Accounting__Auth__Method_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DNAS__NONE__Accounting__Auth__Method_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method");
  }
  is_ifpresent = param.get_ifpresent();
}

void DNAS__NONE__Accounting__Auth__Method_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DNAS_NONE_Accounting_Auth_Method");
}

AAA__3GPP__Relay__Node__Indicator::AAA__3GPP__Relay__Node__Indicator()
{
enum_value = UNBOUND_VALUE;
}

AAA__3GPP__Relay__Node__Indicator::AAA__3GPP__Relay__Node__Indicator(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

AAA__3GPP__Relay__Node__Indicator::AAA__3GPP__Relay__Node__Indicator(enum_type other_value)
{
enum_value = other_value;
}

AAA__3GPP__Relay__Node__Indicator::AAA__3GPP__Relay__Node__Indicator(const AAA__3GPP__Relay__Node__Indicator& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
enum_value = other_value.enum_value;
}

AAA__3GPP__Relay__Node__Indicator& AAA__3GPP__Relay__Node__Indicator::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

AAA__3GPP__Relay__Node__Indicator& AAA__3GPP__Relay__Node__Indicator::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

AAA__3GPP__Relay__Node__Indicator& AAA__3GPP__Relay__Node__Indicator::operator=(const AAA__3GPP__Relay__Node__Indicator& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
enum_value = other_value.enum_value;
return *this;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value == other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator==(const AAA__3GPP__Relay__Node__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value == other_value.enum_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value < other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator<(const AAA__3GPP__Relay__Node__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value < other_value.enum_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value > other_value;
}

boolean AAA__3GPP__Relay__Node__Indicator::operator>(const AAA__3GPP__Relay__Node__Indicator& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value > other_value.enum_value;
}

const char *AAA__3GPP__Relay__Node__Indicator::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NOT__RELAY__NODE: return "NOT_RELAY_NODE";
case RELAY__NODE: return "RELAY_NODE";
default:
return "<unknown>";
}
}

AAA__3GPP__Relay__Node__Indicator::enum_type AAA__3GPP__Relay__Node__Indicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NOT_RELAY_NODE")) return NOT__RELAY__NODE;
if (!strcmp(str_par, "RELAY_NODE")) return RELAY__NODE;
}
return UNKNOWN_VALUE;
}

boolean AAA__3GPP__Relay__Node__Indicator::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int AAA__3GPP__Relay__Node__Indicator::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int AAA__3GPP__Relay__Node__Indicator::enum2int(const AAA__3GPP__Relay__Node__Indicator& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void AAA__3GPP__Relay__Node__Indicator::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", int_val);
enum_value = (enum_type)int_val;
}

AAA__3GPP__Relay__Node__Indicator::operator AAA__3GPP__Relay__Node__Indicator::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return enum_value;
}

void AAA__3GPP__Relay__Node__Indicator::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void AAA__3GPP__Relay__Node__Indicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
  }
}

void AAA__3GPP__Relay__Node__Indicator::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
text_buf.push_int(enum_value);
}

void AAA__3GPP__Relay__Node__Indicator::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", enum_value);
}

void AAA__3GPP__Relay__Node__Indicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AAA__3GPP__Relay__Node__Indicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AAA__3GPP__Relay__Node__Indicator::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int AAA__3GPP__Relay__Node__Indicator::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void AAA__3GPP__Relay__Node__Indicator_template::copy_template(const AAA__3GPP__Relay__Node__Indicator_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AAA__3GPP__Relay__Node__Indicator_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AAA__3GPP__Relay__Node__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new AAA__3GPP__Relay__Node__Indicator_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template()
{
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!AAA__3GPP__Relay__Node__Indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator with unknown numeric value %d.", other_value);
single_value = (AAA__3GPP__Relay__Node__Indicator::enum_type)other_value;
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(AAA__3GPP__Relay__Node__Indicator::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(const AAA__3GPP__Relay__Node__Indicator& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AAA__3GPP__Relay__Node__Indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
single_value = other_value.enum_value;
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(const OPTIONAL<AAA__3GPP__Relay__Node__Indicator>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Relay__Node__Indicator::enum_type)(const AAA__3GPP__Relay__Node__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator from an unbound optional field.");
}
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(AAA__3GPP__Relay__Node__Indicator_template* p_precondition, AAA__3GPP__Relay__Node__Indicator_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(Dynamic_Match_Interface<AAA__3GPP__Relay__Node__Indicator>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AAA__3GPP__Relay__Node__Indicator>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AAA__3GPP__Relay__Node__Indicator_template::AAA__3GPP__Relay__Node__Indicator_template(const AAA__3GPP__Relay__Node__Indicator_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

AAA__3GPP__Relay__Node__Indicator_template::~AAA__3GPP__Relay__Node__Indicator_template()
{
clean_up();
}

boolean AAA__3GPP__Relay__Node__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean AAA__3GPP__Relay__Node__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AAA__3GPP__Relay__Node__Indicator::UNBOUND_VALUE;
}

void AAA__3GPP__Relay__Node__Indicator_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(int other_value)
{
if (!AAA__3GPP__Relay__Node__Indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Relay__Node__Indicator::enum_type)other_value;
return *this;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(AAA__3GPP__Relay__Node__Indicator::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(const AAA__3GPP__Relay__Node__Indicator& other_value)
{
if (other_value.enum_value == AAA__3GPP__Relay__Node__Indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(const OPTIONAL<AAA__3GPP__Relay__Node__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AAA__3GPP__Relay__Node__Indicator::enum_type)(const AAA__3GPP__Relay__Node__Indicator&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
return *this;
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::operator=(const AAA__3GPP__Relay__Node__Indicator_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AAA__3GPP__Relay__Node__Indicator_template::match(AAA__3GPP__Relay__Node__Indicator::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
return FALSE;
}

boolean AAA__3GPP__Relay__Node__Indicator_template::match(const AAA__3GPP__Relay__Node__Indicator& other_value, boolean) const
{
if (other_value.enum_value == AAA__3GPP__Relay__Node__Indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator with an unbound value.");
return match(other_value.enum_value);
}

AAA__3GPP__Relay__Node__Indicator::enum_type AAA__3GPP__Relay__Node__Indicator_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return single_value;
}

void AAA__3GPP__Relay__Node__Indicator_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AAA__3GPP__Relay__Node__Indicator_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
}

AAA__3GPP__Relay__Node__Indicator_template& AAA__3GPP__Relay__Node__Indicator_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
return value_list.list_value[list_index];
}

void AAA__3GPP__Relay__Node__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AAA__3GPP__Relay__Node__Indicator::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AAA__3GPP__Relay__Node__Indicator_template::log_match(const AAA__3GPP__Relay__Node__Indicator& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void AAA__3GPP__Relay__Node__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
}

void AAA__3GPP__Relay__Node__Indicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AAA__3GPP__Relay__Node__Indicator::enum_type)text_buf.pull_int().get_val();
if (!AAA__3GPP__Relay__Node__Indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AAA__3GPP__Relay__Node__Indicator_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
}
}

boolean AAA__3GPP__Relay__Node__Indicator_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AAA__3GPP__Relay__Node__Indicator_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void AAA__3GPP__Relay__Node__Indicator_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AAA__3GPP__Relay__Node__Indicator_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    AAA__3GPP__Relay__Node__Indicator::enum_type enum_val = AAA__3GPP__Relay__Node__Indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!AAA__3GPP__Relay__Node__Indicator::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    AAA__3GPP__Relay__Node__Indicator_template* precondition = new AAA__3GPP__Relay__Node__Indicator_template;
    precondition->set_param(*m_p->get_elem(0));
    AAA__3GPP__Relay__Node__Indicator_template* implied_template = new AAA__3GPP__Relay__Node__Indicator_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = AAA__3GPP__Relay__Node__Indicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void AAA__3GPP__Relay__Node__Indicator_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AAA_3GPP_Relay_Node_Indicator");
}

DCA__3GPP__Coverage__Status::DCA__3GPP__Coverage__Status()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Coverage__Status::DCA__3GPP__Coverage__Status(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Coverage__Status::DCA__3GPP__Coverage__Status(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Coverage__Status::DCA__3GPP__Coverage__Status(const DCA__3GPP__Coverage__Status& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Coverage__Status& DCA__3GPP__Coverage__Status::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Coverage__Status& DCA__3GPP__Coverage__Status::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Coverage__Status& DCA__3GPP__Coverage__Status::operator=(const DCA__3GPP__Coverage__Status& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Coverage__Status::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Coverage__Status::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value == other_value;
}

boolean DCA__3GPP__Coverage__Status::operator==(const DCA__3GPP__Coverage__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Coverage__Status::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Coverage__Status::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value < other_value;
}

boolean DCA__3GPP__Coverage__Status::operator<(const DCA__3GPP__Coverage__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Coverage__Status::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Coverage__Status::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value > other_value;
}

boolean DCA__3GPP__Coverage__Status::operator>(const DCA__3GPP__Coverage__Status& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Coverage__Status::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case OUT__OF__COVERAGE: return "OUT_OF_COVERAGE";
case IN__COVERAGE: return "IN_COVERAGE";
default:
return "<unknown>";
}
}

DCA__3GPP__Coverage__Status::enum_type DCA__3GPP__Coverage__Status::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "OUT_OF_COVERAGE")) return OUT__OF__COVERAGE;
if (!strcmp(str_par, "IN_COVERAGE")) return IN__COVERAGE;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Coverage__Status::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Coverage__Status::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Coverage__Status::enum2int(const DCA__3GPP__Coverage__Status& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Coverage__Status::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Coverage__Status::operator DCA__3GPP__Coverage__Status::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return enum_value;
}

void DCA__3GPP__Coverage__Status::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Coverage__Status::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Coverage_Status");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
  }
}

void DCA__3GPP__Coverage__Status::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Coverage__Status::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", enum_value);
}

void DCA__3GPP__Coverage__Status::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Coverage__Status::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Coverage__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Coverage__Status::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Coverage__Status_template::copy_template(const DCA__3GPP__Coverage__Status_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Coverage__Status_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Coverage__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Coverage__Status_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template()
{
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Coverage__Status::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Coverage__Status::enum_type)other_value;
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(DCA__3GPP__Coverage__Status::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(const DCA__3GPP__Coverage__Status& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Coverage__Status::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
single_value = other_value.enum_value;
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(const OPTIONAL<DCA__3GPP__Coverage__Status>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Coverage__Status::enum_type)(const DCA__3GPP__Coverage__Status&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status from an unbound optional field.");
}
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(DCA__3GPP__Coverage__Status_template* p_precondition, DCA__3GPP__Coverage__Status_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(Dynamic_Match_Interface<DCA__3GPP__Coverage__Status>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Coverage__Status>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Coverage__Status_template::DCA__3GPP__Coverage__Status_template(const DCA__3GPP__Coverage__Status_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Coverage__Status_template::~DCA__3GPP__Coverage__Status_template()
{
clean_up();
}

boolean DCA__3GPP__Coverage__Status_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Coverage__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Coverage__Status::UNBOUND_VALUE;
}

void DCA__3GPP__Coverage__Status_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(int other_value)
{
if (!DCA__3GPP__Coverage__Status::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Coverage__Status::enum_type)other_value;
return *this;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(DCA__3GPP__Coverage__Status::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(const DCA__3GPP__Coverage__Status& other_value)
{
if (other_value.enum_value == DCA__3GPP__Coverage__Status::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(const OPTIONAL<DCA__3GPP__Coverage__Status>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Coverage__Status::enum_type)(const DCA__3GPP__Coverage__Status&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
return *this;
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::operator=(const DCA__3GPP__Coverage__Status_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Coverage__Status_template::match(DCA__3GPP__Coverage__Status::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
return FALSE;
}

boolean DCA__3GPP__Coverage__Status_template::match(const DCA__3GPP__Coverage__Status& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Coverage__Status::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Coverage__Status::enum_type DCA__3GPP__Coverage__Status_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return single_value;
}

void DCA__3GPP__Coverage__Status_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Coverage__Status_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
}

DCA__3GPP__Coverage__Status_template& DCA__3GPP__Coverage__Status_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Coverage__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Coverage__Status::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Coverage__Status_template::log_match(const DCA__3GPP__Coverage__Status& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Coverage__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
}

void DCA__3GPP__Coverage__Status_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Coverage__Status::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Coverage__Status::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Coverage__Status_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
}
}

boolean DCA__3GPP__Coverage__Status_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Coverage__Status_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Coverage__Status_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Coverage__Status_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Coverage__Status::enum_type enum_val = DCA__3GPP__Coverage__Status::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Coverage__Status::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Coverage_Status.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Coverage__Status_template* precondition = new DCA__3GPP__Coverage__Status_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Coverage__Status_template* implied_template = new DCA__3GPP__Coverage__Status_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Coverage__Status_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Coverage_Status");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Coverage__Status_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Coverage_Status");
}

PCC__3GPP__Online::PCC__3GPP__Online()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Online::PCC__3GPP__Online(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Online with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Online::PCC__3GPP__Online(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Online::PCC__3GPP__Online(const PCC__3GPP__Online& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Online& PCC__3GPP__Online::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Online& PCC__3GPP__Online::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Online& PCC__3GPP__Online::operator=(const PCC__3GPP__Online& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Online::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Online comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Online::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value == other_value;
}

boolean PCC__3GPP__Online::operator==(const PCC__3GPP__Online& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Online::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Online comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Online::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value < other_value;
}

boolean PCC__3GPP__Online::operator<(const PCC__3GPP__Online& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Online::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Online comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Online::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value > other_value;
}

boolean PCC__3GPP__Online::operator>(const PCC__3GPP__Online& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Online::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case DISABLE__ONLINE: return "DISABLE_ONLINE";
case ENABLE__ONLINE: return "ENABLE_ONLINE";
default:
return "<unknown>";
}
}

PCC__3GPP__Online::enum_type PCC__3GPP__Online::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "DISABLE_ONLINE")) return DISABLE__ONLINE;
if (!strcmp(str_par, "ENABLE_ONLINE")) return ENABLE__ONLINE;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Online::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Online::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Online::enum2int(const PCC__3GPP__Online& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Online::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Online::operator PCC__3GPP__Online::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return enum_value;
}

void PCC__3GPP__Online::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Online::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Online");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Online.");
  }
}

void PCC__3GPP__Online::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Online::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Online.", enum_value);
}

void PCC__3GPP__Online::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Online::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Online::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Online::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void PCC__3GPP__Online_template::copy_template(const PCC__3GPP__Online_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Online_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Online_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Online_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template()
{
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Online::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Online::enum_type)other_value;
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(PCC__3GPP__Online::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(const PCC__3GPP__Online& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Online::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
single_value = other_value.enum_value;
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(const OPTIONAL<PCC__3GPP__Online>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Online::enum_type)(const PCC__3GPP__Online&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online from an unbound optional field.");
}
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(PCC__3GPP__Online_template* p_precondition, PCC__3GPP__Online_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(Dynamic_Match_Interface<PCC__3GPP__Online>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Online>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Online_template::PCC__3GPP__Online_template(const PCC__3GPP__Online_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Online_template::~PCC__3GPP__Online_template()
{
clean_up();
}

boolean PCC__3GPP__Online_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Online_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Online::UNBOUND_VALUE;
}

void PCC__3GPP__Online_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(int other_value)
{
if (!PCC__3GPP__Online::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Online::enum_type)other_value;
return *this;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(PCC__3GPP__Online::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(const PCC__3GPP__Online& other_value)
{
if (other_value.enum_value == PCC__3GPP__Online::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Online to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(const OPTIONAL<PCC__3GPP__Online>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Online::enum_type)(const PCC__3GPP__Online&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
return *this;
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::operator=(const PCC__3GPP__Online_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Online_template::match(PCC__3GPP__Online::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
return FALSE;
}

boolean PCC__3GPP__Online_template::match(const PCC__3GPP__Online& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Online::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Online::enum_type PCC__3GPP__Online_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return single_value;
}

void PCC__3GPP__Online_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Online_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
}

PCC__3GPP__Online_template& PCC__3GPP__Online_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Online_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Online::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Online_template::log_match(const PCC__3GPP__Online& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Online_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
}

void PCC__3GPP__Online_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Online::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Online::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Online_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Online.");
}
}

boolean PCC__3GPP__Online_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Online_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Online_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Online_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Online::enum_type enum_val = PCC__3GPP__Online::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Online::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Online.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Online_template* precondition = new PCC__3GPP__Online_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Online_template* implied_template = new PCC__3GPP__Online_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Online_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Online");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Online_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Online");
}

DCA__3GPP__MBMS__Charged__Party::DCA__3GPP__MBMS__Charged__Party()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__MBMS__Charged__Party::DCA__3GPP__MBMS__Charged__Party(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__MBMS__Charged__Party::DCA__3GPP__MBMS__Charged__Party(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__MBMS__Charged__Party::DCA__3GPP__MBMS__Charged__Party(const DCA__3GPP__MBMS__Charged__Party& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
enum_value = other_value.enum_value;
}

DCA__3GPP__MBMS__Charged__Party& DCA__3GPP__MBMS__Charged__Party::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__MBMS__Charged__Party& DCA__3GPP__MBMS__Charged__Party::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__MBMS__Charged__Party& DCA__3GPP__MBMS__Charged__Party::operator=(const DCA__3GPP__MBMS__Charged__Party& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value == other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator==(const DCA__3GPP__MBMS__Charged__Party& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value < other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator<(const DCA__3GPP__MBMS__Charged__Party& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value > other_value;
}

boolean DCA__3GPP__MBMS__Charged__Party::operator>(const DCA__3GPP__MBMS__Charged__Party& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__MBMS__Charged__Party::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CONTENT__PROVIDER: return "CONTENT_PROVIDER";
case SUBSCRIBER: return "SUBSCRIBER";
default:
return "<unknown>";
}
}

DCA__3GPP__MBMS__Charged__Party::enum_type DCA__3GPP__MBMS__Charged__Party::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CONTENT_PROVIDER")) return CONTENT__PROVIDER;
if (!strcmp(str_par, "SUBSCRIBER")) return SUBSCRIBER;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__MBMS__Charged__Party::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__MBMS__Charged__Party::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__MBMS__Charged__Party::enum2int(const DCA__3GPP__MBMS__Charged__Party& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__MBMS__Charged__Party::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__MBMS__Charged__Party::operator DCA__3GPP__MBMS__Charged__Party::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return enum_value;
}

void DCA__3GPP__MBMS__Charged__Party::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__MBMS__Charged__Party::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
  }
}

void DCA__3GPP__MBMS__Charged__Party::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__MBMS__Charged__Party::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", enum_value);
}

void DCA__3GPP__MBMS__Charged__Party::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__MBMS__Charged__Party::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__MBMS__Charged__Party::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__MBMS__Charged__Party::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__MBMS__Charged__Party_template::copy_template(const DCA__3GPP__MBMS__Charged__Party_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__MBMS__Charged__Party_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__MBMS__Charged__Party_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__MBMS__Charged__Party_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template()
{
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__MBMS__Charged__Party::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__MBMS__Charged__Party::enum_type)other_value;
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(DCA__3GPP__MBMS__Charged__Party::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(const DCA__3GPP__MBMS__Charged__Party& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__MBMS__Charged__Party::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
single_value = other_value.enum_value;
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(const OPTIONAL<DCA__3GPP__MBMS__Charged__Party>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__MBMS__Charged__Party::enum_type)(const DCA__3GPP__MBMS__Charged__Party&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party from an unbound optional field.");
}
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(DCA__3GPP__MBMS__Charged__Party_template* p_precondition, DCA__3GPP__MBMS__Charged__Party_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(Dynamic_Match_Interface<DCA__3GPP__MBMS__Charged__Party>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__MBMS__Charged__Party>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__MBMS__Charged__Party_template::DCA__3GPP__MBMS__Charged__Party_template(const DCA__3GPP__MBMS__Charged__Party_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__MBMS__Charged__Party_template::~DCA__3GPP__MBMS__Charged__Party_template()
{
clean_up();
}

boolean DCA__3GPP__MBMS__Charged__Party_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__MBMS__Charged__Party_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__MBMS__Charged__Party::UNBOUND_VALUE;
}

void DCA__3GPP__MBMS__Charged__Party_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(int other_value)
{
if (!DCA__3GPP__MBMS__Charged__Party::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__MBMS__Charged__Party::enum_type)other_value;
return *this;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(DCA__3GPP__MBMS__Charged__Party::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(const DCA__3GPP__MBMS__Charged__Party& other_value)
{
if (other_value.enum_value == DCA__3GPP__MBMS__Charged__Party::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(const OPTIONAL<DCA__3GPP__MBMS__Charged__Party>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__MBMS__Charged__Party::enum_type)(const DCA__3GPP__MBMS__Charged__Party&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
return *this;
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::operator=(const DCA__3GPP__MBMS__Charged__Party_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__MBMS__Charged__Party_template::match(DCA__3GPP__MBMS__Charged__Party::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
return FALSE;
}

boolean DCA__3GPP__MBMS__Charged__Party_template::match(const DCA__3GPP__MBMS__Charged__Party& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__MBMS__Charged__Party::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__MBMS__Charged__Party::enum_type DCA__3GPP__MBMS__Charged__Party_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return single_value;
}

void DCA__3GPP__MBMS__Charged__Party_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__MBMS__Charged__Party_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
}

DCA__3GPP__MBMS__Charged__Party_template& DCA__3GPP__MBMS__Charged__Party_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
return value_list.list_value[list_index];
}

void DCA__3GPP__MBMS__Charged__Party_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__MBMS__Charged__Party::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__MBMS__Charged__Party_template::log_match(const DCA__3GPP__MBMS__Charged__Party& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__MBMS__Charged__Party_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
}

void DCA__3GPP__MBMS__Charged__Party_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__MBMS__Charged__Party::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__MBMS__Charged__Party::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__MBMS__Charged__Party_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
}
}

boolean DCA__3GPP__MBMS__Charged__Party_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__MBMS__Charged__Party_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__MBMS__Charged__Party_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__MBMS__Charged__Party_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__MBMS__Charged__Party::enum_type enum_val = DCA__3GPP__MBMS__Charged__Party::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__MBMS__Charged__Party::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__MBMS__Charged__Party_template* precondition = new DCA__3GPP__MBMS__Charged__Party_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__MBMS__Charged__Party_template* implied_template = new DCA__3GPP__MBMS__Charged__Party_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__MBMS__Charged__Party_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__MBMS__Charged__Party_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_MBMS_Charged_Party");
}

DCA__3GPP__Online__Charging__Flag::DCA__3GPP__Online__Charging__Flag()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Online__Charging__Flag::DCA__3GPP__Online__Charging__Flag(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Online__Charging__Flag::DCA__3GPP__Online__Charging__Flag(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Online__Charging__Flag::DCA__3GPP__Online__Charging__Flag(const DCA__3GPP__Online__Charging__Flag& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Online__Charging__Flag& DCA__3GPP__Online__Charging__Flag::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Online__Charging__Flag& DCA__3GPP__Online__Charging__Flag::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Online__Charging__Flag& DCA__3GPP__Online__Charging__Flag::operator=(const DCA__3GPP__Online__Charging__Flag& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Online__Charging__Flag::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value == other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator==(const DCA__3GPP__Online__Charging__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value < other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator<(const DCA__3GPP__Online__Charging__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value > other_value;
}

boolean DCA__3GPP__Online__Charging__Flag::operator>(const DCA__3GPP__Online__Charging__Flag& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Online__Charging__Flag::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ECF__ADDRESS__NOT__PROVIDED: return "ECF_ADDRESS_NOT_PROVIDED";
case ECF__ADDRESS__PROVIDED: return "ECF_ADDRESS_PROVIDED";
default:
return "<unknown>";
}
}

DCA__3GPP__Online__Charging__Flag::enum_type DCA__3GPP__Online__Charging__Flag::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ECF_ADDRESS_NOT_PROVIDED")) return ECF__ADDRESS__NOT__PROVIDED;
if (!strcmp(str_par, "ECF_ADDRESS_PROVIDED")) return ECF__ADDRESS__PROVIDED;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Online__Charging__Flag::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Online__Charging__Flag::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Online__Charging__Flag::enum2int(const DCA__3GPP__Online__Charging__Flag& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Online__Charging__Flag::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Online__Charging__Flag::operator DCA__3GPP__Online__Charging__Flag::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return enum_value;
}

void DCA__3GPP__Online__Charging__Flag::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Online__Charging__Flag::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Online_Charging_Flag");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
  }
}

void DCA__3GPP__Online__Charging__Flag::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Online__Charging__Flag::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", enum_value);
}

void DCA__3GPP__Online__Charging__Flag::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Online__Charging__Flag::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Online__Charging__Flag::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Online__Charging__Flag::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Online__Charging__Flag_template::copy_template(const DCA__3GPP__Online__Charging__Flag_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Online__Charging__Flag_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Online__Charging__Flag_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Online__Charging__Flag_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template()
{
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Online__Charging__Flag::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Online__Charging__Flag::enum_type)other_value;
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(DCA__3GPP__Online__Charging__Flag::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(const DCA__3GPP__Online__Charging__Flag& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Online__Charging__Flag::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
single_value = other_value.enum_value;
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(const OPTIONAL<DCA__3GPP__Online__Charging__Flag>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Online__Charging__Flag::enum_type)(const DCA__3GPP__Online__Charging__Flag&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag from an unbound optional field.");
}
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(DCA__3GPP__Online__Charging__Flag_template* p_precondition, DCA__3GPP__Online__Charging__Flag_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(Dynamic_Match_Interface<DCA__3GPP__Online__Charging__Flag>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Online__Charging__Flag>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Online__Charging__Flag_template::DCA__3GPP__Online__Charging__Flag_template(const DCA__3GPP__Online__Charging__Flag_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Online__Charging__Flag_template::~DCA__3GPP__Online__Charging__Flag_template()
{
clean_up();
}

boolean DCA__3GPP__Online__Charging__Flag_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Online__Charging__Flag_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Online__Charging__Flag::UNBOUND_VALUE;
}

void DCA__3GPP__Online__Charging__Flag_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(int other_value)
{
if (!DCA__3GPP__Online__Charging__Flag::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Online__Charging__Flag::enum_type)other_value;
return *this;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(DCA__3GPP__Online__Charging__Flag::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(const DCA__3GPP__Online__Charging__Flag& other_value)
{
if (other_value.enum_value == DCA__3GPP__Online__Charging__Flag::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(const OPTIONAL<DCA__3GPP__Online__Charging__Flag>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Online__Charging__Flag::enum_type)(const DCA__3GPP__Online__Charging__Flag&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
return *this;
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::operator=(const DCA__3GPP__Online__Charging__Flag_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Online__Charging__Flag_template::match(DCA__3GPP__Online__Charging__Flag::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
return FALSE;
}

boolean DCA__3GPP__Online__Charging__Flag_template::match(const DCA__3GPP__Online__Charging__Flag& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Online__Charging__Flag::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Online__Charging__Flag::enum_type DCA__3GPP__Online__Charging__Flag_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return single_value;
}

void DCA__3GPP__Online__Charging__Flag_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Online__Charging__Flag_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
}

DCA__3GPP__Online__Charging__Flag_template& DCA__3GPP__Online__Charging__Flag_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Online__Charging__Flag_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Online__Charging__Flag::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Online__Charging__Flag_template::log_match(const DCA__3GPP__Online__Charging__Flag& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Online__Charging__Flag_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
}

void DCA__3GPP__Online__Charging__Flag_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Online__Charging__Flag::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Online__Charging__Flag::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Online__Charging__Flag_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
}
}

boolean DCA__3GPP__Online__Charging__Flag_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Online__Charging__Flag_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Online__Charging__Flag_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Online__Charging__Flag_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Online__Charging__Flag::enum_type enum_val = DCA__3GPP__Online__Charging__Flag::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Online__Charging__Flag::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Online_Charging_Flag.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Online__Charging__Flag_template* precondition = new DCA__3GPP__Online__Charging__Flag_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Online__Charging__Flag_template* implied_template = new DCA__3GPP__Online__Charging__Flag_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Online__Charging__Flag_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Online_Charging_Flag");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Online__Charging__Flag_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Online_Charging_Flag");
}

DCA__3GPP__Access__Transfer__Type::DCA__3GPP__Access__Transfer__Type()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Access__Transfer__Type::DCA__3GPP__Access__Transfer__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Access__Transfer__Type::DCA__3GPP__Access__Transfer__Type(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Access__Transfer__Type::DCA__3GPP__Access__Transfer__Type(const DCA__3GPP__Access__Transfer__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Access__Transfer__Type& DCA__3GPP__Access__Transfer__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Access__Transfer__Type& DCA__3GPP__Access__Transfer__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Access__Transfer__Type& DCA__3GPP__Access__Transfer__Type::operator=(const DCA__3GPP__Access__Transfer__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Access__Transfer__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value == other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator==(const DCA__3GPP__Access__Transfer__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value < other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator<(const DCA__3GPP__Access__Transfer__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value > other_value;
}

boolean DCA__3GPP__Access__Transfer__Type::operator>(const DCA__3GPP__Access__Transfer__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Access__Transfer__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PS__to__CS__Transfer: return "PS_to_CS_Transfer";
case CS__to__PS__Transfer: return "CS_to_PS_Transfer";
case PS__to__PS__Transfer: return "PS_to_PS_Transfer";
case CS__to__CS__Transfer: return "CS_to_CS_Transfer";
default:
return "<unknown>";
}
}

DCA__3GPP__Access__Transfer__Type::enum_type DCA__3GPP__Access__Transfer__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PS_to_CS_Transfer")) return PS__to__CS__Transfer;
if (!strcmp(str_par, "CS_to_PS_Transfer")) return CS__to__PS__Transfer;
if (!strcmp(str_par, "PS_to_PS_Transfer")) return PS__to__PS__Transfer;
if (!strcmp(str_par, "CS_to_CS_Transfer")) return CS__to__CS__Transfer;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Access__Transfer__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Access__Transfer__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Access__Transfer__Type::enum2int(const DCA__3GPP__Access__Transfer__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Access__Transfer__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Access__Transfer__Type::operator DCA__3GPP__Access__Transfer__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return enum_value;
}

void DCA__3GPP__Access__Transfer__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Access__Transfer__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Access_Transfer_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
  }
}

void DCA__3GPP__Access__Transfer__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Access__Transfer__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", enum_value);
}

void DCA__3GPP__Access__Transfer__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Access__Transfer__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Access__Transfer__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Access__Transfer__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Access__Transfer__Type_template::copy_template(const DCA__3GPP__Access__Transfer__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Access__Transfer__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Access__Transfer__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Access__Transfer__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template()
{
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Access__Transfer__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Access__Transfer__Type::enum_type)other_value;
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(DCA__3GPP__Access__Transfer__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(const DCA__3GPP__Access__Transfer__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Access__Transfer__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
single_value = other_value.enum_value;
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(const OPTIONAL<DCA__3GPP__Access__Transfer__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Access__Transfer__Type::enum_type)(const DCA__3GPP__Access__Transfer__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type from an unbound optional field.");
}
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(DCA__3GPP__Access__Transfer__Type_template* p_precondition, DCA__3GPP__Access__Transfer__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(Dynamic_Match_Interface<DCA__3GPP__Access__Transfer__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Access__Transfer__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Access__Transfer__Type_template::DCA__3GPP__Access__Transfer__Type_template(const DCA__3GPP__Access__Transfer__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Access__Transfer__Type_template::~DCA__3GPP__Access__Transfer__Type_template()
{
clean_up();
}

boolean DCA__3GPP__Access__Transfer__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Access__Transfer__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Access__Transfer__Type::UNBOUND_VALUE;
}

void DCA__3GPP__Access__Transfer__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(int other_value)
{
if (!DCA__3GPP__Access__Transfer__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Access__Transfer__Type::enum_type)other_value;
return *this;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(DCA__3GPP__Access__Transfer__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(const DCA__3GPP__Access__Transfer__Type& other_value)
{
if (other_value.enum_value == DCA__3GPP__Access__Transfer__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(const OPTIONAL<DCA__3GPP__Access__Transfer__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Access__Transfer__Type::enum_type)(const DCA__3GPP__Access__Transfer__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
return *this;
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::operator=(const DCA__3GPP__Access__Transfer__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Access__Transfer__Type_template::match(DCA__3GPP__Access__Transfer__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
return FALSE;
}

boolean DCA__3GPP__Access__Transfer__Type_template::match(const DCA__3GPP__Access__Transfer__Type& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Access__Transfer__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Access__Transfer__Type::enum_type DCA__3GPP__Access__Transfer__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return single_value;
}

void DCA__3GPP__Access__Transfer__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Access__Transfer__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
}

DCA__3GPP__Access__Transfer__Type_template& DCA__3GPP__Access__Transfer__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Access__Transfer__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Access__Transfer__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Access__Transfer__Type_template::log_match(const DCA__3GPP__Access__Transfer__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Access__Transfer__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
}

void DCA__3GPP__Access__Transfer__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Access__Transfer__Type::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Access__Transfer__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Access__Transfer__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
}
}

boolean DCA__3GPP__Access__Transfer__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Access__Transfer__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Access__Transfer__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Access__Transfer__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Access__Transfer__Type::enum_type enum_val = DCA__3GPP__Access__Transfer__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Access__Transfer__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Access_Transfer_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Access__Transfer__Type_template* precondition = new DCA__3GPP__Access__Transfer__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Access__Transfer__Type_template* implied_template = new DCA__3GPP__Access__Transfer__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Access__Transfer__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Access_Transfer_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Access__Transfer__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Access_Transfer_Type");
}

DCA__3GPP__Inter__UE__Transfer::DCA__3GPP__Inter__UE__Transfer()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Inter__UE__Transfer::DCA__3GPP__Inter__UE__Transfer(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Inter__UE__Transfer::DCA__3GPP__Inter__UE__Transfer(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Inter__UE__Transfer::DCA__3GPP__Inter__UE__Transfer(const DCA__3GPP__Inter__UE__Transfer& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Inter__UE__Transfer& DCA__3GPP__Inter__UE__Transfer::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Inter__UE__Transfer& DCA__3GPP__Inter__UE__Transfer::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Inter__UE__Transfer& DCA__3GPP__Inter__UE__Transfer::operator=(const DCA__3GPP__Inter__UE__Transfer& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value == other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator==(const DCA__3GPP__Inter__UE__Transfer& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value < other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator<(const DCA__3GPP__Inter__UE__Transfer& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value > other_value;
}

boolean DCA__3GPP__Inter__UE__Transfer::operator>(const DCA__3GPP__Inter__UE__Transfer& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Inter__UE__Transfer::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case INTRA__UE__TRANSFER: return "INTRA_UE_TRANSFER";
case INTER__UE__TRANSFER: return "INTER_UE_TRANSFER";
default:
return "<unknown>";
}
}

DCA__3GPP__Inter__UE__Transfer::enum_type DCA__3GPP__Inter__UE__Transfer::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "INTRA_UE_TRANSFER")) return INTRA__UE__TRANSFER;
if (!strcmp(str_par, "INTER_UE_TRANSFER")) return INTER__UE__TRANSFER;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Inter__UE__Transfer::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Inter__UE__Transfer::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Inter__UE__Transfer::enum2int(const DCA__3GPP__Inter__UE__Transfer& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Inter__UE__Transfer::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Inter__UE__Transfer::operator DCA__3GPP__Inter__UE__Transfer::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return enum_value;
}

void DCA__3GPP__Inter__UE__Transfer::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Inter__UE__Transfer::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
  }
}

void DCA__3GPP__Inter__UE__Transfer::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Inter__UE__Transfer::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", enum_value);
}

void DCA__3GPP__Inter__UE__Transfer::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Inter__UE__Transfer::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Inter__UE__Transfer::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Inter__UE__Transfer::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__Inter__UE__Transfer_template::copy_template(const DCA__3GPP__Inter__UE__Transfer_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Inter__UE__Transfer_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Inter__UE__Transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Inter__UE__Transfer_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template()
{
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Inter__UE__Transfer::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Inter__UE__Transfer::enum_type)other_value;
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(DCA__3GPP__Inter__UE__Transfer::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(const DCA__3GPP__Inter__UE__Transfer& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Inter__UE__Transfer::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
single_value = other_value.enum_value;
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(const OPTIONAL<DCA__3GPP__Inter__UE__Transfer>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Inter__UE__Transfer::enum_type)(const DCA__3GPP__Inter__UE__Transfer&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer from an unbound optional field.");
}
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(DCA__3GPP__Inter__UE__Transfer_template* p_precondition, DCA__3GPP__Inter__UE__Transfer_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(Dynamic_Match_Interface<DCA__3GPP__Inter__UE__Transfer>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Inter__UE__Transfer>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Inter__UE__Transfer_template::DCA__3GPP__Inter__UE__Transfer_template(const DCA__3GPP__Inter__UE__Transfer_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Inter__UE__Transfer_template::~DCA__3GPP__Inter__UE__Transfer_template()
{
clean_up();
}

boolean DCA__3GPP__Inter__UE__Transfer_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Inter__UE__Transfer_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Inter__UE__Transfer::UNBOUND_VALUE;
}

void DCA__3GPP__Inter__UE__Transfer_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(int other_value)
{
if (!DCA__3GPP__Inter__UE__Transfer::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Inter__UE__Transfer::enum_type)other_value;
return *this;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(DCA__3GPP__Inter__UE__Transfer::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(const DCA__3GPP__Inter__UE__Transfer& other_value)
{
if (other_value.enum_value == DCA__3GPP__Inter__UE__Transfer::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(const OPTIONAL<DCA__3GPP__Inter__UE__Transfer>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Inter__UE__Transfer::enum_type)(const DCA__3GPP__Inter__UE__Transfer&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
return *this;
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::operator=(const DCA__3GPP__Inter__UE__Transfer_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Inter__UE__Transfer_template::match(DCA__3GPP__Inter__UE__Transfer::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
return FALSE;
}

boolean DCA__3GPP__Inter__UE__Transfer_template::match(const DCA__3GPP__Inter__UE__Transfer& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Inter__UE__Transfer::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Inter__UE__Transfer::enum_type DCA__3GPP__Inter__UE__Transfer_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return single_value;
}

void DCA__3GPP__Inter__UE__Transfer_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Inter__UE__Transfer_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
}

DCA__3GPP__Inter__UE__Transfer_template& DCA__3GPP__Inter__UE__Transfer_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Inter__UE__Transfer_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Inter__UE__Transfer::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Inter__UE__Transfer_template::log_match(const DCA__3GPP__Inter__UE__Transfer& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Inter__UE__Transfer_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
}

void DCA__3GPP__Inter__UE__Transfer_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Inter__UE__Transfer::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Inter__UE__Transfer::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Inter__UE__Transfer_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
}
}

boolean DCA__3GPP__Inter__UE__Transfer_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Inter__UE__Transfer_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Inter__UE__Transfer_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Inter__UE__Transfer_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Inter__UE__Transfer::enum_type enum_val = DCA__3GPP__Inter__UE__Transfer::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Inter__UE__Transfer::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Inter__UE__Transfer_template* precondition = new DCA__3GPP__Inter__UE__Transfer_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Inter__UE__Transfer_template* implied_template = new DCA__3GPP__Inter__UE__Transfer_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Inter__UE__Transfer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Inter__UE__Transfer_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Inter_UE_Transfer");
}

BASE__NONE__Termination__Cause::BASE__NONE__Termination__Cause()
{
enum_value = UNBOUND_VALUE;
}

BASE__NONE__Termination__Cause::BASE__NONE__Termination__Cause(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

BASE__NONE__Termination__Cause::BASE__NONE__Termination__Cause(enum_type other_value)
{
enum_value = other_value;
}

BASE__NONE__Termination__Cause::BASE__NONE__Termination__Cause(const BASE__NONE__Termination__Cause& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
enum_value = other_value.enum_value;
}

BASE__NONE__Termination__Cause& BASE__NONE__Termination__Cause::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

BASE__NONE__Termination__Cause& BASE__NONE__Termination__Cause::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

BASE__NONE__Termination__Cause& BASE__NONE__Termination__Cause::operator=(const BASE__NONE__Termination__Cause& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
enum_value = other_value.enum_value;
return *this;
}

boolean BASE__NONE__Termination__Cause::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean BASE__NONE__Termination__Cause::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value == other_value;
}

boolean BASE__NONE__Termination__Cause::operator==(const BASE__NONE__Termination__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value == other_value.enum_value;
}

boolean BASE__NONE__Termination__Cause::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean BASE__NONE__Termination__Cause::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value < other_value;
}

boolean BASE__NONE__Termination__Cause::operator<(const BASE__NONE__Termination__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value < other_value.enum_value;
}

boolean BASE__NONE__Termination__Cause::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean BASE__NONE__Termination__Cause::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value > other_value;
}

boolean BASE__NONE__Termination__Cause::operator>(const BASE__NONE__Termination__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value > other_value.enum_value;
}

const char *BASE__NONE__Termination__Cause::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case DIAMETER__LOGOUT: return "DIAMETER_LOGOUT";
case DIAMETER__SERVICE__NOT__PROVIDED: return "DIAMETER_SERVICE_NOT_PROVIDED";
case DIAMETER__BAD__ANSWER: return "DIAMETER_BAD_ANSWER";
case DIAMETER__ADMINISTRATIVE: return "DIAMETER_ADMINISTRATIVE";
case DIAMETER__LINK__BROKEN: return "DIAMETER_LINK_BROKEN";
case DIAMETER__AUTH__EXPIRED: return "DIAMETER_AUTH_EXPIRED";
case DIAMETER__USER__MOVED: return "DIAMETER_USER_MOVED";
case DIAMETER__SESSION__TIMEOUT: return "DIAMETER_SESSION_TIMEOUT";
default:
return "<unknown>";
}
}

BASE__NONE__Termination__Cause::enum_type BASE__NONE__Termination__Cause::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "DIAMETER_LOGOUT")) return DIAMETER__LOGOUT;
if (!strcmp(str_par, "DIAMETER_SERVICE_NOT_PROVIDED")) return DIAMETER__SERVICE__NOT__PROVIDED;
if (!strcmp(str_par, "DIAMETER_BAD_ANSWER")) return DIAMETER__BAD__ANSWER;
if (!strcmp(str_par, "DIAMETER_ADMINISTRATIVE")) return DIAMETER__ADMINISTRATIVE;
if (!strcmp(str_par, "DIAMETER_LINK_BROKEN")) return DIAMETER__LINK__BROKEN;
if (!strcmp(str_par, "DIAMETER_AUTH_EXPIRED")) return DIAMETER__AUTH__EXPIRED;
if (!strcmp(str_par, "DIAMETER_USER_MOVED")) return DIAMETER__USER__MOVED;
if (!strcmp(str_par, "DIAMETER_SESSION_TIMEOUT")) return DIAMETER__SESSION__TIMEOUT;
}
return UNKNOWN_VALUE;
}

boolean BASE__NONE__Termination__Cause::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
return TRUE;
default:
return FALSE;
}
}

int BASE__NONE__Termination__Cause::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int BASE__NONE__Termination__Cause::enum2int(const BASE__NONE__Termination__Cause& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void BASE__NONE__Termination__Cause::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", int_val);
enum_value = (enum_type)int_val;
}

BASE__NONE__Termination__Cause::operator BASE__NONE__Termination__Cause::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return enum_value;
}

void BASE__NONE__Termination__Cause::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void BASE__NONE__Termination__Cause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.BASE_NONE_Termination_Cause");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
  }
}

void BASE__NONE__Termination__Cause::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
text_buf.push_int(enum_value);
}

void BASE__NONE__Termination__Cause::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", enum_value);
}

void BASE__NONE__Termination__Cause::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void BASE__NONE__Termination__Cause::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int BASE__NONE__Termination__Cause::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 4, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int BASE__NONE__Termination__Cause::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 4);
}

void BASE__NONE__Termination__Cause_template::copy_template(const BASE__NONE__Termination__Cause_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BASE__NONE__Termination__Cause_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new BASE__NONE__Termination__Cause_template(*other_value.implication_.precondition);
implication_.implied_template = new BASE__NONE__Termination__Cause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template()
{
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!BASE__NONE__Termination__Cause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause with unknown numeric value %d.", other_value);
single_value = (BASE__NONE__Termination__Cause::enum_type)other_value;
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(BASE__NONE__Termination__Cause::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(const BASE__NONE__Termination__Cause& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == BASE__NONE__Termination__Cause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
single_value = other_value.enum_value;
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(const OPTIONAL<BASE__NONE__Termination__Cause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BASE__NONE__Termination__Cause::enum_type)(const BASE__NONE__Termination__Cause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause from an unbound optional field.");
}
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(BASE__NONE__Termination__Cause_template* p_precondition, BASE__NONE__Termination__Cause_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(Dynamic_Match_Interface<BASE__NONE__Termination__Cause>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<BASE__NONE__Termination__Cause>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

BASE__NONE__Termination__Cause_template::BASE__NONE__Termination__Cause_template(const BASE__NONE__Termination__Cause_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

BASE__NONE__Termination__Cause_template::~BASE__NONE__Termination__Cause_template()
{
clean_up();
}

boolean BASE__NONE__Termination__Cause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean BASE__NONE__Termination__Cause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != BASE__NONE__Termination__Cause::UNBOUND_VALUE;
}

void BASE__NONE__Termination__Cause_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(int other_value)
{
if (!BASE__NONE__Termination__Cause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (BASE__NONE__Termination__Cause::enum_type)other_value;
return *this;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(BASE__NONE__Termination__Cause::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(const BASE__NONE__Termination__Cause& other_value)
{
if (other_value.enum_value == BASE__NONE__Termination__Cause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(const OPTIONAL<BASE__NONE__Termination__Cause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BASE__NONE__Termination__Cause::enum_type)(const BASE__NONE__Termination__Cause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
return *this;
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::operator=(const BASE__NONE__Termination__Cause_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean BASE__NONE__Termination__Cause_template::match(BASE__NONE__Termination__Cause::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
return FALSE;
}

boolean BASE__NONE__Termination__Cause_template::match(const BASE__NONE__Termination__Cause& other_value, boolean) const
{
if (other_value.enum_value == BASE__NONE__Termination__Cause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause with an unbound value.");
return match(other_value.enum_value);
}

BASE__NONE__Termination__Cause::enum_type BASE__NONE__Termination__Cause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return single_value;
}

void BASE__NONE__Termination__Cause_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BASE__NONE__Termination__Cause_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
}

BASE__NONE__Termination__Cause_template& BASE__NONE__Termination__Cause_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
return value_list.list_value[list_index];
}

void BASE__NONE__Termination__Cause_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(BASE__NONE__Termination__Cause::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void BASE__NONE__Termination__Cause_template::log_match(const BASE__NONE__Termination__Cause& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void BASE__NONE__Termination__Cause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
}

void BASE__NONE__Termination__Cause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (BASE__NONE__Termination__Cause::enum_type)text_buf.pull_int().get_val();
if (!BASE__NONE__Termination__Cause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BASE__NONE__Termination__Cause_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
}
}

boolean BASE__NONE__Termination__Cause_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean BASE__NONE__Termination__Cause_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void BASE__NONE__Termination__Cause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    BASE__NONE__Termination__Cause_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    BASE__NONE__Termination__Cause::enum_type enum_val = BASE__NONE__Termination__Cause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!BASE__NONE__Termination__Cause::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.BASE_NONE_Termination_Cause.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    BASE__NONE__Termination__Cause_template* precondition = new BASE__NONE__Termination__Cause_template;
    precondition->set_param(*m_p->get_elem(0));
    BASE__NONE__Termination__Cause_template* implied_template = new BASE__NONE__Termination__Cause_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = BASE__NONE__Termination__Cause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.BASE_NONE_Termination_Cause");
  }
  is_ifpresent = param.get_ifpresent();
}

void BASE__NONE__Termination__Cause_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.BASE_NONE_Termination_Cause");
}

DCA__3GPP__Class__Identifier::DCA__3GPP__Class__Identifier()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__Class__Identifier::DCA__3GPP__Class__Identifier(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__Class__Identifier::DCA__3GPP__Class__Identifier(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__Class__Identifier::DCA__3GPP__Class__Identifier(const DCA__3GPP__Class__Identifier& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
enum_value = other_value.enum_value;
}

DCA__3GPP__Class__Identifier& DCA__3GPP__Class__Identifier::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__Class__Identifier& DCA__3GPP__Class__Identifier::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__Class__Identifier& DCA__3GPP__Class__Identifier::operator=(const DCA__3GPP__Class__Identifier& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__Class__Identifier::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__Class__Identifier::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value == other_value;
}

boolean DCA__3GPP__Class__Identifier::operator==(const DCA__3GPP__Class__Identifier& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__Class__Identifier::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__Class__Identifier::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value < other_value;
}

boolean DCA__3GPP__Class__Identifier::operator<(const DCA__3GPP__Class__Identifier& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__Class__Identifier::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__Class__Identifier::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value > other_value;
}

boolean DCA__3GPP__Class__Identifier::operator>(const DCA__3GPP__Class__Identifier& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__Class__Identifier::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PERSONAL: return "PERSONAL";
case ADVERTISMENT: return "ADVERTISMENT";
case INFORMATIONAL: return "INFORMATIONAL";
case AUTO: return "AUTO";
default:
return "<unknown>";
}
}

DCA__3GPP__Class__Identifier::enum_type DCA__3GPP__Class__Identifier::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PERSONAL")) return PERSONAL;
if (!strcmp(str_par, "ADVERTISMENT")) return ADVERTISMENT;
if (!strcmp(str_par, "INFORMATIONAL")) return INFORMATIONAL;
if (!strcmp(str_par, "AUTO")) return AUTO;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__Class__Identifier::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__Class__Identifier::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__Class__Identifier::enum2int(const DCA__3GPP__Class__Identifier& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__Class__Identifier::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__Class__Identifier::operator DCA__3GPP__Class__Identifier::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return enum_value;
}

void DCA__3GPP__Class__Identifier::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__Class__Identifier::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_Class_Identifier");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
  }
}

void DCA__3GPP__Class__Identifier::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__Class__Identifier::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", enum_value);
}

void DCA__3GPP__Class__Identifier::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__Class__Identifier::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__Class__Identifier::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__Class__Identifier::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__Class__Identifier_template::copy_template(const DCA__3GPP__Class__Identifier_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__Class__Identifier_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__Class__Identifier_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__Class__Identifier_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template()
{
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__Class__Identifier::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__Class__Identifier::enum_type)other_value;
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(DCA__3GPP__Class__Identifier::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(const DCA__3GPP__Class__Identifier& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__Class__Identifier::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
single_value = other_value.enum_value;
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(const OPTIONAL<DCA__3GPP__Class__Identifier>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Class__Identifier::enum_type)(const DCA__3GPP__Class__Identifier&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier from an unbound optional field.");
}
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(DCA__3GPP__Class__Identifier_template* p_precondition, DCA__3GPP__Class__Identifier_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(Dynamic_Match_Interface<DCA__3GPP__Class__Identifier>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__Class__Identifier>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__Class__Identifier_template::DCA__3GPP__Class__Identifier_template(const DCA__3GPP__Class__Identifier_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__Class__Identifier_template::~DCA__3GPP__Class__Identifier_template()
{
clean_up();
}

boolean DCA__3GPP__Class__Identifier_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__Class__Identifier_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__Class__Identifier::UNBOUND_VALUE;
}

void DCA__3GPP__Class__Identifier_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(int other_value)
{
if (!DCA__3GPP__Class__Identifier::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Class__Identifier::enum_type)other_value;
return *this;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(DCA__3GPP__Class__Identifier::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(const DCA__3GPP__Class__Identifier& other_value)
{
if (other_value.enum_value == DCA__3GPP__Class__Identifier::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(const OPTIONAL<DCA__3GPP__Class__Identifier>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__Class__Identifier::enum_type)(const DCA__3GPP__Class__Identifier&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
return *this;
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::operator=(const DCA__3GPP__Class__Identifier_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__Class__Identifier_template::match(DCA__3GPP__Class__Identifier::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
return FALSE;
}

boolean DCA__3GPP__Class__Identifier_template::match(const DCA__3GPP__Class__Identifier& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__Class__Identifier::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__Class__Identifier::enum_type DCA__3GPP__Class__Identifier_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return single_value;
}

void DCA__3GPP__Class__Identifier_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__Class__Identifier_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
}

DCA__3GPP__Class__Identifier_template& DCA__3GPP__Class__Identifier_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
return value_list.list_value[list_index];
}

void DCA__3GPP__Class__Identifier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__Class__Identifier::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__Class__Identifier_template::log_match(const DCA__3GPP__Class__Identifier& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__Class__Identifier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
}

void DCA__3GPP__Class__Identifier_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__Class__Identifier::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__Class__Identifier::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__Class__Identifier_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
}
}

boolean DCA__3GPP__Class__Identifier_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__Class__Identifier_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__Class__Identifier_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__Class__Identifier_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__Class__Identifier::enum_type enum_val = DCA__3GPP__Class__Identifier::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__Class__Identifier::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_Class_Identifier.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__Class__Identifier_template* precondition = new DCA__3GPP__Class__Identifier_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__Class__Identifier_template* implied_template = new DCA__3GPP__Class__Identifier_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__Class__Identifier_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_Class_Identifier");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__Class__Identifier_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_Class_Identifier");
}

RX__3GPP__Specific__Action::RX__3GPP__Specific__Action()
{
enum_value = UNBOUND_VALUE;
}

RX__3GPP__Specific__Action::RX__3GPP__Specific__Action(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

RX__3GPP__Specific__Action::RX__3GPP__Specific__Action(enum_type other_value)
{
enum_value = other_value;
}

RX__3GPP__Specific__Action::RX__3GPP__Specific__Action(const RX__3GPP__Specific__Action& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
enum_value = other_value.enum_value;
}

RX__3GPP__Specific__Action& RX__3GPP__Specific__Action::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

RX__3GPP__Specific__Action& RX__3GPP__Specific__Action::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

RX__3GPP__Specific__Action& RX__3GPP__Specific__Action::operator=(const RX__3GPP__Specific__Action& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
enum_value = other_value.enum_value;
return *this;
}

boolean RX__3GPP__Specific__Action::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean RX__3GPP__Specific__Action::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value == other_value;
}

boolean RX__3GPP__Specific__Action::operator==(const RX__3GPP__Specific__Action& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value == other_value.enum_value;
}

boolean RX__3GPP__Specific__Action::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean RX__3GPP__Specific__Action::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value < other_value;
}

boolean RX__3GPP__Specific__Action::operator<(const RX__3GPP__Specific__Action& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value < other_value.enum_value;
}

boolean RX__3GPP__Specific__Action::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean RX__3GPP__Specific__Action::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value > other_value;
}

boolean RX__3GPP__Specific__Action::operator>(const RX__3GPP__Specific__Action& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value > other_value.enum_value;
}

const char *RX__3GPP__Specific__Action::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CHARGING__CORRELATION__EXCHANGE: return "CHARGING_CORRELATION_EXCHANGE";
case INDICATION__OF__LOSS__OF__BEARER: return "INDICATION_OF_LOSS_OF_BEARER";
case INDICATION__OF__RECOVERY__OF__BEARER: return "INDICATION_OF_RECOVERY_OF_BEARER";
case INDICATION__OF__RELEASE__OF__BEARER: return "INDICATION_OF_RELEASE_OF_BEARER";
case INDICATION__OF__ESTABLISHMENT__OF__BEARER: return "INDICATION_OF_ESTABLISHMENT_OF_BEARER";
case IP__CAN__CHANGE: return "IP_CAN_CHANGE";
case INDICATION__OF__OUT__OF__CREDIT: return "INDICATION_OF_OUT_OF_CREDIT";
case INDICATION__OF__SUCCESSFUL__RESOURCES__ALLOCATION: return "INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION";
case INDICATION__OF__FAILED__RESOURCES__ALLOCATION: return "INDICATION_OF_FAILED_RESOURCES_ALLOCATION";
case INDICATION__OF__LIMITED__PCC__DEPLOYMENT: return "INDICATION_OF_LIMITED_PCC_DEPLOYMENT";
case USAGE__REPORT: return "USAGE_REPORT";
case ACCESS__NETWORK__INFO__REPORT: return "ACCESS_NETWORK_INFO_REPORT";
case INDICATION__OF__RECOVERY__FROM__LIMITED__PCC__DEPLOYMENT: return "INDICATION_OF_RECOVERY_FROM_LIMITED_PCC_DEPLOYMENT";
case INDICATION__OF__ACCESS__NETWORK__INFO__REPORTING__FAILURE: return "INDICATION_OF_ACCESS_NETWORK_INFO_REPORTING_FAILURE";
case INDICATION__OF__TRANSFER__POLICY__EXPIRED: return "INDICATION_OF_TRANSFER_POLICY_EXPIRED";
case PLMN__CHANGE: return "PLMN_CHANGE";
default:
return "<unknown>";
}
}

RX__3GPP__Specific__Action::enum_type RX__3GPP__Specific__Action::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CHARGING_CORRELATION_EXCHANGE")) return CHARGING__CORRELATION__EXCHANGE;
if (!strcmp(str_par, "INDICATION_OF_LOSS_OF_BEARER")) return INDICATION__OF__LOSS__OF__BEARER;
if (!strcmp(str_par, "INDICATION_OF_RECOVERY_OF_BEARER")) return INDICATION__OF__RECOVERY__OF__BEARER;
if (!strcmp(str_par, "INDICATION_OF_RELEASE_OF_BEARER")) return INDICATION__OF__RELEASE__OF__BEARER;
if (!strcmp(str_par, "INDICATION_OF_ESTABLISHMENT_OF_BEARER")) return INDICATION__OF__ESTABLISHMENT__OF__BEARER;
if (!strcmp(str_par, "IP_CAN_CHANGE")) return IP__CAN__CHANGE;
if (!strcmp(str_par, "INDICATION_OF_OUT_OF_CREDIT")) return INDICATION__OF__OUT__OF__CREDIT;
if (!strcmp(str_par, "INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION")) return INDICATION__OF__SUCCESSFUL__RESOURCES__ALLOCATION;
if (!strcmp(str_par, "INDICATION_OF_FAILED_RESOURCES_ALLOCATION")) return INDICATION__OF__FAILED__RESOURCES__ALLOCATION;
if (!strcmp(str_par, "INDICATION_OF_LIMITED_PCC_DEPLOYMENT")) return INDICATION__OF__LIMITED__PCC__DEPLOYMENT;
if (!strcmp(str_par, "USAGE_REPORT")) return USAGE__REPORT;
if (!strcmp(str_par, "ACCESS_NETWORK_INFO_REPORT")) return ACCESS__NETWORK__INFO__REPORT;
if (!strcmp(str_par, "INDICATION_OF_RECOVERY_FROM_LIMITED_PCC_DEPLOYMENT")) return INDICATION__OF__RECOVERY__FROM__LIMITED__PCC__DEPLOYMENT;
if (!strcmp(str_par, "INDICATION_OF_ACCESS_NETWORK_INFO_REPORTING_FAILURE")) return INDICATION__OF__ACCESS__NETWORK__INFO__REPORTING__FAILURE;
if (!strcmp(str_par, "INDICATION_OF_TRANSFER_POLICY_EXPIRED")) return INDICATION__OF__TRANSFER__POLICY__EXPIRED;
if (!strcmp(str_par, "PLMN_CHANGE")) return PLMN__CHANGE;
}
return UNKNOWN_VALUE;
}

boolean RX__3GPP__Specific__Action::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
return TRUE;
default:
return FALSE;
}
}

int RX__3GPP__Specific__Action::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RX__3GPP__Specific__Action::enum2int(const RX__3GPP__Specific__Action& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void RX__3GPP__Specific__Action::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", int_val);
enum_value = (enum_type)int_val;
}

RX__3GPP__Specific__Action::operator RX__3GPP__Specific__Action::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return enum_value;
}

void RX__3GPP__Specific__Action::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void RX__3GPP__Specific__Action::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.RX_3GPP_Specific_Action");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_Specific_Action.");
  }
}

void RX__3GPP__Specific__Action::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
text_buf.push_int(enum_value);
}

void RX__3GPP__Specific__Action::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", enum_value);
}

void RX__3GPP__Specific__Action::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RX__3GPP__Specific__Action::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RX__3GPP__Specific__Action::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 5, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RX__3GPP__Specific__Action::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 5);
}

void RX__3GPP__Specific__Action_template::copy_template(const RX__3GPP__Specific__Action_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RX__3GPP__Specific__Action_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RX__3GPP__Specific__Action_template(*other_value.implication_.precondition);
implication_.implied_template = new RX__3GPP__Specific__Action_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template()
{
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!RX__3GPP__Specific__Action::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action with unknown numeric value %d.", other_value);
single_value = (RX__3GPP__Specific__Action::enum_type)other_value;
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(RX__3GPP__Specific__Action::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(const RX__3GPP__Specific__Action& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RX__3GPP__Specific__Action::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
single_value = other_value.enum_value;
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(const OPTIONAL<RX__3GPP__Specific__Action>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Specific__Action::enum_type)(const RX__3GPP__Specific__Action&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action from an unbound optional field.");
}
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(RX__3GPP__Specific__Action_template* p_precondition, RX__3GPP__Specific__Action_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(Dynamic_Match_Interface<RX__3GPP__Specific__Action>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RX__3GPP__Specific__Action>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RX__3GPP__Specific__Action_template::RX__3GPP__Specific__Action_template(const RX__3GPP__Specific__Action_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

RX__3GPP__Specific__Action_template::~RX__3GPP__Specific__Action_template()
{
clean_up();
}

boolean RX__3GPP__Specific__Action_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean RX__3GPP__Specific__Action_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != RX__3GPP__Specific__Action::UNBOUND_VALUE;
}

void RX__3GPP__Specific__Action_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(int other_value)
{
if (!RX__3GPP__Specific__Action::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Specific__Action::enum_type)other_value;
return *this;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(RX__3GPP__Specific__Action::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(const RX__3GPP__Specific__Action& other_value)
{
if (other_value.enum_value == RX__3GPP__Specific__Action::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(const OPTIONAL<RX__3GPP__Specific__Action>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__Specific__Action::enum_type)(const RX__3GPP__Specific__Action&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
return *this;
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::operator=(const RX__3GPP__Specific__Action_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RX__3GPP__Specific__Action_template::match(RX__3GPP__Specific__Action::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
return FALSE;
}

boolean RX__3GPP__Specific__Action_template::match(const RX__3GPP__Specific__Action& other_value, boolean) const
{
if (other_value.enum_value == RX__3GPP__Specific__Action::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action with an unbound value.");
return match(other_value.enum_value);
}

RX__3GPP__Specific__Action::enum_type RX__3GPP__Specific__Action_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return single_value;
}

void RX__3GPP__Specific__Action_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RX__3GPP__Specific__Action_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
}

RX__3GPP__Specific__Action_template& RX__3GPP__Specific__Action_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
return value_list.list_value[list_index];
}

void RX__3GPP__Specific__Action_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RX__3GPP__Specific__Action::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RX__3GPP__Specific__Action_template::log_match(const RX__3GPP__Specific__Action& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void RX__3GPP__Specific__Action_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
}

void RX__3GPP__Specific__Action_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RX__3GPP__Specific__Action::enum_type)text_buf.pull_int().get_val();
if (!RX__3GPP__Specific__Action::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RX__3GPP__Specific__Action_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_Specific_Action.");
}
}

boolean RX__3GPP__Specific__Action_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RX__3GPP__Specific__Action_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void RX__3GPP__Specific__Action_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RX__3GPP__Specific__Action_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    RX__3GPP__Specific__Action::enum_type enum_val = RX__3GPP__Specific__Action::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RX__3GPP__Specific__Action::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_Specific_Action.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RX__3GPP__Specific__Action_template* precondition = new RX__3GPP__Specific__Action_template;
    precondition->set_param(*m_p->get_elem(0));
    RX__3GPP__Specific__Action_template* implied_template = new RX__3GPP__Specific__Action_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RX__3GPP__Specific__Action_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.RX_3GPP_Specific_Action");
  }
  is_ifpresent = param.get_ifpresent();
}

void RX__3GPP__Specific__Action_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.RX_3GPP_Specific_Action");
}

DCA__3GPP__ProSe__Role__Of__UE::DCA__3GPP__ProSe__Role__Of__UE()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__ProSe__Role__Of__UE::DCA__3GPP__ProSe__Role__Of__UE(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__ProSe__Role__Of__UE::DCA__3GPP__ProSe__Role__Of__UE(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__ProSe__Role__Of__UE::DCA__3GPP__ProSe__Role__Of__UE(const DCA__3GPP__ProSe__Role__Of__UE& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
enum_value = other_value.enum_value;
}

DCA__3GPP__ProSe__Role__Of__UE& DCA__3GPP__ProSe__Role__Of__UE::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE& DCA__3GPP__ProSe__Role__Of__UE::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE& DCA__3GPP__ProSe__Role__Of__UE::operator=(const DCA__3GPP__ProSe__Role__Of__UE& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value == other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator==(const DCA__3GPP__ProSe__Role__Of__UE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value < other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator<(const DCA__3GPP__ProSe__Role__Of__UE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value > other_value;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::operator>(const DCA__3GPP__ProSe__Role__Of__UE& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__ProSe__Role__Of__UE::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ANNOUNCING__UE: return "ANNOUNCING_UE";
case MONITORING__UE: return "MONITORING_UE";
case REQUESTOR__UE: return "REQUESTOR_UE";
case REQUESTED__UE: return "REQUESTED_UE";
default:
return "<unknown>";
}
}

DCA__3GPP__ProSe__Role__Of__UE::enum_type DCA__3GPP__ProSe__Role__Of__UE::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ANNOUNCING_UE")) return ANNOUNCING__UE;
if (!strcmp(str_par, "MONITORING_UE")) return MONITORING__UE;
if (!strcmp(str_par, "REQUESTOR_UE")) return REQUESTOR__UE;
if (!strcmp(str_par, "REQUESTED_UE")) return REQUESTED__UE;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__ProSe__Role__Of__UE::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__ProSe__Role__Of__UE::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__ProSe__Role__Of__UE::enum2int(const DCA__3GPP__ProSe__Role__Of__UE& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__ProSe__Role__Of__UE::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__ProSe__Role__Of__UE::operator DCA__3GPP__ProSe__Role__Of__UE::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return enum_value;
}

void DCA__3GPP__ProSe__Role__Of__UE::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__ProSe__Role__Of__UE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
  }
}

void DCA__3GPP__ProSe__Role__Of__UE::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__ProSe__Role__Of__UE::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", enum_value);
}

void DCA__3GPP__ProSe__Role__Of__UE::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__ProSe__Role__Of__UE::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__ProSe__Role__Of__UE::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__ProSe__Role__Of__UE::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__ProSe__Role__Of__UE_template::copy_template(const DCA__3GPP__ProSe__Role__Of__UE_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__ProSe__Role__Of__UE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__ProSe__Role__Of__UE_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__ProSe__Role__Of__UE_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template()
{
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__ProSe__Role__Of__UE::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__ProSe__Role__Of__UE::enum_type)other_value;
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(DCA__3GPP__ProSe__Role__Of__UE::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(const DCA__3GPP__ProSe__Role__Of__UE& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__ProSe__Role__Of__UE::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
single_value = other_value.enum_value;
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(const OPTIONAL<DCA__3GPP__ProSe__Role__Of__UE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__ProSe__Role__Of__UE::enum_type)(const DCA__3GPP__ProSe__Role__Of__UE&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE from an unbound optional field.");
}
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(DCA__3GPP__ProSe__Role__Of__UE_template* p_precondition, DCA__3GPP__ProSe__Role__Of__UE_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(Dynamic_Match_Interface<DCA__3GPP__ProSe__Role__Of__UE>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__ProSe__Role__Of__UE>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__ProSe__Role__Of__UE_template::DCA__3GPP__ProSe__Role__Of__UE_template(const DCA__3GPP__ProSe__Role__Of__UE_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__ProSe__Role__Of__UE_template::~DCA__3GPP__ProSe__Role__Of__UE_template()
{
clean_up();
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__ProSe__Role__Of__UE::UNBOUND_VALUE;
}

void DCA__3GPP__ProSe__Role__Of__UE_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(int other_value)
{
if (!DCA__3GPP__ProSe__Role__Of__UE::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__ProSe__Role__Of__UE::enum_type)other_value;
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(DCA__3GPP__ProSe__Role__Of__UE::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(const DCA__3GPP__ProSe__Role__Of__UE& other_value)
{
if (other_value.enum_value == DCA__3GPP__ProSe__Role__Of__UE::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(const OPTIONAL<DCA__3GPP__ProSe__Role__Of__UE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__ProSe__Role__Of__UE::enum_type)(const DCA__3GPP__ProSe__Role__Of__UE&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
return *this;
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::operator=(const DCA__3GPP__ProSe__Role__Of__UE_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::match(DCA__3GPP__ProSe__Role__Of__UE::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
return FALSE;
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::match(const DCA__3GPP__ProSe__Role__Of__UE& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__ProSe__Role__Of__UE::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__ProSe__Role__Of__UE::enum_type DCA__3GPP__ProSe__Role__Of__UE_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return single_value;
}

void DCA__3GPP__ProSe__Role__Of__UE_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__ProSe__Role__Of__UE_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
}

DCA__3GPP__ProSe__Role__Of__UE_template& DCA__3GPP__ProSe__Role__Of__UE_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
return value_list.list_value[list_index];
}

void DCA__3GPP__ProSe__Role__Of__UE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__ProSe__Role__Of__UE::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__ProSe__Role__Of__UE_template::log_match(const DCA__3GPP__ProSe__Role__Of__UE& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__ProSe__Role__Of__UE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
}

void DCA__3GPP__ProSe__Role__Of__UE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__ProSe__Role__Of__UE::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__ProSe__Role__Of__UE::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__ProSe__Role__Of__UE_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
}
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__ProSe__Role__Of__UE_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__ProSe__Role__Of__UE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__ProSe__Role__Of__UE_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__ProSe__Role__Of__UE::enum_type enum_val = DCA__3GPP__ProSe__Role__Of__UE::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__ProSe__Role__Of__UE::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__ProSe__Role__Of__UE_template* precondition = new DCA__3GPP__ProSe__Role__Of__UE_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__ProSe__Role__Of__UE_template* implied_template = new DCA__3GPP__ProSe__Role__Of__UE_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__ProSe__Role__Of__UE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__ProSe__Role__Of__UE_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_ProSe_Role_Of_UE");
}

PCC__3GPP__RAT__Type::PCC__3GPP__RAT__Type()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__RAT__Type::PCC__3GPP__RAT__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__RAT__Type::PCC__3GPP__RAT__Type(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__RAT__Type::PCC__3GPP__RAT__Type(const PCC__3GPP__RAT__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
enum_value = other_value.enum_value;
}

PCC__3GPP__RAT__Type& PCC__3GPP__RAT__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__RAT__Type& PCC__3GPP__RAT__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__RAT__Type& PCC__3GPP__RAT__Type::operator=(const PCC__3GPP__RAT__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__RAT__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__RAT__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value == other_value;
}

boolean PCC__3GPP__RAT__Type::operator==(const PCC__3GPP__RAT__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__RAT__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__RAT__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value < other_value;
}

boolean PCC__3GPP__RAT__Type::operator<(const PCC__3GPP__RAT__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__RAT__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__RAT__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value > other_value;
}

boolean PCC__3GPP__RAT__Type::operator>(const PCC__3GPP__RAT__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__RAT__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case WLAN: return "WLAN";
case VIRTUAL: return "VIRTUAL";
case UTRAN: return "UTRAN";
case GERAN: return "GERAN";
case GAN: return "GAN";
case HSPA__EVOLUTION: return "HSPA_EVOLUTION";
case EUTRAN: return "EUTRAN";
case EUTRAN__NB__IoT: return "EUTRAN_NB_IoT";
case CDMA2000__1X: return "CDMA2000_1X";
case HRPD: return "HRPD";
case UMB: return "UMB";
case EHRPD: return "EHRPD";
default:
return "<unknown>";
}
}

PCC__3GPP__RAT__Type::enum_type PCC__3GPP__RAT__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "WLAN")) return WLAN;
if (!strcmp(str_par, "VIRTUAL")) return VIRTUAL;
if (!strcmp(str_par, "UTRAN")) return UTRAN;
if (!strcmp(str_par, "GERAN")) return GERAN;
if (!strcmp(str_par, "GAN")) return GAN;
if (!strcmp(str_par, "HSPA_EVOLUTION")) return HSPA__EVOLUTION;
if (!strcmp(str_par, "EUTRAN")) return EUTRAN;
if (!strcmp(str_par, "EUTRAN_NB_IoT")) return EUTRAN__NB__IoT;
if (!strcmp(str_par, "CDMA2000_1X")) return CDMA2000__1X;
if (!strcmp(str_par, "HRPD")) return HRPD;
if (!strcmp(str_par, "UMB")) return UMB;
if (!strcmp(str_par, "EHRPD")) return EHRPD;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__RAT__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 1000:
case 1001:
case 1002:
case 1003:
case 1004:
case 1005:
case 2000:
case 2001:
case 2002:
case 2003:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__RAT__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__RAT__Type::enum2int(const PCC__3GPP__RAT__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__RAT__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__RAT__Type::operator PCC__3GPP__RAT__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return enum_value;
}

void PCC__3GPP__RAT__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__RAT__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_RAT_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
  }
}

void PCC__3GPP__RAT__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__RAT__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", enum_value);
}

void PCC__3GPP__RAT__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__RAT__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__RAT__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 11, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__RAT__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 11);
}

void PCC__3GPP__RAT__Type_template::copy_template(const PCC__3GPP__RAT__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__RAT__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__RAT__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__RAT__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template()
{
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__RAT__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__RAT__Type::enum_type)other_value;
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(PCC__3GPP__RAT__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(const PCC__3GPP__RAT__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__RAT__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
single_value = other_value.enum_value;
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(const OPTIONAL<PCC__3GPP__RAT__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__RAT__Type::enum_type)(const PCC__3GPP__RAT__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type from an unbound optional field.");
}
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(PCC__3GPP__RAT__Type_template* p_precondition, PCC__3GPP__RAT__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(Dynamic_Match_Interface<PCC__3GPP__RAT__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__RAT__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__RAT__Type_template::PCC__3GPP__RAT__Type_template(const PCC__3GPP__RAT__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__RAT__Type_template::~PCC__3GPP__RAT__Type_template()
{
clean_up();
}

boolean PCC__3GPP__RAT__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__RAT__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__RAT__Type::UNBOUND_VALUE;
}

void PCC__3GPP__RAT__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(int other_value)
{
if (!PCC__3GPP__RAT__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__RAT__Type::enum_type)other_value;
return *this;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(PCC__3GPP__RAT__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(const PCC__3GPP__RAT__Type& other_value)
{
if (other_value.enum_value == PCC__3GPP__RAT__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(const OPTIONAL<PCC__3GPP__RAT__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__RAT__Type::enum_type)(const PCC__3GPP__RAT__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
return *this;
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::operator=(const PCC__3GPP__RAT__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__RAT__Type_template::match(PCC__3GPP__RAT__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
return FALSE;
}

boolean PCC__3GPP__RAT__Type_template::match(const PCC__3GPP__RAT__Type& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__RAT__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__RAT__Type::enum_type PCC__3GPP__RAT__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return single_value;
}

void PCC__3GPP__RAT__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__RAT__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
}

PCC__3GPP__RAT__Type_template& PCC__3GPP__RAT__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
return value_list.list_value[list_index];
}

void PCC__3GPP__RAT__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__RAT__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__RAT__Type_template::log_match(const PCC__3GPP__RAT__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__RAT__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
}

void PCC__3GPP__RAT__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__RAT__Type::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__RAT__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__RAT__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
}
}

boolean PCC__3GPP__RAT__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__RAT__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__RAT__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__RAT__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__RAT__Type::enum_type enum_val = PCC__3GPP__RAT__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__RAT__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_RAT_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__RAT__Type_template* precondition = new PCC__3GPP__RAT__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__RAT__Type_template* implied_template = new PCC__3GPP__RAT__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__RAT__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_RAT_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__RAT__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_RAT_Type");
}

DCA__3GPP__PoC__Session__Type::DCA__3GPP__PoC__Session__Type()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__PoC__Session__Type::DCA__3GPP__PoC__Session__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__PoC__Session__Type::DCA__3GPP__PoC__Session__Type(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__PoC__Session__Type::DCA__3GPP__PoC__Session__Type(const DCA__3GPP__PoC__Session__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
enum_value = other_value.enum_value;
}

DCA__3GPP__PoC__Session__Type& DCA__3GPP__PoC__Session__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__Session__Type& DCA__3GPP__PoC__Session__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__PoC__Session__Type& DCA__3GPP__PoC__Session__Type::operator=(const DCA__3GPP__PoC__Session__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__PoC__Session__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value == other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator==(const DCA__3GPP__PoC__Session__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value < other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator<(const DCA__3GPP__PoC__Session__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value > other_value;
}

boolean DCA__3GPP__PoC__Session__Type::operator>(const DCA__3GPP__PoC__Session__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__PoC__Session__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ONE__TO__ONE__POC__SESSION: return "ONE_TO_ONE_POC_SESSION";
case CHAT__POC__GROUP__SESSION: return "CHAT_POC_GROUP_SESSION";
case PRE__ARRANGED__POC__GROUP__SESSION: return "PRE_ARRANGED_POC_GROUP_SESSION";
case AD__HOC__POC__GROUP__SESSION: return "AD_HOC_POC_GROUP_SESSION";
default:
return "<unknown>";
}
}

DCA__3GPP__PoC__Session__Type::enum_type DCA__3GPP__PoC__Session__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ONE_TO_ONE_POC_SESSION")) return ONE__TO__ONE__POC__SESSION;
if (!strcmp(str_par, "CHAT_POC_GROUP_SESSION")) return CHAT__POC__GROUP__SESSION;
if (!strcmp(str_par, "PRE_ARRANGED_POC_GROUP_SESSION")) return PRE__ARRANGED__POC__GROUP__SESSION;
if (!strcmp(str_par, "AD_HOC_POC_GROUP_SESSION")) return AD__HOC__POC__GROUP__SESSION;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__PoC__Session__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__PoC__Session__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__PoC__Session__Type::enum2int(const DCA__3GPP__PoC__Session__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__PoC__Session__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__PoC__Session__Type::operator DCA__3GPP__PoC__Session__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return enum_value;
}

void DCA__3GPP__PoC__Session__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__PoC__Session__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_PoC_Session_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
  }
}

void DCA__3GPP__PoC__Session__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__PoC__Session__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", enum_value);
}

void DCA__3GPP__PoC__Session__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__PoC__Session__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__PoC__Session__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__PoC__Session__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void DCA__3GPP__PoC__Session__Type_template::copy_template(const DCA__3GPP__PoC__Session__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__PoC__Session__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__PoC__Session__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__PoC__Session__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template()
{
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__PoC__Session__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__PoC__Session__Type::enum_type)other_value;
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(DCA__3GPP__PoC__Session__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(const DCA__3GPP__PoC__Session__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__PoC__Session__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
single_value = other_value.enum_value;
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(const OPTIONAL<DCA__3GPP__PoC__Session__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Session__Type::enum_type)(const DCA__3GPP__PoC__Session__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type from an unbound optional field.");
}
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(DCA__3GPP__PoC__Session__Type_template* p_precondition, DCA__3GPP__PoC__Session__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(Dynamic_Match_Interface<DCA__3GPP__PoC__Session__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__PoC__Session__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__PoC__Session__Type_template::DCA__3GPP__PoC__Session__Type_template(const DCA__3GPP__PoC__Session__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__PoC__Session__Type_template::~DCA__3GPP__PoC__Session__Type_template()
{
clean_up();
}

boolean DCA__3GPP__PoC__Session__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__PoC__Session__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__PoC__Session__Type::UNBOUND_VALUE;
}

void DCA__3GPP__PoC__Session__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(int other_value)
{
if (!DCA__3GPP__PoC__Session__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Session__Type::enum_type)other_value;
return *this;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(DCA__3GPP__PoC__Session__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(const DCA__3GPP__PoC__Session__Type& other_value)
{
if (other_value.enum_value == DCA__3GPP__PoC__Session__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(const OPTIONAL<DCA__3GPP__PoC__Session__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__PoC__Session__Type::enum_type)(const DCA__3GPP__PoC__Session__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
return *this;
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::operator=(const DCA__3GPP__PoC__Session__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__PoC__Session__Type_template::match(DCA__3GPP__PoC__Session__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
return FALSE;
}

boolean DCA__3GPP__PoC__Session__Type_template::match(const DCA__3GPP__PoC__Session__Type& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__PoC__Session__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__PoC__Session__Type::enum_type DCA__3GPP__PoC__Session__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return single_value;
}

void DCA__3GPP__PoC__Session__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__PoC__Session__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
}

DCA__3GPP__PoC__Session__Type_template& DCA__3GPP__PoC__Session__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
return value_list.list_value[list_index];
}

void DCA__3GPP__PoC__Session__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__PoC__Session__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__PoC__Session__Type_template::log_match(const DCA__3GPP__PoC__Session__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__PoC__Session__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
}

void DCA__3GPP__PoC__Session__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__PoC__Session__Type::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__PoC__Session__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__PoC__Session__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
}
}

boolean DCA__3GPP__PoC__Session__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__PoC__Session__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__PoC__Session__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__PoC__Session__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__PoC__Session__Type::enum_type enum_val = DCA__3GPP__PoC__Session__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__PoC__Session__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_PoC_Session_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__PoC__Session__Type_template* precondition = new DCA__3GPP__PoC__Session__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__PoC__Session__Type_template* implied_template = new DCA__3GPP__PoC__Session__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__PoC__Session__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_PoC_Session_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__PoC__Session__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_PoC_Session_Type");
}

RX__3GPP__AF__Signalling__Protocol::RX__3GPP__AF__Signalling__Protocol()
{
enum_value = UNBOUND_VALUE;
}

RX__3GPP__AF__Signalling__Protocol::RX__3GPP__AF__Signalling__Protocol(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

RX__3GPP__AF__Signalling__Protocol::RX__3GPP__AF__Signalling__Protocol(enum_type other_value)
{
enum_value = other_value;
}

RX__3GPP__AF__Signalling__Protocol::RX__3GPP__AF__Signalling__Protocol(const RX__3GPP__AF__Signalling__Protocol& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
enum_value = other_value.enum_value;
}

RX__3GPP__AF__Signalling__Protocol& RX__3GPP__AF__Signalling__Protocol::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

RX__3GPP__AF__Signalling__Protocol& RX__3GPP__AF__Signalling__Protocol::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

RX__3GPP__AF__Signalling__Protocol& RX__3GPP__AF__Signalling__Protocol::operator=(const RX__3GPP__AF__Signalling__Protocol& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
enum_value = other_value.enum_value;
return *this;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value == other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator==(const RX__3GPP__AF__Signalling__Protocol& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value == other_value.enum_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value < other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator<(const RX__3GPP__AF__Signalling__Protocol& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value < other_value.enum_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value > other_value;
}

boolean RX__3GPP__AF__Signalling__Protocol::operator>(const RX__3GPP__AF__Signalling__Protocol& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value > other_value.enum_value;
}

const char *RX__3GPP__AF__Signalling__Protocol::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NO__INFORMATION: return "NO_INFORMATION";
case SIP: return "SIP";
default:
return "<unknown>";
}
}

RX__3GPP__AF__Signalling__Protocol::enum_type RX__3GPP__AF__Signalling__Protocol::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NO_INFORMATION")) return NO__INFORMATION;
if (!strcmp(str_par, "SIP")) return SIP;
}
return UNKNOWN_VALUE;
}

boolean RX__3GPP__AF__Signalling__Protocol::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int RX__3GPP__AF__Signalling__Protocol::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RX__3GPP__AF__Signalling__Protocol::enum2int(const RX__3GPP__AF__Signalling__Protocol& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void RX__3GPP__AF__Signalling__Protocol::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", int_val);
enum_value = (enum_type)int_val;
}

RX__3GPP__AF__Signalling__Protocol::operator RX__3GPP__AF__Signalling__Protocol::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return enum_value;
}

void RX__3GPP__AF__Signalling__Protocol::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void RX__3GPP__AF__Signalling__Protocol::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
  }
}

void RX__3GPP__AF__Signalling__Protocol::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
text_buf.push_int(enum_value);
}

void RX__3GPP__AF__Signalling__Protocol::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", enum_value);
}

void RX__3GPP__AF__Signalling__Protocol::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RX__3GPP__AF__Signalling__Protocol::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RX__3GPP__AF__Signalling__Protocol::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RX__3GPP__AF__Signalling__Protocol::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void RX__3GPP__AF__Signalling__Protocol_template::copy_template(const RX__3GPP__AF__Signalling__Protocol_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RX__3GPP__AF__Signalling__Protocol_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RX__3GPP__AF__Signalling__Protocol_template(*other_value.implication_.precondition);
implication_.implied_template = new RX__3GPP__AF__Signalling__Protocol_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template()
{
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!RX__3GPP__AF__Signalling__Protocol::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol with unknown numeric value %d.", other_value);
single_value = (RX__3GPP__AF__Signalling__Protocol::enum_type)other_value;
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(RX__3GPP__AF__Signalling__Protocol::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(const RX__3GPP__AF__Signalling__Protocol& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RX__3GPP__AF__Signalling__Protocol::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
single_value = other_value.enum_value;
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(const OPTIONAL<RX__3GPP__AF__Signalling__Protocol>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__AF__Signalling__Protocol::enum_type)(const RX__3GPP__AF__Signalling__Protocol&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol from an unbound optional field.");
}
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(RX__3GPP__AF__Signalling__Protocol_template* p_precondition, RX__3GPP__AF__Signalling__Protocol_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(Dynamic_Match_Interface<RX__3GPP__AF__Signalling__Protocol>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RX__3GPP__AF__Signalling__Protocol>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RX__3GPP__AF__Signalling__Protocol_template::RX__3GPP__AF__Signalling__Protocol_template(const RX__3GPP__AF__Signalling__Protocol_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

RX__3GPP__AF__Signalling__Protocol_template::~RX__3GPP__AF__Signalling__Protocol_template()
{
clean_up();
}

boolean RX__3GPP__AF__Signalling__Protocol_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean RX__3GPP__AF__Signalling__Protocol_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != RX__3GPP__AF__Signalling__Protocol::UNBOUND_VALUE;
}

void RX__3GPP__AF__Signalling__Protocol_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(int other_value)
{
if (!RX__3GPP__AF__Signalling__Protocol::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__AF__Signalling__Protocol::enum_type)other_value;
return *this;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(RX__3GPP__AF__Signalling__Protocol::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(const RX__3GPP__AF__Signalling__Protocol& other_value)
{
if (other_value.enum_value == RX__3GPP__AF__Signalling__Protocol::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(const OPTIONAL<RX__3GPP__AF__Signalling__Protocol>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RX__3GPP__AF__Signalling__Protocol::enum_type)(const RX__3GPP__AF__Signalling__Protocol&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
return *this;
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::operator=(const RX__3GPP__AF__Signalling__Protocol_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RX__3GPP__AF__Signalling__Protocol_template::match(RX__3GPP__AF__Signalling__Protocol::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
return FALSE;
}

boolean RX__3GPP__AF__Signalling__Protocol_template::match(const RX__3GPP__AF__Signalling__Protocol& other_value, boolean) const
{
if (other_value.enum_value == RX__3GPP__AF__Signalling__Protocol::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol with an unbound value.");
return match(other_value.enum_value);
}

RX__3GPP__AF__Signalling__Protocol::enum_type RX__3GPP__AF__Signalling__Protocol_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return single_value;
}

void RX__3GPP__AF__Signalling__Protocol_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RX__3GPP__AF__Signalling__Protocol_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
}

RX__3GPP__AF__Signalling__Protocol_template& RX__3GPP__AF__Signalling__Protocol_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
return value_list.list_value[list_index];
}

void RX__3GPP__AF__Signalling__Protocol_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RX__3GPP__AF__Signalling__Protocol::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RX__3GPP__AF__Signalling__Protocol_template::log_match(const RX__3GPP__AF__Signalling__Protocol& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void RX__3GPP__AF__Signalling__Protocol_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
}

void RX__3GPP__AF__Signalling__Protocol_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RX__3GPP__AF__Signalling__Protocol::enum_type)text_buf.pull_int().get_val();
if (!RX__3GPP__AF__Signalling__Protocol::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RX__3GPP__AF__Signalling__Protocol_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
}
}

boolean RX__3GPP__AF__Signalling__Protocol_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RX__3GPP__AF__Signalling__Protocol_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void RX__3GPP__AF__Signalling__Protocol_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RX__3GPP__AF__Signalling__Protocol_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    RX__3GPP__AF__Signalling__Protocol::enum_type enum_val = RX__3GPP__AF__Signalling__Protocol::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RX__3GPP__AF__Signalling__Protocol::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RX__3GPP__AF__Signalling__Protocol_template* precondition = new RX__3GPP__AF__Signalling__Protocol_template;
    precondition->set_param(*m_p->get_elem(0));
    RX__3GPP__AF__Signalling__Protocol_template* implied_template = new RX__3GPP__AF__Signalling__Protocol_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RX__3GPP__AF__Signalling__Protocol_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol");
  }
  is_ifpresent = param.get_ifpresent();
}

void RX__3GPP__AF__Signalling__Protocol_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.RX_3GPP_AF_Signalling_Protocol");
}

CxDx__3GPP__Reason__Code::CxDx__3GPP__Reason__Code()
{
enum_value = UNBOUND_VALUE;
}

CxDx__3GPP__Reason__Code::CxDx__3GPP__Reason__Code(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

CxDx__3GPP__Reason__Code::CxDx__3GPP__Reason__Code(enum_type other_value)
{
enum_value = other_value;
}

CxDx__3GPP__Reason__Code::CxDx__3GPP__Reason__Code(const CxDx__3GPP__Reason__Code& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
enum_value = other_value.enum_value;
}

CxDx__3GPP__Reason__Code& CxDx__3GPP__Reason__Code::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

CxDx__3GPP__Reason__Code& CxDx__3GPP__Reason__Code::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

CxDx__3GPP__Reason__Code& CxDx__3GPP__Reason__Code::operator=(const CxDx__3GPP__Reason__Code& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
enum_value = other_value.enum_value;
return *this;
}

boolean CxDx__3GPP__Reason__Code::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean CxDx__3GPP__Reason__Code::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value == other_value;
}

boolean CxDx__3GPP__Reason__Code::operator==(const CxDx__3GPP__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value == other_value.enum_value;
}

boolean CxDx__3GPP__Reason__Code::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean CxDx__3GPP__Reason__Code::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value < other_value;
}

boolean CxDx__3GPP__Reason__Code::operator<(const CxDx__3GPP__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value < other_value.enum_value;
}

boolean CxDx__3GPP__Reason__Code::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean CxDx__3GPP__Reason__Code::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value > other_value;
}

boolean CxDx__3GPP__Reason__Code::operator>(const CxDx__3GPP__Reason__Code& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value > other_value.enum_value;
}

const char *CxDx__3GPP__Reason__Code::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PERMANENT__TERMINATION: return "PERMANENT_TERMINATION";
case NEW__SERVER__ASSIGNED: return "NEW_SERVER_ASSIGNED";
case SERVER__CHANGE: return "SERVER_CHANGE";
case REMOVE__S__CSCF: return "REMOVE_S_CSCF";
default:
return "<unknown>";
}
}

CxDx__3GPP__Reason__Code::enum_type CxDx__3GPP__Reason__Code::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PERMANENT_TERMINATION")) return PERMANENT__TERMINATION;
if (!strcmp(str_par, "NEW_SERVER_ASSIGNED")) return NEW__SERVER__ASSIGNED;
if (!strcmp(str_par, "SERVER_CHANGE")) return SERVER__CHANGE;
if (!strcmp(str_par, "REMOVE_S_CSCF")) return REMOVE__S__CSCF;
}
return UNKNOWN_VALUE;
}

boolean CxDx__3GPP__Reason__Code::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int CxDx__3GPP__Reason__Code::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CxDx__3GPP__Reason__Code::enum2int(const CxDx__3GPP__Reason__Code& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void CxDx__3GPP__Reason__Code::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", int_val);
enum_value = (enum_type)int_val;
}

CxDx__3GPP__Reason__Code::operator CxDx__3GPP__Reason__Code::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return enum_value;
}

void CxDx__3GPP__Reason__Code::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CxDx__3GPP__Reason__Code::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.CxDx_3GPP_Reason_Code");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
  }
}

void CxDx__3GPP__Reason__Code::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
text_buf.push_int(enum_value);
}

void CxDx__3GPP__Reason__Code::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", enum_value);
}

void CxDx__3GPP__Reason__Code::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CxDx__3GPP__Reason__Code::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CxDx__3GPP__Reason__Code::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CxDx__3GPP__Reason__Code::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void CxDx__3GPP__Reason__Code_template::copy_template(const CxDx__3GPP__Reason__Code_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CxDx__3GPP__Reason__Code_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CxDx__3GPP__Reason__Code_template(*other_value.implication_.precondition);
implication_.implied_template = new CxDx__3GPP__Reason__Code_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template()
{
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!CxDx__3GPP__Reason__Code::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code with unknown numeric value %d.", other_value);
single_value = (CxDx__3GPP__Reason__Code::enum_type)other_value;
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(CxDx__3GPP__Reason__Code::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(const CxDx__3GPP__Reason__Code& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CxDx__3GPP__Reason__Code::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
single_value = other_value.enum_value;
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(const OPTIONAL<CxDx__3GPP__Reason__Code>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Reason__Code::enum_type)(const CxDx__3GPP__Reason__Code&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code from an unbound optional field.");
}
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(CxDx__3GPP__Reason__Code_template* p_precondition, CxDx__3GPP__Reason__Code_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(Dynamic_Match_Interface<CxDx__3GPP__Reason__Code>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<CxDx__3GPP__Reason__Code>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

CxDx__3GPP__Reason__Code_template::CxDx__3GPP__Reason__Code_template(const CxDx__3GPP__Reason__Code_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

CxDx__3GPP__Reason__Code_template::~CxDx__3GPP__Reason__Code_template()
{
clean_up();
}

boolean CxDx__3GPP__Reason__Code_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean CxDx__3GPP__Reason__Code_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != CxDx__3GPP__Reason__Code::UNBOUND_VALUE;
}

void CxDx__3GPP__Reason__Code_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(int other_value)
{
if (!CxDx__3GPP__Reason__Code::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Reason__Code::enum_type)other_value;
return *this;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(CxDx__3GPP__Reason__Code::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(const CxDx__3GPP__Reason__Code& other_value)
{
if (other_value.enum_value == CxDx__3GPP__Reason__Code::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(const OPTIONAL<CxDx__3GPP__Reason__Code>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CxDx__3GPP__Reason__Code::enum_type)(const CxDx__3GPP__Reason__Code&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
return *this;
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::operator=(const CxDx__3GPP__Reason__Code_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CxDx__3GPP__Reason__Code_template::match(CxDx__3GPP__Reason__Code::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
return FALSE;
}

boolean CxDx__3GPP__Reason__Code_template::match(const CxDx__3GPP__Reason__Code& other_value, boolean) const
{
if (other_value.enum_value == CxDx__3GPP__Reason__Code::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code with an unbound value.");
return match(other_value.enum_value);
}

CxDx__3GPP__Reason__Code::enum_type CxDx__3GPP__Reason__Code_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return single_value;
}

void CxDx__3GPP__Reason__Code_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CxDx__3GPP__Reason__Code_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
}

CxDx__3GPP__Reason__Code_template& CxDx__3GPP__Reason__Code_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
return value_list.list_value[list_index];
}

void CxDx__3GPP__Reason__Code_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(CxDx__3GPP__Reason__Code::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CxDx__3GPP__Reason__Code_template::log_match(const CxDx__3GPP__Reason__Code& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void CxDx__3GPP__Reason__Code_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
}

void CxDx__3GPP__Reason__Code_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CxDx__3GPP__Reason__Code::enum_type)text_buf.pull_int().get_val();
if (!CxDx__3GPP__Reason__Code::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CxDx__3GPP__Reason__Code_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
}
}

boolean CxDx__3GPP__Reason__Code_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CxDx__3GPP__Reason__Code_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void CxDx__3GPP__Reason__Code_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CxDx__3GPP__Reason__Code_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CxDx__3GPP__Reason__Code::enum_type enum_val = CxDx__3GPP__Reason__Code::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CxDx__3GPP__Reason__Code::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.CxDx_3GPP_Reason_Code.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CxDx__3GPP__Reason__Code_template* precondition = new CxDx__3GPP__Reason__Code_template;
    precondition->set_param(*m_p->get_elem(0));
    CxDx__3GPP__Reason__Code_template* implied_template = new CxDx__3GPP__Reason__Code_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CxDx__3GPP__Reason__Code_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.CxDx_3GPP_Reason_Code");
  }
  is_ifpresent = param.get_ifpresent();
}

void CxDx__3GPP__Reason__Code_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.CxDx_3GPP_Reason_Code");
}

PCC__3GPP__Pre__emption__Vulnerability::PCC__3GPP__Pre__emption__Vulnerability()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Pre__emption__Vulnerability::PCC__3GPP__Pre__emption__Vulnerability(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Pre__emption__Vulnerability::PCC__3GPP__Pre__emption__Vulnerability(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Pre__emption__Vulnerability::PCC__3GPP__Pre__emption__Vulnerability(const PCC__3GPP__Pre__emption__Vulnerability& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Pre__emption__Vulnerability& PCC__3GPP__Pre__emption__Vulnerability::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability& PCC__3GPP__Pre__emption__Vulnerability::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability& PCC__3GPP__Pre__emption__Vulnerability::operator=(const PCC__3GPP__Pre__emption__Vulnerability& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value == other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator==(const PCC__3GPP__Pre__emption__Vulnerability& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value < other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator<(const PCC__3GPP__Pre__emption__Vulnerability& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value > other_value;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::operator>(const PCC__3GPP__Pre__emption__Vulnerability& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Pre__emption__Vulnerability::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PRE__EMPTION__VULNERABILITY__ENABLED: return "PRE_EMPTION_VULNERABILITY_ENABLED";
case PRE__EMPTION__VULNERABILITY__DISABLED: return "PRE_EMPTION_VULNERABILITY_DISABLED";
default:
return "<unknown>";
}
}

PCC__3GPP__Pre__emption__Vulnerability::enum_type PCC__3GPP__Pre__emption__Vulnerability::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "PRE_EMPTION_VULNERABILITY_ENABLED")) return PRE__EMPTION__VULNERABILITY__ENABLED;
if (!strcmp(str_par, "PRE_EMPTION_VULNERABILITY_DISABLED")) return PRE__EMPTION__VULNERABILITY__DISABLED;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Pre__emption__Vulnerability::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Pre__emption__Vulnerability::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Pre__emption__Vulnerability::enum2int(const PCC__3GPP__Pre__emption__Vulnerability& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Pre__emption__Vulnerability::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Pre__emption__Vulnerability::operator PCC__3GPP__Pre__emption__Vulnerability::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return enum_value;
}

void PCC__3GPP__Pre__emption__Vulnerability::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Pre__emption__Vulnerability::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
  }
}

void PCC__3GPP__Pre__emption__Vulnerability::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Pre__emption__Vulnerability::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", enum_value);
}

void PCC__3GPP__Pre__emption__Vulnerability::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Pre__emption__Vulnerability::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Pre__emption__Vulnerability::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Pre__emption__Vulnerability::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void PCC__3GPP__Pre__emption__Vulnerability_template::copy_template(const PCC__3GPP__Pre__emption__Vulnerability_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Pre__emption__Vulnerability_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Pre__emption__Vulnerability_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Pre__emption__Vulnerability_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template()
{
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Pre__emption__Vulnerability::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Pre__emption__Vulnerability::enum_type)other_value;
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(PCC__3GPP__Pre__emption__Vulnerability::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(const PCC__3GPP__Pre__emption__Vulnerability& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Pre__emption__Vulnerability::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
single_value = other_value.enum_value;
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(const OPTIONAL<PCC__3GPP__Pre__emption__Vulnerability>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Pre__emption__Vulnerability::enum_type)(const PCC__3GPP__Pre__emption__Vulnerability&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability from an unbound optional field.");
}
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(PCC__3GPP__Pre__emption__Vulnerability_template* p_precondition, PCC__3GPP__Pre__emption__Vulnerability_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(Dynamic_Match_Interface<PCC__3GPP__Pre__emption__Vulnerability>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Pre__emption__Vulnerability>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Pre__emption__Vulnerability_template::PCC__3GPP__Pre__emption__Vulnerability_template(const PCC__3GPP__Pre__emption__Vulnerability_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Pre__emption__Vulnerability_template::~PCC__3GPP__Pre__emption__Vulnerability_template()
{
clean_up();
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Pre__emption__Vulnerability::UNBOUND_VALUE;
}

void PCC__3GPP__Pre__emption__Vulnerability_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(int other_value)
{
if (!PCC__3GPP__Pre__emption__Vulnerability::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Pre__emption__Vulnerability::enum_type)other_value;
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(PCC__3GPP__Pre__emption__Vulnerability::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(const PCC__3GPP__Pre__emption__Vulnerability& other_value)
{
if (other_value.enum_value == PCC__3GPP__Pre__emption__Vulnerability::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(const OPTIONAL<PCC__3GPP__Pre__emption__Vulnerability>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Pre__emption__Vulnerability::enum_type)(const PCC__3GPP__Pre__emption__Vulnerability&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
return *this;
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::operator=(const PCC__3GPP__Pre__emption__Vulnerability_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::match(PCC__3GPP__Pre__emption__Vulnerability::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
return FALSE;
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::match(const PCC__3GPP__Pre__emption__Vulnerability& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Pre__emption__Vulnerability::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Pre__emption__Vulnerability::enum_type PCC__3GPP__Pre__emption__Vulnerability_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return single_value;
}

void PCC__3GPP__Pre__emption__Vulnerability_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Pre__emption__Vulnerability_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
}

PCC__3GPP__Pre__emption__Vulnerability_template& PCC__3GPP__Pre__emption__Vulnerability_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Pre__emption__Vulnerability_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Pre__emption__Vulnerability::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Pre__emption__Vulnerability_template::log_match(const PCC__3GPP__Pre__emption__Vulnerability& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Pre__emption__Vulnerability_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
}

void PCC__3GPP__Pre__emption__Vulnerability_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Pre__emption__Vulnerability::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Pre__emption__Vulnerability::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Pre__emption__Vulnerability_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
}
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Pre__emption__Vulnerability_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Pre__emption__Vulnerability_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Pre__emption__Vulnerability_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Pre__emption__Vulnerability::enum_type enum_val = PCC__3GPP__Pre__emption__Vulnerability::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Pre__emption__Vulnerability::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Pre__emption__Vulnerability_template* precondition = new PCC__3GPP__Pre__emption__Vulnerability_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Pre__emption__Vulnerability_template* implied_template = new PCC__3GPP__Pre__emption__Vulnerability_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Pre__emption__Vulnerability_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Pre__emption__Vulnerability_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Pre_emption_Vulnerability");
}

PCC__3GPP__Default__Access::PCC__3GPP__Default__Access()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__Default__Access::PCC__3GPP__Default__Access(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__Default__Access::PCC__3GPP__Default__Access(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__Default__Access::PCC__3GPP__Default__Access(const PCC__3GPP__Default__Access& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
enum_value = other_value.enum_value;
}

PCC__3GPP__Default__Access& PCC__3GPP__Default__Access::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__Default__Access& PCC__3GPP__Default__Access::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__Default__Access& PCC__3GPP__Default__Access::operator=(const PCC__3GPP__Default__Access& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__Default__Access::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__Default__Access::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value == other_value;
}

boolean PCC__3GPP__Default__Access::operator==(const PCC__3GPP__Default__Access& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__Default__Access::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__Default__Access::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value < other_value;
}

boolean PCC__3GPP__Default__Access::operator<(const PCC__3GPP__Default__Access& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__Default__Access::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__Default__Access::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value > other_value;
}

boolean PCC__3GPP__Default__Access::operator>(const PCC__3GPP__Default__Access& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__Default__Access::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case threeGPP__GPRS: return "threeGPP_GPRS";
case DOCSIS: return "DOCSIS";
case xDSL: return "xDSL";
case WiMAX: return "WiMAX";
case threeGPP2: return "threeGPP2";
case threeGPP__EPS: return "threeGPP_EPS";
case Non__threeGPP__EPS: return "Non_threeGPP_EPS";
case FBA: return "FBA";
default:
return "<unknown>";
}
}

PCC__3GPP__Default__Access::enum_type PCC__3GPP__Default__Access::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "threeGPP_GPRS")) return threeGPP__GPRS;
if (!strcmp(str_par, "DOCSIS")) return DOCSIS;
if (!strcmp(str_par, "xDSL")) return xDSL;
if (!strcmp(str_par, "WiMAX")) return WiMAX;
if (!strcmp(str_par, "threeGPP2")) return threeGPP2;
if (!strcmp(str_par, "threeGPP_EPS")) return threeGPP__EPS;
if (!strcmp(str_par, "Non_threeGPP_EPS")) return Non__threeGPP__EPS;
if (!strcmp(str_par, "FBA")) return FBA;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__Default__Access::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__Default__Access::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__Default__Access::enum2int(const PCC__3GPP__Default__Access& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__Default__Access::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__Default__Access::operator PCC__3GPP__Default__Access::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return enum_value;
}

void PCC__3GPP__Default__Access::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__Default__Access::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_Default_Access");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Default_Access.");
  }
}

void PCC__3GPP__Default__Access::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__Default__Access::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", enum_value);
}

void PCC__3GPP__Default__Access::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__Default__Access::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__Default__Access::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 4, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__Default__Access::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 4);
}

void PCC__3GPP__Default__Access_template::copy_template(const PCC__3GPP__Default__Access_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__Default__Access_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__Default__Access_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__Default__Access_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template()
{
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__Default__Access::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__Default__Access::enum_type)other_value;
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(PCC__3GPP__Default__Access::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(const PCC__3GPP__Default__Access& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__Default__Access::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
single_value = other_value.enum_value;
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(const OPTIONAL<PCC__3GPP__Default__Access>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Default__Access::enum_type)(const PCC__3GPP__Default__Access&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access from an unbound optional field.");
}
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(PCC__3GPP__Default__Access_template* p_precondition, PCC__3GPP__Default__Access_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(Dynamic_Match_Interface<PCC__3GPP__Default__Access>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__Default__Access>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__Default__Access_template::PCC__3GPP__Default__Access_template(const PCC__3GPP__Default__Access_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__Default__Access_template::~PCC__3GPP__Default__Access_template()
{
clean_up();
}

boolean PCC__3GPP__Default__Access_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__Default__Access_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__Default__Access::UNBOUND_VALUE;
}

void PCC__3GPP__Default__Access_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(int other_value)
{
if (!PCC__3GPP__Default__Access::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Default__Access::enum_type)other_value;
return *this;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(PCC__3GPP__Default__Access::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(const PCC__3GPP__Default__Access& other_value)
{
if (other_value.enum_value == PCC__3GPP__Default__Access::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(const OPTIONAL<PCC__3GPP__Default__Access>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__Default__Access::enum_type)(const PCC__3GPP__Default__Access&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
return *this;
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::operator=(const PCC__3GPP__Default__Access_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__Default__Access_template::match(PCC__3GPP__Default__Access::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
return FALSE;
}

boolean PCC__3GPP__Default__Access_template::match(const PCC__3GPP__Default__Access& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__Default__Access::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__Default__Access::enum_type PCC__3GPP__Default__Access_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return single_value;
}

void PCC__3GPP__Default__Access_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__Default__Access_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
}

PCC__3GPP__Default__Access_template& PCC__3GPP__Default__Access_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
return value_list.list_value[list_index];
}

void PCC__3GPP__Default__Access_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__Default__Access::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__Default__Access_template::log_match(const PCC__3GPP__Default__Access& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__Default__Access_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
}

void PCC__3GPP__Default__Access_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__Default__Access::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__Default__Access::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__Default__Access_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_Default_Access.");
}
}

boolean PCC__3GPP__Default__Access_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__Default__Access_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__Default__Access_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__Default__Access_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__Default__Access::enum_type enum_val = PCC__3GPP__Default__Access::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__Default__Access::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_Default_Access.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__Default__Access_template* precondition = new PCC__3GPP__Default__Access_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__Default__Access_template* implied_template = new PCC__3GPP__Default__Access_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__Default__Access_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_Default_Access");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__Default__Access_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_Default_Access");
}

DCA__3GPP__SM__Message__Type::DCA__3GPP__SM__Message__Type()
{
enum_value = UNBOUND_VALUE;
}

DCA__3GPP__SM__Message__Type::DCA__3GPP__SM__Message__Type(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

DCA__3GPP__SM__Message__Type::DCA__3GPP__SM__Message__Type(enum_type other_value)
{
enum_value = other_value;
}

DCA__3GPP__SM__Message__Type::DCA__3GPP__SM__Message__Type(const DCA__3GPP__SM__Message__Type& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
enum_value = other_value.enum_value;
}

DCA__3GPP__SM__Message__Type& DCA__3GPP__SM__Message__Type::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

DCA__3GPP__SM__Message__Type& DCA__3GPP__SM__Message__Type::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

DCA__3GPP__SM__Message__Type& DCA__3GPP__SM__Message__Type::operator=(const DCA__3GPP__SM__Message__Type& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
enum_value = other_value.enum_value;
return *this;
}

boolean DCA__3GPP__SM__Message__Type::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value == other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator==(const DCA__3GPP__SM__Message__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value == other_value.enum_value;
}

boolean DCA__3GPP__SM__Message__Type::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value < other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator<(const DCA__3GPP__SM__Message__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value < other_value.enum_value;
}

boolean DCA__3GPP__SM__Message__Type::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value > other_value;
}

boolean DCA__3GPP__SM__Message__Type::operator>(const DCA__3GPP__SM__Message__Type& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value > other_value.enum_value;
}

const char *DCA__3GPP__SM__Message__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SUBMISSION: return "SUBMISSION";
case DELIVERY__REPORT: return "DELIVERY_REPORT";
case SM__SERVICE__REQUEST: return "SM_SERVICE_REQUEST";
default:
return "<unknown>";
}
}

DCA__3GPP__SM__Message__Type::enum_type DCA__3GPP__SM__Message__Type::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "SUBMISSION")) return SUBMISSION;
if (!strcmp(str_par, "DELIVERY_REPORT")) return DELIVERY__REPORT;
if (!strcmp(str_par, "SM_SERVICE_REQUEST")) return SM__SERVICE__REQUEST;
}
return UNKNOWN_VALUE;
}

boolean DCA__3GPP__SM__Message__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int DCA__3GPP__SM__Message__Type::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int DCA__3GPP__SM__Message__Type::enum2int(const DCA__3GPP__SM__Message__Type& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void DCA__3GPP__SM__Message__Type::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", int_val);
enum_value = (enum_type)int_val;
}

DCA__3GPP__SM__Message__Type::operator DCA__3GPP__SM__Message__Type::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return enum_value;
}

void DCA__3GPP__SM__Message__Type::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void DCA__3GPP__SM__Message__Type::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.DCA_3GPP_SM_Message_Type");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
  }
}

void DCA__3GPP__SM__Message__Type::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
text_buf.push_int(enum_value);
}

void DCA__3GPP__SM__Message__Type::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", enum_value);
}

void DCA__3GPP__SM__Message__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DCA__3GPP__SM__Message__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DCA__3GPP__SM__Message__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int DCA__3GPP__SM__Message__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void DCA__3GPP__SM__Message__Type_template::copy_template(const DCA__3GPP__SM__Message__Type_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DCA__3GPP__SM__Message__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DCA__3GPP__SM__Message__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new DCA__3GPP__SM__Message__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template()
{
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!DCA__3GPP__SM__Message__Type::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type with unknown numeric value %d.", other_value);
single_value = (DCA__3GPP__SM__Message__Type::enum_type)other_value;
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(DCA__3GPP__SM__Message__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(const DCA__3GPP__SM__Message__Type& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == DCA__3GPP__SM__Message__Type::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
single_value = other_value.enum_value;
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(const OPTIONAL<DCA__3GPP__SM__Message__Type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__SM__Message__Type::enum_type)(const DCA__3GPP__SM__Message__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type from an unbound optional field.");
}
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(DCA__3GPP__SM__Message__Type_template* p_precondition, DCA__3GPP__SM__Message__Type_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(Dynamic_Match_Interface<DCA__3GPP__SM__Message__Type>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DCA__3GPP__SM__Message__Type>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DCA__3GPP__SM__Message__Type_template::DCA__3GPP__SM__Message__Type_template(const DCA__3GPP__SM__Message__Type_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

DCA__3GPP__SM__Message__Type_template::~DCA__3GPP__SM__Message__Type_template()
{
clean_up();
}

boolean DCA__3GPP__SM__Message__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean DCA__3GPP__SM__Message__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != DCA__3GPP__SM__Message__Type::UNBOUND_VALUE;
}

void DCA__3GPP__SM__Message__Type_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(int other_value)
{
if (!DCA__3GPP__SM__Message__Type::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__SM__Message__Type::enum_type)other_value;
return *this;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(DCA__3GPP__SM__Message__Type::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(const DCA__3GPP__SM__Message__Type& other_value)
{
if (other_value.enum_value == DCA__3GPP__SM__Message__Type::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(const OPTIONAL<DCA__3GPP__SM__Message__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (DCA__3GPP__SM__Message__Type::enum_type)(const DCA__3GPP__SM__Message__Type&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
return *this;
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::operator=(const DCA__3GPP__SM__Message__Type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DCA__3GPP__SM__Message__Type_template::match(DCA__3GPP__SM__Message__Type::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
return FALSE;
}

boolean DCA__3GPP__SM__Message__Type_template::match(const DCA__3GPP__SM__Message__Type& other_value, boolean) const
{
if (other_value.enum_value == DCA__3GPP__SM__Message__Type::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type with an unbound value.");
return match(other_value.enum_value);
}

DCA__3GPP__SM__Message__Type::enum_type DCA__3GPP__SM__Message__Type_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return single_value;
}

void DCA__3GPP__SM__Message__Type_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DCA__3GPP__SM__Message__Type_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
}

DCA__3GPP__SM__Message__Type_template& DCA__3GPP__SM__Message__Type_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
return value_list.list_value[list_index];
}

void DCA__3GPP__SM__Message__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(DCA__3GPP__SM__Message__Type::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void DCA__3GPP__SM__Message__Type_template::log_match(const DCA__3GPP__SM__Message__Type& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DCA__3GPP__SM__Message__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
}

void DCA__3GPP__SM__Message__Type_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (DCA__3GPP__SM__Message__Type::enum_type)text_buf.pull_int().get_val();
if (!DCA__3GPP__SM__Message__Type::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DCA__3GPP__SM__Message__Type_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
}
}

boolean DCA__3GPP__SM__Message__Type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DCA__3GPP__SM__Message__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void DCA__3GPP__SM__Message__Type_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DCA__3GPP__SM__Message__Type_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    DCA__3GPP__SM__Message__Type::enum_type enum_val = DCA__3GPP__SM__Message__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!DCA__3GPP__SM__Message__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.DCA_3GPP_SM_Message_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    DCA__3GPP__SM__Message__Type_template* precondition = new DCA__3GPP__SM__Message__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    DCA__3GPP__SM__Message__Type_template* implied_template = new DCA__3GPP__SM__Message__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = DCA__3GPP__SM__Message__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.DCA_3GPP_SM_Message_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void DCA__3GPP__SM__Message__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.DCA_3GPP_SM_Message_Type");
}

PCC__3GPP__PS__to__CS__Session__Continuity::PCC__3GPP__PS__to__CS__Session__Continuity()
{
enum_value = UNBOUND_VALUE;
}

PCC__3GPP__PS__to__CS__Session__Continuity::PCC__3GPP__PS__to__CS__Session__Continuity(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity::PCC__3GPP__PS__to__CS__Session__Continuity(enum_type other_value)
{
enum_value = other_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity::PCC__3GPP__PS__to__CS__Session__Continuity(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
enum_value = other_value.enum_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity& PCC__3GPP__PS__to__CS__Session__Continuity::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity& PCC__3GPP__PS__to__CS__Session__Continuity::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity& PCC__3GPP__PS__to__CS__Session__Continuity::operator=(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
enum_value = other_value.enum_value;
return *this;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value == other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator==(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value == other_value.enum_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value < other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator<(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value < other_value.enum_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value > other_value;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::operator>(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value > other_value.enum_value;
}

const char *PCC__3GPP__PS__to__CS__Session__Continuity::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case VIDEO__PS2CS__CONT__CANDIDATE: return "VIDEO_PS2CS_CONT_CANDIDATE";
default:
return "<unknown>";
}
}

PCC__3GPP__PS__to__CS__Session__Continuity::enum_type PCC__3GPP__PS__to__CS__Session__Continuity::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "VIDEO_PS2CS_CONT_CANDIDATE")) return VIDEO__PS2CS__CONT__CANDIDATE;
}
return UNKNOWN_VALUE;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
return TRUE;
default:
return FALSE;
}
}

int PCC__3GPP__PS__to__CS__Session__Continuity::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int PCC__3GPP__PS__to__CS__Session__Continuity::enum2int(const PCC__3GPP__PS__to__CS__Session__Continuity& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void PCC__3GPP__PS__to__CS__Session__Continuity::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", int_val);
enum_value = (enum_type)int_val;
}

PCC__3GPP__PS__to__CS__Session__Continuity::operator PCC__3GPP__PS__to__CS__Session__Continuity::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return enum_value;
}

void PCC__3GPP__PS__to__CS__Session__Continuity::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void PCC__3GPP__PS__to__CS__Session__Continuity::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
  }
}

void PCC__3GPP__PS__to__CS__Session__Continuity::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
text_buf.push_int(enum_value);
}

void PCC__3GPP__PS__to__CS__Session__Continuity::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", enum_value);
}

void PCC__3GPP__PS__to__CS__Session__Continuity::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PCC__3GPP__PS__to__CS__Session__Continuity::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PCC__3GPP__PS__to__CS__Session__Continuity::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 1, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int PCC__3GPP__PS__to__CS__Session__Continuity::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 1);
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::copy_template(const PCC__3GPP__PS__to__CS__Session__Continuity_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PCC__3GPP__PS__to__CS__Session__Continuity_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PCC__3GPP__PS__to__CS__Session__Continuity_template(*other_value.implication_.precondition);
implication_.implied_template = new PCC__3GPP__PS__to__CS__Session__Continuity_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template()
{
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!PCC__3GPP__PS__to__CS__Session__Continuity::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity with unknown numeric value %d.", other_value);
single_value = (PCC__3GPP__PS__to__CS__Session__Continuity::enum_type)other_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(PCC__3GPP__PS__to__CS__Session__Continuity::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PCC__3GPP__PS__to__CS__Session__Continuity::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
single_value = other_value.enum_value;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(const OPTIONAL<PCC__3GPP__PS__to__CS__Session__Continuity>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__PS__to__CS__Session__Continuity::enum_type)(const PCC__3GPP__PS__to__CS__Session__Continuity&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity from an unbound optional field.");
}
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(PCC__3GPP__PS__to__CS__Session__Continuity_template* p_precondition, PCC__3GPP__PS__to__CS__Session__Continuity_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(Dynamic_Match_Interface<PCC__3GPP__PS__to__CS__Session__Continuity>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PCC__3GPP__PS__to__CS__Session__Continuity>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::PCC__3GPP__PS__to__CS__Session__Continuity_template(const PCC__3GPP__PS__to__CS__Session__Continuity_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

PCC__3GPP__PS__to__CS__Session__Continuity_template::~PCC__3GPP__PS__to__CS__Session__Continuity_template()
{
clean_up();
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PCC__3GPP__PS__to__CS__Session__Continuity::UNBOUND_VALUE;
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(int other_value)
{
if (!PCC__3GPP__PS__to__CS__Session__Continuity::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__PS__to__CS__Session__Continuity::enum_type)other_value;
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(PCC__3GPP__PS__to__CS__Session__Continuity::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value)
{
if (other_value.enum_value == PCC__3GPP__PS__to__CS__Session__Continuity::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(const OPTIONAL<PCC__3GPP__PS__to__CS__Session__Continuity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PCC__3GPP__PS__to__CS__Session__Continuity::enum_type)(const PCC__3GPP__PS__to__CS__Session__Continuity&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
return *this;
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::operator=(const PCC__3GPP__PS__to__CS__Session__Continuity_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::match(PCC__3GPP__PS__to__CS__Session__Continuity::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
return FALSE;
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::match(const PCC__3GPP__PS__to__CS__Session__Continuity& other_value, boolean) const
{
if (other_value.enum_value == PCC__3GPP__PS__to__CS__Session__Continuity::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity with an unbound value.");
return match(other_value.enum_value);
}

PCC__3GPP__PS__to__CS__Session__Continuity::enum_type PCC__3GPP__PS__to__CS__Session__Continuity_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return single_value;
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PCC__3GPP__PS__to__CS__Session__Continuity_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
}

PCC__3GPP__PS__to__CS__Session__Continuity_template& PCC__3GPP__PS__to__CS__Session__Continuity_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
return value_list.list_value[list_index];
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PCC__3GPP__PS__to__CS__Session__Continuity::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::log_match(const PCC__3GPP__PS__to__CS__Session__Continuity& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PCC__3GPP__PS__to__CS__Session__Continuity::enum_type)text_buf.pull_int().get_val();
if (!PCC__3GPP__PS__to__CS__Session__Continuity::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PCC__3GPP__PS__to__CS__Session__Continuity_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
}
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PCC__3GPP__PS__to__CS__Session__Continuity_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PCC__3GPP__PS__to__CS__Session__Continuity_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    PCC__3GPP__PS__to__CS__Session__Continuity::enum_type enum_val = PCC__3GPP__PS__to__CS__Session__Continuity::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!PCC__3GPP__PS__to__CS__Session__Continuity::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    PCC__3GPP__PS__to__CS__Session__Continuity_template* precondition = new PCC__3GPP__PS__to__CS__Session__Continuity_template;
    precondition->set_param(*m_p->get_elem(0));
    PCC__3GPP__PS__to__CS__Session__Continuity_template* implied_template = new PCC__3GPP__PS__to__CS__Session__Continuity_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PCC__3GPP__PS__to__CS__Session__Continuity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity");
  }
  is_ifpresent = param.get_ifpresent();
}

void PCC__3GPP__PS__to__CS__Session__Continuity_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.PCC_3GPP_PS_to_CS_Session_Continuity");
}

AVP::AVP()
{
}

AVP::AVP(const AVP__Header& par_avp__header,
    const AVP__Data& par_avp__data)
  :   field_avp__header(par_avp__header),
  field_avp__data(par_avp__data)
{
}

AVP::AVP(const AVP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Types.AVP.");
if (other_value.avp__header().is_bound()) field_avp__header = other_value.avp__header();
else field_avp__header.clean_up();
if (other_value.avp__data().is_bound()) field_avp__data = other_value.avp__data();
else field_avp__data.clean_up();
}

void AVP::clean_up()
{
field_avp__header.clean_up();
field_avp__data.clean_up();
}

const TTCN_Typedescriptor_t* AVP::get_descriptor() const { return &AVP_descr_; }
AVP& AVP::operator=(const AVP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Types.AVP.");
  if (other_value.avp__header().is_bound()) field_avp__header = other_value.avp__header();
  else field_avp__header.clean_up();
  if (other_value.avp__data().is_bound()) field_avp__data = other_value.avp__data();
  else field_avp__data.clean_up();
}
return *this;
}

boolean AVP::operator==(const AVP& other_value) const
{
return field_avp__header==other_value.field_avp__header
  && field_avp__data==other_value.field_avp__data;
}

boolean AVP::is_bound() const
{
return (field_avp__header.is_bound())
  || (field_avp__data.is_bound());
}
boolean AVP::is_value() const
{
return field_avp__header.is_value()
  && field_avp__data.is_value();
}
void AVP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ avp_header := ");
field_avp__header.log();
TTCN_Logger::log_event_str(", avp_data := ");
field_avp__data.log();
TTCN_Logger::log_event_str(" }");
}

void AVP::set_implicit_omit()
{
if (avp__header().is_bound()) avp__header().set_implicit_omit();
if (avp__data().is_bound()) avp__data().set_implicit_omit();
}

void AVP::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @DIAMETER_Types.AVP has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) avp__header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) avp__data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "avp_header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          avp__header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "avp_data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          avp__data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @DIAMETER_Types.AVP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@DIAMETER_Types.AVP");
  }
}

void AVP::encode_text(Text_Buf& text_buf) const
{
field_avp__header.encode_text(text_buf);
field_avp__data.encode_text(text_buf);
}

void AVP::decode_text(Text_Buf& text_buf)
{
field_avp__header.decode_text(text_buf);
field_avp__data.decode_text(text_buf);
}

void AVP::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AVP::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AVP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AVP_avp__header_descr_.raw->forceomit);
  decoded_field_length = field_avp__header.RAW_decode(AVP_avp__header_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp = field_avp__header.avp__length().convert_to_Integer(UINT24_descr_);
  field_avp__header.avp__length() = tmp;
  value_of_length_field0 += tmp.get_long_long_val() * 8;
  value_of_length_field0 -= decoded_field_length;
  if (value_of_length_field0 < 0) return -1;
  if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__IPv6__Address) selected_field = 0;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Service) selected_field = 1;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__RAR__Flags) selected_field = 2;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Address) selected_field = 3;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__MCC__MNC) selected_field = 4;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Direct__Debiting__Failure__Handling) selected_field = 5;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Careof__Address) selected_field = 6;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__TWAN__User__Location__Info) selected_field = 7;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__IDs) selected_field = 8;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Order) selected_field = 9;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__ETSI && field_avp__header.avp__code().vendor__id__ETSI() == AVP__Code__ETSI::avp__code__CxDx__ETSI__Line__Identifier) selected_field = 10;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Identifier) selected_field = 11;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Content__Version) selected_field = 12;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Applic__ID) selected_field = 13;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__MSA) selected_field = 14;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Session__Id) selected_field = 15;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Transmitted) selected_field = 16;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Reporting__Reason) selected_field = 17;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Services) selected_field = 18;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Description) selected_field = 19;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__CSG__Information__Reporting) selected_field = 20;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Quantity) selected_field = 21;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Location__Information__Configuration) selected_field = 22;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Usage) selected_field = 23;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Application__provided__Called__Party__Address) selected_field = 24;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Timestamp) selected_field = 25;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Filter) selected_field = 26;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__List__Of__Measurements) selected_field = 27;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Requested__Service__Unit) selected_field = 28;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Name) selected_field = 29;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UVA__Flags) selected_field = 30;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Expires) selected_field = 31;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SAR__Flags) selected_field = 32;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Information) selected_field = 33;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Group__Service__Id) selected_field = 34;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__SCCP__Address) selected_field = 35;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Preferred__AoC__Currency) selected_field = 36;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Pool) selected_field = 37;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Traffic__Data__Volumes) selected_field = 38;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Time) selected_field = 39;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__EUTRAN__Authentication__Info) selected_field = 40;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Cost) selected_field = 41;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Digest__Authenticate) selected_field = 42;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Last__UE__Activity__Time) selected_field = 43;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Context__Identifier) selected_field = 44;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Used__Service__Unit) selected_field = 45;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Reply) selected_field = 46;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Auth__Application__Id) selected_field = 47;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Reference) selected_field = 48;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Access__Info) selected_field = 49;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Status__AS__Code) selected_field = 50;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Type) selected_field = 51;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Network) selected_field = 52;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Prefix) selected_field = 53;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Initiation__Type) selected_field = 54;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__UL) selected_field = 55;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Size) selected_field = 56;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Network__Info) selected_field = 57;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__AF__Charging__Identifier) selected_field = 58;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Report) selected_field = 59;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Type) selected_field = 60;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Event) selected_field = 61;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Media__Type) selected_field = 62;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__Policy__Information) selected_field = 63;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Firmware__Revision) selected_field = 64;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Event__Type) selected_field = 65;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Network__Request__Support) selected_field = 66;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Permission) selected_field = 67;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Terminating__IOI) selected_field = 68;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__DL) selected_field = 69;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__UE__Local__IP__Address) selected_field = 70;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Sequence__Number) selected_field = 71;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Information) selected_field = 72;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Elements__List) selected_field = 73;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Remove) selected_field = 74;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SGs__MME__Identity) selected_field = 75;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Roaming__Information) selected_field = 76;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Diversions) selected_field = 77;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Info) selected_field = 78;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Scheme) selected_field = 79;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRP) selected_field = 80;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Authorization__Type) selected_field = 81;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PLMN__Client) selected_field = 82;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Re__Synchronization__Info) selected_field = 83;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Auth__Grace__Period) selected_field = 84;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__User__CSG__Information) selected_field = 85;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Status) selected_field = 86;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IP__Realm__Default__Indication) selected_field = 87;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__RAND) selected_field = 88;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Depth) selected_field = 89;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__FA__MSA) selected_field = 90;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__User__State) selected_field = 91;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__APN__OI__Replacement) selected_field = 92;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Alternate__Charged__Party__Address) selected_field = 93;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control) selected_field = 94;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Re__Auth__Request__Type) selected_field = 95;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Relationship__Mode) selected_field = 96;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__External__Identifier) selected_field = 97;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Positioning__Data) selected_field = 98;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Address__Type) selected_field = 99;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__MSA) selected_field = 100;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__HPLMN__Identifier) selected_field = 101;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Filter) selected_field = 102;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__UL) selected_field = 103;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Loss__Of__Connectivity__Reason) selected_field = 104;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Medium__Type) selected_field = 105;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originator) selected_field = 106;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Type) selected_field = 107;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Number) selected_field = 108;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Address) selected_field = 109;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Allocation__Notification) selected_field = 110;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Basic__Service__Code) selected_field = 111;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Type) selected_field = 112;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__Node) selected_field = 113;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Bearer__Indication) selected_field = 114;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Information) selected_field = 115;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Class__Identifier) selected_field = 116;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__LIPA__Allowed) selected_field = 117;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Mute__Notification) selected_field = 118;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Context) selected_field = 119;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Resources) selected_field = 120;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Duration) selected_field = 121;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Value) selected_field = 122;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Registered__Identities) selected_field = 123;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__IP__Address) selected_field = 124;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__EUTRAN) selected_field = 125;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__GW__Address) selected_field = 126;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Destination__Interface) selected_field = 127;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Emergency__Indicator) selected_field = 128;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Time) selected_field = 129;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__KASME) selected_field = 130;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Session__Key) selected_field = 131;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Cost__Information) selected_field = 132;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info__Time) selected_field = 133;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Teleservice__List) selected_field = 134;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UTRAN__Vector) selected_field = 135;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access__APN) selected_field = 136;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Information) selected_field = 137;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Time__Change) selected_field = 138;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__NSAPI) selected_field = 139;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Dialed__By__MS) selected_field = 140;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__Address) selected_field = 141;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Start__Time) selected_field = 142;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Application__Service__Provider__Identity) selected_field = 143;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Request) selected_field = 144;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Time) selected_field = 145;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Incoming__Trunk__Group__Id) selected_field = 146;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AAA__Failure__Indication) selected_field = 147;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Message__Size) selected_field = 148;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Install) selected_field = 149;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Communication__Indicator) selected_field = 150;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Info) selected_field = 151;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Usage) selected_field = 152;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__Rule__Support) selected_field = 153;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Password) selected_field = 154;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__EPC__Control__Protocol__Cause) selected_field = 155;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Duration) selected_field = 156;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Information) selected_field = 157;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Routing__Area__Identity) selected_field = 158;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Party__Address) selected_field = 159;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Service__Authorization__Info) selected_field = 160;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunneling) selected_field = 161;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Value) selected_field = 162;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Auth__Input__Data__Length) selected_field = 163;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length) selected_field = 164;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Multi__Round__Time__Out) selected_field = 165;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report__Item) selected_field = 166;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Failure__Code) selected_field = 167;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Type) selected_field = 168;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Threshold) selected_field = 169;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__User__Location__Info__Time) selected_field = 170;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Information) selected_field = 171;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__LTE) selected_field = 172;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__DL) selected_field = 173;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result__Code) selected_field = 174;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Session__Priority) selected_field = 175;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Info) selected_field = 176;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Format) selected_field = 177;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Time) selected_field = 178;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Deregistration__Reason) selected_field = 179;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Number) selected_field = 180;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Software__Version) selected_field = 181;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Number) selected_field = 182;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Configuration__Token) selected_field = 183;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Type) selected_field = 184;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Originating__Foreign__AAA) selected_field = 185;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Expiration__Date) selected_field = 186;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Error__Message) selected_field = 187;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SRES) selected_field = 188;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__DRM__Content) selected_field = 189;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Item__Number) selected_field = 190;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Type) selected_field = 191;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ERP__Authorization) selected_field = 192;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Indicator) selected_field = 193;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Early__Media__Description) selected_field = 194;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK) selected_field = 195;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Change__Condition__Information) selected_field = 196;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Protocol) selected_field = 197;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__ID) selected_field = 198;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Format__Indicator) selected_field = 199;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI__MCC__MNC) selected_field = 200;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Abort__Cause) selected_field = 201;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Location) selected_field = 202;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Base__Name) selected_field = 203;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Required__Access__Info) selected_field = 204;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Realm) selected_field = 205;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__S6t__HSS__Cause) selected_field = 206;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Party) selected_field = 207;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__URI) selected_field = 208;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__AF__Requested__Data) selected_field = 209;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Report) selected_field = 210;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Filter__Id) selected_field = 211;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Password) selected_field = 212;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Received) selected_field = 213;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Stationary__Indication) selected_field = 214;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Response) selected_field = 215;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__DL) selected_field = 216;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Usage__Information__Report__Sequence__Number) selected_field = 217;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Geodetic__Information) selected_field = 218;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__UL) selected_field = 219;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area__ID) selected_field = 220;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Capabilities) selected_field = 221;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Area__Scope) selected_field = 222;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Packets) selected_field = 223;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Change) selected_field = 224;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SCSCF__Restoration__Info) selected_field = 225;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Initial__CSeq__Sequence__Number) selected_field = 226;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Subscription__Information) selected_field = 227;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PUA__Flags) selected_field = 228;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Id) selected_field = 229;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Usage) selected_field = 230;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Event__Charging__Function__Name) selected_field = 231;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Output__Octets) selected_field = 232;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info) selected_field = 233;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Notification__To__UE__User) selected_field = 234;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Visited__PLMN__Id) selected_field = 235;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Homogeneous__Support__of__IMS__Voice__Over__PS__Sessions) selected_field = 236;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Group) selected_field = 237;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Play__Alternative) selected_field = 238;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__User__Service__Type) selected_field = 239;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Transit__IOI__List) selected_field = 240;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Codec__Data) selected_field = 241;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Config__Status) selected_field = 242;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Name) selected_field = 243;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AF__Correlation__Information) selected_field = 244;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Cost__Information) selected_field = 245;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Identity) selected_field = 246;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Error__Reporting__Host) selected_field = 247;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Frequency) selected_field = 248;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Activation__Time) selected_field = 249;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__Data) selected_field = 250;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__AF__Application__Identifier) selected_field = 251;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__NetLoc__Access__Support) selected_field = 252;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__VPLMN__Identifier) selected_field = 253;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Configuration) selected_field = 254;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Offline) selected_field = 255;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Method) selected_field = 256;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Definition) selected_field = 257;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Additional__Context__ID) selected_field = 258;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__Service) selected_field = 259;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security__Data) selected_field = 260;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Allowed__PLMN__List) selected_field = 261;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Control__Mode) selected_field = 262;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Active__APN) selected_field = 263;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__HeNB__Local__IP__Address) selected_field = 264;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Content) selected_field = 265;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SMS__Register__Request) selected_field = 266;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Subscription__Info) selected_field = 267;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp__Fraction) selected_field = 268;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Client__Address) selected_field = 269;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration) selected_field = 270;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Subscriber__Role) selected_field = 271;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Number__Auth__Items) selected_field = 272;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__OMC__Id) selected_field = 273;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Restriction) selected_field = 274;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__State) selected_field = 275;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Preference) selected_field = 276;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Session__Failover) selected_field = 277;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Enhanced__Diagnostics) selected_field = 278;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Membership__Indication) selected_field = 279;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Regional__Subscription__Zone__Code) selected_field = 280;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Class) selected_field = 281;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Negotiated__DSCP) selected_field = 282;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__S2a__Failure__Cause) selected_field = 283;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__SPI) selected_field = 284;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger) selected_field = 285;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity__Change) selected_field = 286;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Request__Timestamp) selected_field = 287;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Id) selected_field = 288;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Proxy__State) selected_field = 289;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Server__Role) selected_field = 290;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Forwarding__Pending) selected_field = 291;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__SIR__Flags) selected_field = 292;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control__Failure__Handling) selected_field = 293;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Agent__Info) selected_field = 294;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__MPS__Identifier) selected_field = 295;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Credit__Management__Status) selected_field = 296;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Allowed__PLMN__Id) selected_field = 297;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitored__PLMN__Identifier) selected_field = 298;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result) selected_field = 299;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Reporting__Level) selected_field = 300;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Location__Information) selected_field = 301;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Served__Party__IP__Address) selected_field = 302;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__DL) selected_field = 303;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Reception) selected_field = 304;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Capability) selected_field = 305;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__VSRVCC) selected_field = 306;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Flags) selected_field = 307;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Max__Cache__Time) selected_field = 308;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List) selected_field = 309;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Type) selected_field = 310;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TCP__Source__Port) selected_field = 311;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Application__Detection__Information) selected_field = 312;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Info) selected_field = 313;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Remaining__Balance) selected_field = 314;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MPS__Priority) selected_field = 315;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Next__Tariff) selected_field = 316;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Requested__Action) selected_field = 317;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Record__Route) selected_field = 318;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__XML) selected_field = 319;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Alert__Reason) selected_field = 320;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Address) selected_field = 321;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Condition) selected_field = 322;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__IPv6__Address) selected_field = 323;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Idle__Timeout) selected_field = 324;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Id) selected_field = 325;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DEA__Flags) selected_field = 326;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__AS__Address) selected_field = 327;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MO__LR) selected_field = 328;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Visited__Network__Identifier) selected_field = 329;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role) selected_field = 330;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Identifier) selected_field = 331;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access) selected_field = 332;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Data) selected_field = 333;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Adaptations) selected_field = 334;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Host__IP__Address) selected_field = 335;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Request) selected_field = 336;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Holding__Time) selected_field = 337;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Maximum__Wait__Time) selected_field = 338;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__UL) selected_field = 339;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Support) selected_field = 340;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Response__Time) selected_field = 341;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Reporting) selected_field = 342;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server) selected_field = 343;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Sponsor__Identity) selected_field = 344;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Link) selected_field = 345;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Interface__Id) selected_field = 346;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Indication) selected_field = 347;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__IP__Address) selected_field = 348;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Trunk__Group__Id) selected_field = 349;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Information) selected_field = 350;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Address) selected_field = 351;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Of__Charging) selected_field = 352;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Participants__Involved) selected_field = 353;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Support) selected_field = 354;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Support) selected_field = 355;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IMSI__Group__Id) selected_field = 356;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Cell__Global__Identity) selected_field = 357;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Id) selected_field = 358;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Connection__Continuity) selected_field = 359;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__Information) selected_field = 360;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Wildcarded__Public__Identity) selected_field = 361;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__Acct__Session__Time) selected_field = 362;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DSA__Flags) selected_field = 363;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Event__Type) selected_field = 364;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Data) selected_field = 365;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__Info) selected_field = 366;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id__String) selected_field = 367;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__GW__Allocation__Type) selected_field = 368;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Type__Information) selected_field = 369;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__MCC__MNC) selected_field = 370;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__HESSID) selected_field = 371;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Class) selected_field = 372;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Event__Timestamp) selected_field = 373;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__TAD__Identifier) selected_field = 374;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Action) selected_field = 375;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI__Check__In__VPLMN__Result) selected_field = 376;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Generic__Information) selected_field = 377;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Type) selected_field = 378;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Discovery__Model) selected_field = 379;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__UL) selected_field = 380;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Indicator) selected_field = 381;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__User__Identifier) selected_field = 382;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Base__Name) selected_field = 383;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Pool) selected_field = 384;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Restoration__Priority) selected_field = 385;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Diagnostics) selected_field = 386;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Association__Type) selected_field = 387;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Definition) selected_field = 388;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Rating__Group) selected_field = 389;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__SPI) selected_field = 390;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__UL) selected_field = 391;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Specific__Data) selected_field = 392;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__Information) selected_field = 393;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Amount) selected_field = 394;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Charging__Collection__Function__Name) selected_field = 395;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info) selected_field = 396;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__A__MSISDN) selected_field = 397;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Mobile__Node__Address) selected_field = 398;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Report) selected_field = 399;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Number__Of__Requested__Vectors) selected_field = 400;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AIR__Flags) selected_field = 401;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Protocol__ID) selected_field = 402;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Priority__Indicator) selected_field = 403;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Geographical__Information) selected_field = 404;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Action__Type) selected_field = 405;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Id) selected_field = 406;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Loose__Route__Indication) selected_field = 407;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Type) selected_field = 408;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MME__User__State) selected_field = 409;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Restriction__Data) selected_field = 410;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Service__Type) selected_field = 411;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__UNI__PDU__CP__Only__Flag) selected_field = 412;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Filter__Rule) selected_field = 413;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Failed__AVP) selected_field = 414;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__RAT__Type) selected_field = 415;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Status) selected_field = 416;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Neighbour__Node__Address) selected_field = 417;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Type) selected_field = 418;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Indicator) selected_field = 419;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Priority) selected_field = 420;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Update) selected_field = 421;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Data) selected_field = 422;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Type) selected_field = 423;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__MSA) selected_field = 424;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Connectivity__Flags) selected_field = 425;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Operation) selected_field = 426;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__VCS__Information) selected_field = 427;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID__for__Deletion) selected_field = 428;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Disposition) selected_field = 429;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__SIP__Forking__Indication) selected_field = 430;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__User__Password) selected_field = 431;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Group__IP__Multicast__Address) selected_field = 432;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__IMEI__Change) selected_field = 433;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Type) selected_field = 434;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Component) selected_field = 435;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__UL) selected_field = 436;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Reception__Data__Container) selected_field = 437;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authorization) selected_field = 438;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Revalidation__Time) selected_field = 439;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Interval) selected_field = 440;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Information) selected_field = 441;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Status) selected_field = 442;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Filter) selected_field = 443;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability) selected_field = 444;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Data__Coding__Scheme) selected_field = 445;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Metering__Method) selected_field = 446;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Connection) selected_field = 447;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__Data__Delivery__Mechanism) selected_field = 448;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Initial__IMS__Charging__Identifier) selected_field = 449;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Filter__Rule) selected_field = 450;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Feature__Vector) selected_field = 451;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Session__Server__Failover) selected_field = 452;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Accumulated__Cost) selected_field = 453;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Integrity__Key) selected_field = 454;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Vector) selected_field = 455;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SMSC__Address) selected_field = 456;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address__Prefix__Length) selected_field = 457;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result) selected_field = 458;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Link__Count) selected_field = 459;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Unit__Value) selected_field = 460;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Event__List) selected_field = 461;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Id) selected_field = 462;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__PDP__Type) selected_field = 463;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Reply__Message) selected_field = 464;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Connect__Info) selected_field = 465;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Replay__Mode) selected_field = 466;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Host) selected_field = 467;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Talk__Bursts) selected_field = 468;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Short__Network__Name) selected_field = 469;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Size) selected_field = 470;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Exception__Reports) selected_field = 471;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Information) selected_field = 472;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Pattern__Set) selected_field = 473;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__UP__Address) selected_field = 474;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MMBox__Storage__Requested) selected_field = 475;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Status) selected_field = 476;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Challenge) selected_field = 477;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__Control__Protocol__Cause) selected_field = 478;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Unit__Type) selected_field = 479;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Calling__Party__Address) selected_field = 480;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__MCPTT__Identifier) selected_field = 481;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report) selected_field = 482;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Upgrade) selected_field = 483;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Append__Free__Format__Data) selected_field = 484;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Status) selected_field = 485;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Service__Type) selected_field = 486;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Key) selected_field = 487;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__UMTS) selected_field = 488;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Flag) selected_field = 489;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Location__Number) selected_field = 490;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__3GPP__PS__Data__Off__Status) selected_field = 491;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Install) selected_field = 492;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Reset__ID) selected_field = 493;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Data__Container) selected_field = 494;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Assignment__Type) selected_field = 495;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PUR__Flags) selected_field = 496;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Session__Charging__Scope) selected_field = 497;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Routing) selected_field = 498;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI) selected_field = 499;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Ident) selected_field = 500;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Text) selected_field = 501;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Kc) selected_field = 502;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Current__Tariff) selected_field = 503;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Number) selected_field = 504;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__HPLMN__ODB) selected_field = 505;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Type) selected_field = 506;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Info) selected_field = 507;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Domain__Name) selected_field = 508;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Characteristics) selected_field = 509;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Context) selected_field = 510;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Money) selected_field = 511;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DER__Flags) selected_field = 512;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Data__Coding__Scheme) selected_field = 513;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__Address) selected_field = 514;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Info) selected_field = 515;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier__Node) selected_field = 516;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Node__Type) selected_field = 517;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Volume) selected_field = 518;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Id) selected_field = 519;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Priority__Sharing__Indicator) selected_field = 520;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Type) selected_field = 521;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Name) selected_field = 522;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger__Type) selected_field = 523;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Instance__Id) selected_field = 524;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Scheduled__Communication__Time) selected_field = 525;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__DL) selected_field = 526;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__ProSe__Function) selected_field = 527;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Latency) selected_field = 528;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PCC__Rule__Status) selected_field = 529;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp) selected_field = 530;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__DL) selected_field = 531;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area) selected_field = 532;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__UE__ID) selected_field = 533;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Name) selected_field = 534;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__APN__Validity__Time) selected_field = 535;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Allocation__Retention__Priority) selected_field = 536;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Check__Balance__Result) selected_field = 537;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Job__Type) selected_field = 538;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Destination__Host) selected_field = 539;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Positioning__Method) selected_field = 540;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__LIA__Flags) selected_field = 541;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DL__Buffering__Suggested__Packet__Count) selected_field = 542;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Type) selected_field = 543;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__IP__Host) selected_field = 544;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IDA__Flags) selected_field = 545;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security) selected_field = 546;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Origin__AAA__Protocol) selected_field = 547;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Last__Usage) selected_field = 548;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Charging__Information) selected_field = 549;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ULA__Flags) selected_field = 550;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Interface) selected_field = 551;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IMS__Voice__Over__PS__Sessions__Supported) selected_field = 552;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Roaming__Restricted__Due__To__Unsupported__Feature) selected_field = 553;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__File__Repair__Supported) selected_field = 554;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPX__Network) selected_field = 555;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Assignment__Id) selected_field = 556;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Service__Specific__Units) selected_field = 557;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Answer__Timestamp) selected_field = 558;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__Identifier) selected_field = 559;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Type__Number) selected_field = 560;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__NIDD__Submission) selected_field = 561;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__T4__Parameters) selected_field = 562;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier__Value) selected_field = 563;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__HPLMN__Identifier) selected_field = 564;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Error__Report) selected_field = 565;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__SPI) selected_field = 566;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Type) selected_field = 567;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__DL) selected_field = 568;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Remove) selected_field = 569;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Transmission__Data__Container) selected_field = 570;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Restricted__PLMN__List) selected_field = 571;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Network__Charging__Identifier__Gx) selected_field = 572;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Age__Of__Location__Information) selected_field = 573;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Group__Name) selected_field = 574;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__DL) selected_field = 575;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Information) selected_field = 576;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Information) selected_field = 577;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MTC__IWF__Address) selected_field = 578;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Execution__Time) selected_field = 579;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Identifier) selected_field = 580;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Auth__Id) selected_field = 581;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Contact) selected_field = 582;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Correlation__Indicator) selected_field = 583;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control) selected_field = 584;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Number) selected_field = 585;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1I) selected_field = 586;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp__Fraction) selected_field = 587;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Mode) selected_field = 588;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data) selected_field = 589;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Interval) selected_field = 590;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__NAS__Release__Cause) selected_field = 591;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag__Extension) selected_field = 592;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Client__Identity) selected_field = 593;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host__Usage) selected_field = 594;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Access__Mode) selected_field = 595;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Equipment__Status) selected_field = 596;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Supplementary__Service) selected_field = 597;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Packet__Filter) selected_field = 598;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server__Address) selected_field = 599;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Auth__Mode) selected_field = 600;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Location__Information) selected_field = 601;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Network__Information) selected_field = 602;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity) selected_field = 603;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Default__APN__Context__Id) selected_field = 604;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SGSN__Address) selected_field = 605;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SGi__PtP__Tunnelling__Method) selected_field = 606;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Session__Timeout) selected_field = 607;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Packets__Lost) selected_field = 608;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Type) selected_field = 609;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Service__Info__Status) selected_field = 610;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__CIR__Flags) selected_field = 611;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Precedence) selected_field = 612;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__User__Participating__Type) selected_field = 613;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__GGSN__Address) selected_field = 614;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Sponsoring__Action) selected_field = 615;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Resources__Indicator) selected_field = 616;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Granted__Validity__Time) selected_field = 617;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Priority__Level) selected_field = 618;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Functionality) selected_field = 619;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Description) selected_field = 620;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Information) selected_field = 621;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Daylight__Saving__Time) selected_field = 622;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Domain) selected_field = 623;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__ID) selected_field = 624;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Length) selected_field = 625;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Removal__Of__Access) selected_field = 626;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Report) selected_field = 627;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Preferred__Data__Mode) selected_field = 628;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Functionality) selected_field = 629;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Balance__Indication) selected_field = 630;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__UL) selected_field = 631;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UE__SRVCC__Capability) selected_field = 632;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Group) selected_field = 633;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IPv6__Address) selected_field = 634;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MAC__Mobility__Data) selected_field = 635;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Octets) selected_field = 636;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__To__SIP__Header) selected_field = 637;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Coupled__Node__Diameter__ID) selected_field = 638;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Real__Time__Tariff__Information) selected_field = 639;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__STN__SR) selected_field = 640;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Type) selected_field = 641;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Supported__Vendor__Id) selected_field = 642;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ServiceTypeIdentity) selected_field = 643;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__Party__Address) selected_field = 644;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Information) selected_field = 645;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Authentic) selected_field = 646;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Service__Identifier) selected_field = 647;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AUTN) selected_field = 648;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__User__Data) selected_field = 649;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Delivery__Report__Requested) selected_field = 650;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__TWAN__Identifier) selected_field = 651;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Origination__Time__Stamp) selected_field = 652;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__APN) selected_field = 653;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__End__Time) selected_field = 654;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Sponsored__Connectivity__Data) selected_field = 655;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Auth__Request__Type) selected_field = 656;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server__Information) selected_field = 657;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Address) selected_field = 658;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Network__Call__Reference__Number) selected_field = 659;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern) selected_field = 660;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Mode) selected_field = 661;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Information) selected_field = 662;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Validity__Time) selected_field = 663;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__VPLMN__Identifier) selected_field = 664;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Event__Handling) selected_field = 665;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ToS__Traffic__Class) selected_field = 666;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Tracking__Area__Identity) selected_field = 667;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__SPI) selected_field = 668;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__UL) selected_field = 669;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UVR__Flags) selected_field = 670;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Free__Format__Data) selected_field = 671;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Originating__Request) selected_field = 672;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PDN__Connection__ID) selected_field = 673;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Flags) selected_field = 674;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Route) selected_field = 675;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Remove) selected_field = 676;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DSR__Flags) selected_field = 677;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Granted__Service__Unit) selected_field = 678;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Timestamp) selected_field = 679;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Portability__Routing__Information) selected_field = 680;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__Periodic__RAU__TAU__Timer) selected_field = 681;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Specific__APN__Info) selected_field = 682;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Terminal__Information) selected_field = 683;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Restoration__Info) selected_field = 684;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Product__Name) selected_field = 685;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__MN__MSA) selected_field = 686;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Account__Expiration) selected_field = 687;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Id) selected_field = 688;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Netmask) selected_field = 689;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IPv6__DNS__Servers) selected_field = 690;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SSID) selected_field = 691;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Call__Barring__Info) selected_field = 692;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__BSSID) selected_field = 693;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Info) selected_field = 694;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Exchange) selected_field = 695;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Order) selected_field = 696;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Mechanism) selected_field = 697;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ANID) selected_field = 698;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Number) selected_field = 699;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Name) selected_field = 700;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Origin__State__Id) selected_field = 701;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Media__Sub__Component) selected_field = 702;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CN__Operator__Selection__Entity) selected_field = 703;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Accuracy) selected_field = 704;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Remove) selected_field = 705;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__IOI) selected_field = 706;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__DL) selected_field = 707;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__PLMN__Identifier) selected_field = 708;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__Report) selected_field = 709;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Information) selected_field = 710;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Service) selected_field = 711;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Charging__Collection__Function__Name) selected_field = 712;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Definition) selected_field = 713;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Time__Zone) selected_field = 714;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Time) selected_field = 715;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Failure__Code) selected_field = 716;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Host) selected_field = 717;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Group__Id) selected_field = 718;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Discharge__Time) selected_field = 719;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Requestor__PLMN__Identifier) selected_field = 720;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Application__Reference__Identifier) selected_field = 721;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Report) selected_field = 722;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Area__Identity) selected_field = 723;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__User__Name) selected_field = 724;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UE__PC5__AMBR) selected_field = 725;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Public__Identity) selected_field = 726;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Sub__Session__Id) selected_field = 727;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Delay__Time) selected_field = 728;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Local__Sequence__Number) selected_field = 729;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__UAR__Flags) selected_field = 730;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__UMTS) selected_field = 731;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Operator__Determined__Barring) selected_field = 732;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Received__Address) selected_field = 733;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Endpoint) selected_field = 734;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Candidate__Home__Agent__Host) selected_field = 735;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Session__Binding) selected_field = 736;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMEISV) selected_field = 737;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Code) selected_field = 738;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__DCD__Information) selected_field = 739;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate__Type) selected_field = 740;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Indicator) selected_field = 741;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Addressee__Type) selected_field = 742;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Acct__Multi__Session__Id) selected_field = 743;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Data) selected_field = 744;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connectivity__Parameters) selected_field = 745;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Applic__ID) selected_field = 746;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Access__Priority) selected_field = 747;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__RS__Bandwidth) selected_field = 748;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Information) selected_field = 749;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Algorithm__Type) selected_field = 750;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Session__Description) selected_field = 751;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__DL) selected_field = 752;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Info) selected_field = 753;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__UL) selected_field = 754;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRQ) selected_field = 755;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Information) selected_field = 756;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__Parameters) selected_field = 757;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Information) selected_field = 758;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Identifier) selected_field = 759;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Information) selected_field = 760;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ePDG__Address) selected_field = 761;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Trigger) selected_field = 762;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__GCS__Identifier) selected_field = 763;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Capability) selected_field = 764;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Install) selected_field = 765;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__PDN__Type__Indicator) selected_field = 766;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Identifier) selected_field = 767;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Session__Id) selected_field = 768;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Controlling__Address) selected_field = 769;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag) selected_field = 770;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Confidentiality__Key) selected_field = 771;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Label) selected_field = 772;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port) selected_field = 773;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Authentication__Info) selected_field = 774;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Transcoder__Inserted__Indication) selected_field = 775;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Node) selected_field = 776;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Interface__List) selected_field = 777;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Address) selected_field = 778;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Id) selected_field = 779;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Algorithm) selected_field = 780;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration__Profile) selected_field = 781;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Received__Talk__Bursts) selected_field = 782;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Full__Network__Name) selected_field = 783;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Type) selected_field = 784;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Uplink) selected_field = 785;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CAMEL__Charging__Info) selected_field = 786;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__From__Address) selected_field = 787;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__CP__Address) selected_field = 788;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Context__Type) selected_field = 789;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Flows) selected_field = 790;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__User__Session__Id) selected_field = 791;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Time) selected_field = 792;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Privacy__Indicator) selected_field = 793;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__CIA__Flags) selected_field = 794;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__UL) selected_field = 795;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Time) selected_field = 796;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Input__Octets) selected_field = 797;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Teleservice) selected_field = 798;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Consumption__Time) selected_field = 799;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__UE__Reachability__Configuration) selected_field = 800;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Destination__Realm) selected_field = 801;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Acceptable__Service__Info) selected_field = 802;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Direction) selected_field = 803;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Reason__For__Cancellation) selected_field = 804;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Monitoring__Events) selected_field = 805;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CG__Address) selected_field = 806;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Values) selected_field = 807;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Item__Number) selected_field = 808;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Release__Cause) selected_field = 809;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__User__Consent) selected_field = 810;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__HSS__Cause) selected_field = 811;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Home__Link__Prefix) selected_field = 812;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Port) selected_field = 813;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PCSCF__Restoration__Indication) selected_field = 814;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Reference) selected_field = 815;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Layer__2__Group__ID) selected_field = 816;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Port) selected_field = 817;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Deletion) selected_field = 818;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__Chargable__User__Identity) selected_field = 819;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Collection__Entity) selected_field = 820;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Request__Type) selected_field = 821;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List__ID) selected_field = 822;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host) selected_field = 823;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Network__Access__Mode) selected_field = 824;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Compression) selected_field = 825;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Zone__Access) selected_field = 826;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Selection__Mode) selected_field = 827;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__QoS__Filter__Rule) selected_field = 828;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Complete__Data__List__Included__Indicator) selected_field = 829;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__SPI) selected_field = 830;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Name) selected_field = 831;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__Address) selected_field = 832;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier) selected_field = 833;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Asserted__Identity) selected_field = 834;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__TWAG__Address) selected_field = 835;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MSA__Lifetime) selected_field = 836;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Time) selected_field = 837;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Token__Text) selected_field = 838;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Time__Unit) selected_field = 839;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__External__Identifier) selected_field = 840;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Reason__Header) selected_field = 841;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__WLCP__Key) selected_field = 842;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Type) selected_field = 843;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp) selected_field = 844;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Route) selected_field = 845;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Private__Group__Id) selected_field = 846;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Type) selected_field = 847;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Source__IP__Address) selected_field = 848;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Type__Of__External__Identifier) selected_field = 849;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Report__Indication) selected_field = 850;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Configuration) selected_field = 851;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Report) selected_field = 852;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Participants) selected_field = 853;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MSC__Address) selected_field = 854;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Priviledged__Sender__Indication) selected_field = 855;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__Access__Restriction__Data) selected_field = 856;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Obligatory__Type) selected_field = 857;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__RAT__Frequency__Selection__Priority__ID) selected_field = 858;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Usage) selected_field = 859;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Info) selected_field = 860;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Default__EPS__Bearer__QoS) selected_field = 861;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__CLR__Flags) selected_field = 862;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ULR__Flags) selected_field = 863;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__SCCP__Address) selected_field = 864;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__ICS__Indicator) selected_field = 865;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Calling__Station__Id) selected_field = 866;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Auth__Id) selected_field = 867;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Currency__Code) selected_field = 868;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Cancellation__Type) selected_field = 869;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__E2E__Sequence) selected_field = 870;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Origin__Realm) selected_field = 871;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Type) selected_field = 872;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Scale__Factor) selected_field = 873;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IM__Information) selected_field = 874;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Prompt) selected_field = 875;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Offer__Timestamp) selected_field = 876;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PPR__Flags) selected_field = 877;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MM__Content__Type) selected_field = 878;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CPDT__Information) selected_field = 879;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__IPv6__Address) selected_field = 880;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__DER__S6b__Flags) selected_field = 881;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Realm) selected_field = 882;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id) selected_field = 883;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier) selected_field = 884;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server) selected_field = 885;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern__Config__Status) selected_field = 886;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__info__Units) selected_field = 887;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part) selected_field = 888;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__3rd__Party__Application__ID) selected_field = 889;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction__Data) selected_field = 890;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Operation) selected_field = 891;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Current__Location__Retrieved) selected_field = 892;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Pre__emption__Control__Info) selected_field = 893;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Instance__Identifier) selected_field = 894;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Information) selected_field = 895;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Information) selected_field = 896;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Acct__Interim__Interval) selected_field = 897;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Number) selected_field = 898;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Path) selected_field = 899;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Usage) selected_field = 900;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1F) selected_field = 901;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__MONTE__Location__Type) selected_field = 902;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__Operator__Identifier) selected_field = 903;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__RDS__Indicator) selected_field = 904;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Cancellation__Timestamp) selected_field = 905;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__SService__Type) selected_field = 906;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Optional__Capability) selected_field = 907;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Length) selected_field = 908;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Reporting__Trigger) selected_field = 909;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__APN__Aggregate__Max__Bitrate) selected_field = 910;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Event__Charging__Function__Name) selected_field = 911;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Group__PLMN__Id) selected_field = 912;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Path__Requested) selected_field = 913;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__User__Id) selected_field = 914;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Type) selected_field = 915;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Node) selected_field = 916;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Originating__Line__Info) selected_field = 917;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Exponent) selected_field = 918;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Authenticator) selected_field = 919;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__UTRAN__GERAN__Authentication__Info) selected_field = 920;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Octets) selected_field = 921;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__User__State) selected_field = 922;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Origin__Host) selected_field = 923;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Authorization__Flags) selected_field = 924;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address) selected_field = 925;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator) selected_field = 926;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Information) selected_field = 927;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate) selected_field = 928;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Offline__Charging) selected_field = 929;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Retry__Interval) selected_field = 930;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Session__Id) selected_field = 931;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Content__Information) selected_field = 932;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Restriction__Filter__Rule) selected_field = 933;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Cause__Code) selected_field = 934;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connection__Mode) selected_field = 935;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Identifier) selected_field = 936;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Data) selected_field = 937;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID) selected_field = 938;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Type) selected_field = 939;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Release__Notification) selected_field = 940;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Name) selected_field = 941;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__IP__Address) selected_field = 942;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__DL) selected_field = 943;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Disconnect__Cause) selected_field = 944;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Error__Diagnostic) selected_field = 945;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__UL) selected_field = 946;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__UDP__Source__Port) selected_field = 947;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Total__Octets) selected_field = 948;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Type) selected_field = 949;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Result) selected_field = 950;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MMS__Information) selected_field = 951;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__From__SIP__Header) selected_field = 952;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Definition) selected_field = 953;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Local__Network__Permission) selected_field = 954;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__CUG__Information) selected_field = 955;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__Dynamic__Address__Allowed) selected_field = 956;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Value__Digits) selected_field = 957;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__Auth) selected_field = 958;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Acct__Application__Id) selected_field = 959;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__Party__Address) selected_field = 960;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authenticate) selected_field = 961;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Type) selected_field = 962;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Immediate__Response__Preferred) selected_field = 963;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Zone) selected_field = 964;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__IPv6__Host) selected_field = 965;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Local__GW__Inserted__Indication) selected_field = 966;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__XRES) selected_field = 967;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Indication) selected_field = 968;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Deferred__Location__Event__Type) selected_field = 969;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI) selected_field = 970;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__User__State) selected_field = 971;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__HA__MSA) selected_field = 972;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Result__Code) selected_field = 973;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope) selected_field = 974;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Configuration__Activity) selected_field = 975;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Communication__Service__Identifier) selected_field = 976;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Address) selected_field = 977;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trust__Relationship__Update) selected_field = 978;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Downlink) selected_field = 979;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Session__Direction) selected_field = 980;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Realm) selected_field = 981;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__Identifier) selected_field = 982;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Reference__ID__Validity__Time) selected_field = 983;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Packet__Filter__Information) selected_field = 984;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Cell__Global__Identity) selected_field = 985;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__DL) selected_field = 986;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Transmitter__Info) selected_field = 987;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Group__Reporting__Guard__Timer) selected_field = 988;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Furnish__Charging__Information) selected_field = 989;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Identities) selected_field = 990;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Linking__Indicator) selected_field = 991;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Auth__Session__State) selected_field = 992;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Number__of__Reports) selected_field = 993;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Install) selected_field = 994;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Permission) selected_field = 995;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Range__Class) selected_field = 996;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Carrier__Select__Routing__Information) selected_field = 997;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Negotiation) selected_field = 998;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__LIPA__Permission) selected_field = 999;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Auth__Data__Item) selected_field = 1000;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__3GPP2__MEID) selected_field = 1001;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__MSA) selected_field = 1002;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data) selected_field = 1003;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Multiple__Registration__Indication) selected_field = 1004;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__UTRAN) selected_field = 1005;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Specific__Application__Id) selected_field = 1006;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMSI__Unauthenticated__Flag) selected_field = 1007;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Id) selected_field = 1008;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Subscription__Data) selected_field = 1009;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Diagnostics) selected_field = 1010;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__Service__Selection) selected_field = 1011;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TS__Code) selected_field = 1012;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Endpoint) selected_field = 1013;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AN__Trusted) selected_field = 1014;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Funtionality) selected_field = 1015;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Aux__Applic__Info) selected_field = 1016;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Nonce) selected_field = 1017;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Number) selected_field = 1018;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AAR__Flags) selected_field = 1019;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__External__ID) selected_field = 1020;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__VLR__Number) selected_field = 1021;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Install) selected_field = 1022;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Rx__Request__Type) selected_field = 1023;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Response) selected_field = 1024;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Trunk__Group__Id) selected_field = 1025;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Transport__Access__Type) selected_field = 1026;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id) selected_field = 1027;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Remove) selected_field = 1028;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__CSG__Subscription__Data) selected_field = 1029;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Body) selected_field = 1030;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Duration__Time) selected_field = 1031;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Availability__Change__Reason) selected_field = 1032;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Identifier) selected_field = 1033;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__PLMN__Identifier) selected_field = 1034;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Location__Area__Identity) selected_field = 1035;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Status) selected_field = 1036;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length__Value) selected_field = 1037;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__Challenge) selected_field = 1038;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Visited__Network__Identifier) selected_field = 1039;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__RIR__Flags) selected_field = 1040;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Volume__Quota__Threshold) selected_field = 1041;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Incremental__Cost) selected_field = 1042;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Level) selected_field = 1043;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__LTE) selected_field = 1044;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__UL) selected_field = 1045;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Subscriber__Status) selected_field = 1046;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Identity__with__Emergency__Registration) selected_field = 1047;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Received__Address) selected_field = 1048;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service) selected_field = 1049;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Change__Usage) selected_field = 1050;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__PrivacyException) selected_field = 1051;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__QoS__Subscribed) selected_field = 1052;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IP__Address) selected_field = 1053;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Value) selected_field = 1054;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Read__Reply__Report__Requested) selected_field = 1055;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Charging__TimeStamp) selected_field = 1056;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__RR__Bandwidth) selected_field = 1057;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Auth) selected_field = 1058;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Service__Context__Id) selected_field = 1059;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Length) selected_field = 1060;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__TimeStamps) selected_field = 1061;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Charging__Identifier) selected_field = 1062;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK__SPI) selected_field = 1063;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Trigger) selected_field = 1064;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__DL) selected_field = 1065;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__SCS__Identity) selected_field = 1066;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Name__String) selected_field = 1067;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Address) selected_field = 1068;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Identifier) selected_field = 1069;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Inband__Security__Id) selected_field = 1070;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Value) selected_field = 1071;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Name) selected_field = 1072;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Ip__Domain__Id) selected_field = 1073;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__IP__Address) selected_field = 1074;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__UE__Usage__Type) selected_field = 1075;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction) selected_field = 1076;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Charged__Party) selected_field = 1077;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PDN__Connection__Charging__ID) selected_field = 1078;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data__Already__Available) selected_field = 1079;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Security__Parameter__Index) selected_field = 1080;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Number__for__MT__SMS) selected_field = 1081;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__UL) selected_field = 1082;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Correlation__Id) selected_field = 1083;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Host) selected_field = 1084;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Route__Record) selected_field = 1085;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__User__Data__Header) selected_field = 1086;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Carrier__Frequency) selected_field = 1087;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__Information) selected_field = 1088;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Mandatory__Capability) selected_field = 1089;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__NE__Type__List) selected_field = 1090;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Charging__Characteristics__Selection__Mode) selected_field = 1091;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Port__Limit) selected_field = 1092;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Feature__Vector) selected_field = 1093;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Credit__Control) selected_field = 1094;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__All__APN__Configurations__Included__Indicator) selected_field = 1095;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__NOR__Flags) selected_field = 1096;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Message__ID) selected_field = 1097;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__MS__TimeZone) selected_field = 1098;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__External__Client) selected_field = 1099;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Charge__Reason__Code) selected_field = 1100;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Authorization__Lifetime) selected_field = 1101;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__PCO) selected_field = 1102;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Conditions) selected_field = 1103;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Language) selected_field = 1104;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__DL) selected_field = 1105;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Features) selected_field = 1106;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Framed__MTU) selected_field = 1107;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Quota__Threshold) selected_field = 1108;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Accounting__Auth__Method) selected_field = 1109;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Offset) selected_field = 1110;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Information) selected_field = 1111;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Capability) selected_field = 1112;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Service__URN) selected_field = 1113;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Services) selected_field = 1114;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Description) selected_field = 1115;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Packets) selected_field = 1116;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Info) selected_field = 1117;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__DeActivation__Time) selected_field = 1118;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Relay__Node__Indicator) selected_field = 1119;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__T4__Data) selected_field = 1120;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Fixed__User__Location__Info) selected_field = 1121;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Status) selected_field = 1122;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Online) selected_field = 1123;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Base__Name) selected_field = 1124;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SCEF__Realm) selected_field = 1125;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Charged__Party) selected_field = 1126;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Requested__Validity__Time) selected_field = 1127;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Number) selected_field = 1128;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Information) selected_field = 1129;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Features) selected_field = 1130;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Time__Zone) selected_field = 1131;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__GERAN__Vector) selected_field = 1132;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Call__ID__SIP__Header) selected_field = 1133;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Online__Charging__Flag) selected_field = 1134;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Number__of__Messages__Sent) selected_field = 1135;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Subscribed__QoS__Profile) selected_field = 1136;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Session__Stop__Indicator) selected_field = 1137;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__GPRS__Subscription__Data) selected_field = 1138;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GPRS__Negotiated__QoS__Profile) selected_field = 1139;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Type) selected_field = 1140;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Called__Station__Id) selected_field = 1141;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__UE__Transfer) selected_field = 1142;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__Cost__Unit) selected_field = 1143;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Realtime__Required) selected_field = 1144;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Termination__Cause) selected_field = 1145;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Volume) selected_field = 1146;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Rate) selected_field = 1147;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Class__Identifier) selected_field = 1148;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Allocate__IP__Type) selected_field = 1149;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SM__Back__Off__Timer) selected_field = 1150;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__Specific__Action) selected_field = 1151;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Detection__Time) selected_field = 1152;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Login__TCP__Port) selected_field = 1153;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__Password__Retry) selected_field = 1154;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Stamps) selected_field = 1155;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Base__Time__Interval) selected_field = 1156;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__UWAN__User__Location__Info) selected_field = 1157;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Role__Of__UE) selected_field = 1158;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__RAT__Type) selected_field = 1159;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Address) selected_field = 1160;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Type) selected_field = 1161;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause) selected_field = 1162;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__RX__3GPP__AF__Signalling__Protocol) selected_field = 1163;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__PLMNs) selected_field = 1164;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result__Code) selected_field = 1165;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Location__Information) selected_field = 1166;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Authorised__QoS) selected_field = 1167;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Transmission) selected_field = 1168;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Stop__Time) selected_field = 1169;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Code) selected_field = 1170;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Vulnerability) selected_field = 1171;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__Equivalent__PLMN__List) selected_field = 1172;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Access) selected_field = 1173;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Applications) selected_field = 1174;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__BASE__NONE__Class) selected_field = 1175;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Challenge__Response) selected_field = 1176;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Message__Type) selected_field = 1177;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__NONE && field_avp__header.avp__code().vendor__id__NONE() == AVP__Code__NONE::avp__code__DCC__NONE__CC__Sub__Session__Id) selected_field = 1178;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__IDR__Flags) selected_field = 1179;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__PCC__3GPP__PS__to__CS__Session__Continuity) selected_field = 1180;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Subscription__Data) selected_field = 1181;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Refund__Information) selected_field = 1182;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Element) selected_field = 1183;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Type) selected_field = 1184;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__AAA__3GPP__AMBR) selected_field = 1185;
  else if (field_avp__header.avp__code().get_selection() == AVP__Code::ALT_vendor__id__3GPP && field_avp__header.avp__code().vendor__id__3GPP() == AVP__Code__3GPP::avp__code__DCA__3GPP__Submission__Time) selected_field = 1186;
  else selected_field = 1187;
  RAW_Force_Omit field_1_force_omit(1, force_omit, AVP_avp__data_descr_.raw->forceomit);
  decoded_field_length = field_avp__data.RAW_decode(AVP_avp__data_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AVP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AVP_avp__header_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AVP_avp__data_descr_.raw);
  encoded_length += field_avp__header.RAW_encode(AVP_avp__header_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_avp__data.RAW_encode(AVP_avp__data_descr_, *myleaf.body.node.nodes[1]);
  if (myleaf.body.node.nodes[0]->body.node.nodes[2]) {
  int tmp_length = myleaf.body.node.nodes[0]->body.node.nodes[2]->length;
  delete myleaf.body.node.nodes[0]->body.node.nodes[2];
  myleaf.body.node.nodes[0]->body.node.nodes[2] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[0], &(myleaf.body.node.nodes[0]->curr_pos), 2, UINT24_descr_.raw);
  myleaf.body.node.nodes[0]->body.node.nodes[2]->length = tmp_length;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->coding_descr = &UINT24_descr_;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->body.node.nodes[2]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  }
  switch (field_avp__data.get_selection()) {
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__SGSN__IPv6__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__IPv6__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__IPv6__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__LAT__Service:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Service) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Service);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__RAR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__RAR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__RAR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SCS__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__GGSN__MCC__MNC:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__MCC__MNC) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__MCC__MNC);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Direct__Debiting__Failure__Handling:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Direct__Debiting__Failure__Handling) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Direct__Debiting__Failure__Handling);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__Careof__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Careof__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Careof__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__TWAN__User__Location__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__TWAN__User__Location__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__TWAN__User__Location__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__User__Role__IDs:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__IDs) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__IDs);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Announcement__Order:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Order) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Order);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__ETSI__Line__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__ETSI || field_avp__header.avp__code().vendor__id__ETSI() != AVP__Code__ETSI::avp__code__CxDx__ETSI__Line__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__ETSI new_val(AVP__Code__ETSI::avp__code__CxDx__ETSI__Line__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__ETSI_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Bearer__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Content__Version:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Content__Version) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Content__Version);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Applic__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Applic__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Applic__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__HA__to__FA__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Route__Header__Transmitted:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Transmitted) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Transmitted);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Reporting__Reason:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Reporting__Reason) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Reporting__Reason);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Emergency__Services:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Services) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Services);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Media__Component__Description:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Description) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Description);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__CSG__Information__Reporting:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__CSG__Information__Reporting) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__CSG__Information__Reporting);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Measurement__Quantity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Quantity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Quantity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Location__Information__Configuration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Location__Information__Configuration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Location__Information__Configuration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Bearer__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Application__provided__Called__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Application__provided__Called__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Application__provided__Called__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Proximity__Alert__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Tunnel__Header__Filter:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Filter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Filter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__List__Of__Measurements:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__List__Of__Measurements) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__List__Of__Measurements);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Requested__Service__Unit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Requested__Service__Unit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Requested__Service__Unit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Default__QoS__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UVA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UVA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UVA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Expires:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Expires) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Expires);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SAR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SAR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SAR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Group__Service__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Group__Service__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Group__Service__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Recipient__SCCP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__SCCP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__SCCP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Preferred__AoC__Currency:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Preferred__AoC__Currency) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Preferred__AoC__Currency);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Pool:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Pool) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Pool);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Traffic__Data__Volumes:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Traffic__Data__Volumes) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Traffic__Data__Volumes);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Requested__EUTRAN__Authentication__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__EUTRAN__Authentication__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__EUTRAN__Authentication__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Unit__Cost:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Cost) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Cost);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Digest__Authenticate:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Digest__Authenticate) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Digest__Authenticate);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Last__UE__Activity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Last__UE__Activity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Last__UE__Activity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Context__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Context__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Context__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Used__Service__Unit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Used__Service__Unit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Used__Service__Unit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Reg__Reply:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Reply) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Reply);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Auth__Application__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Auth__Application__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Auth__Application__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Reference:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Reference) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Reference);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__Access__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Access__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Access__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Status__AS__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Status__AS__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Status__AS__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Client__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Appletalk__Network:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Network) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Network);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IPv6__Prefix:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Prefix) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Prefix);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Session__Initiation__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Initiation__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Initiation__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Sharing__Key__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Content__Size:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Size) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Size);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Access__Network__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Network__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Network__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__AF__Charging__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__AF__Charging__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__AF__Charging__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Monitoring__Event__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Specific__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Event:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Event) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Event);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Media__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Media__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Media__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Conditional__Policy__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__Policy__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__Policy__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Firmware__Revision:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Firmware__Revision) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Firmware__Revision);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Event__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Event__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Event__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Network__Request__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Network__Request__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Network__Request__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SIPTO__Permission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Permission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Permission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Terminating__IOI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Terminating__IOI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Terminating__IOI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Max__Supported__BW__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__UE__Local__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__UE__Local__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__UE__Local__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Sequence__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Sequence__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Sequence__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Presence__Reporting__Area__Elements__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Elements__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Elements__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Remove:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Remove) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Remove);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SGs__MME__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SGs__MME__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SGs__MME__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Roaming__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Roaming__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Roaming__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__Of__Diversions:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Diversions) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Diversions);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Coverage__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Authentication__Scheme:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Scheme) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Scheme);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Event__Threshold__RSRP:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRP) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRP);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__User__Authorization__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Authorization__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Authorization__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PLMN__Client:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PLMN__Client) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PLMN__Client);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Re__Synchronization__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Re__Synchronization__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Re__Synchronization__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Auth__Grace__Period:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Auth__Grace__Period) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Auth__Grace__Period);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__User__CSG__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__User__CSG__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__User__CSG__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IP__Realm__Default__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IP__Realm__Default__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IP__Realm__Default__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__RAND:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__RAND) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__RAND);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Depth:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Depth) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Depth);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__MN__to__FA__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__FA__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__FA__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SGSN__User__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__User__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__User__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__APN__OI__Replacement:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__APN__OI__Replacement) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__APN__OI__Replacement);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Alternate__Charged__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Alternate__Charged__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Alternate__Charged__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__APN__Rate__Control:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Re__Auth__Request__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Re__Auth__Request__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Re__Auth__Request__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Relationship__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Relationship__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Relationship__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__External__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__External__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__External__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Positioning__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Positioning__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Positioning__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Redirect__Address__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Address__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Address__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__MN__HA__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__UE__HPLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__HPLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__HPLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TFT__Filter:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Filter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Filter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Max__Supported__Bandwidth__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Loss__Of__Connectivity__Reason:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Loss__Of__Connectivity__Reason) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Loss__Of__Connectivity__Reason);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Medium__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Medium__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Medium__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__User__Equipment__Info__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Flow__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Home__Agent__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Resource__Allocation__Notification:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Allocation__Notification) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Allocation__Notification);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Basic__Service__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Basic__Service__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Basic__Service__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Monitoring__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Role__Of__Node:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__Node) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__Node);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Default__Bearer__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Bearer__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Bearer__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Class__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Class__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Class__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__VPLMN__LIPA__Allowed:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__LIPA__Allowed) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__LIPA__Allowed);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Mute__Notification:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Mute__Notification) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Mute__Notification);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Authentication__Context:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Context) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authentication__Context);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__QoS__Resources:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Resources) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Resources);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Logging__Duration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Duration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Duration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Service__Parameter__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Associated__Registered__Identities:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Registered__Identities) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Registered__Identities);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__WLAN__offloadability__EUTRAN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__EUTRAN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__EUTRAN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MBMS__GW__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__GW__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__GW__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Destination__Interface:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Destination__Interface) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Destination__Interface);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Emergency__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Emergency__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Emergency__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Change__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__KASME:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__KASME) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__KASME);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Session__Key:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Session__Key) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Session__Key);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Cost__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Cost__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Cost__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__User__Location__Info__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Teleservice__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Teleservice__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Teleservice__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UTRAN__Vector:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UTRAN__Vector) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UTRAN__Vector);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Non__3GPP__IP__Access__APN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access__APN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access__APN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__Event__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Tariff__Time__Change:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Time__Change) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Time__Change);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__NSAPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__NSAPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__NSAPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Client__Dialed__By__MS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Dialed__By__MS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Dialed__By__MS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__CG__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Envelope__Start__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Start__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Start__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Application__Service__Provider__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Application__Service__Provider__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Application__Service__Provider__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__NIDD__Authorization__Request:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Request) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Request);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Received__Talk__Burst__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Incoming__Trunk__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Incoming__Trunk__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Incoming__Trunk__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AAA__Failure__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AAA__Failure__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AAA__Failure__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Rate__Control__Max__Message__Size:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Message__Size) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Message__Size);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Install:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Install) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Install);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Periodic__Communication__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Communication__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Communication__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Specific__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Flow__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__RAN__Rule__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__Rule__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__Rule__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Password:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Password) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Password);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PC3__EPC__Control__Protocol__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__EPC__Control__Protocol__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__EPC__Control__Protocol__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Monitoring__Duration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Duration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Duration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Routing__Area__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Routing__Area__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Routing__Area__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Called__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Service__Authorization__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Service__Authorization__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Service__Authorization__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunneling:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunneling) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunneling);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__User__Equipment__Info__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Auth__Input__Data__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Auth__Input__Data__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Auth__Input__Data__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__eDRX__Cycle__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Multi__Round__Time__Out:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Multi__Round__Time__Out) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Multi__Round__Time__Out);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Group__Monitoring__Event__Report__Item:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report__Item) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report__Item);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Rule__Failure__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Failure__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Failure__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Ext__PDP__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Quota__Threshold:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Threshold) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Threshold);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__User__Location__Info__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__User__Location__Info__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__User__Location__Info__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Usage__Monitoring__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Measurement__Period__LTE:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__LTE) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__LTE);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Extended__APN__AMBR__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Experimental__Result__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Session__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Session__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Session__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Recipient__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Format:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Format) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Format);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Start__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Deregistration__Reason:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Deregistration__Reason) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Deregistration__Reason);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__GMLC__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Software__Version:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Software__Version) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Software__Version);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Callback__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Configuration__Token:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Configuration__Token) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Configuration__Token);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Interface__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Originating__Foreign__AAA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Originating__Foreign__AAA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Originating__Foreign__AAA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Expiration__Date:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Expiration__Date) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Expiration__Date);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Error__Message:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Error__Message) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Error__Message);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SRES:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SRES) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SRES);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__DRM__Content:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__DRM__Content) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__DRM__Content);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Item__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Item__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Item__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__Port__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ERP__Authorization:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ERP__Authorization) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ERP__Authorization);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Multiple__Services__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Early__Media__Description:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Early__Media__Description) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Early__Media__Description);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MIP__FA__RK:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Related__Change__Condition__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Change__Condition__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Change__Condition__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Protocol:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Protocol) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Protocol);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Format__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Format__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Format__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__IMSI__MCC__MNC:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI__MCC__MNC) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI__MCC__MNC);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Abort__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Abort__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Abort__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ISUP__Cause__Location:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Location) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Location);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Base__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Base__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Base__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Required__Access__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Required__Access__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Required__Access__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__Destination__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__S6t__HSS__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__S6t__HSS__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__S6t__HSS__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Media__Initiator__Party:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Party) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Party);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Associated__URI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__URI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__URI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__AF__Requested__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__AF__Requested__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__AF__Requested__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Filter__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Filter__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Filter__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Password:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Password) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Password);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Route__Header__Received:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Received) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Route__Header__Received);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Stationary__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Stationary__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Stationary__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__CHAP__Response:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Response) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Response);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Traffic__Steering__Policy__Identifier__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Usage__Information__Report__Sequence__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Usage__Information__Report__Sequence__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Usage__Information__Report__Sequence__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Geodetic__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Geodetic__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Geodetic__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Extended__GBR__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MBSFN__Area__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Server__Capabilities:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Capabilities) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Capabilities);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Area__Scope:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Area__Scope) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Area__Scope);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__Accounting__Input__Packets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Packets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Packets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SGW__Change:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Change) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Change);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SCSCF__Restoration__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SCSCF__Restoration__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SCSCF__Restoration__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Initial__CSeq__Sequence__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Initial__CSeq__Sequence__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Initial__CSeq__Sequence__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Subscription__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Subscription__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Subscription__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PUA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PUA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PUA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Callback__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Callback__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Primary__Event__Charging__Function__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Event__Charging__Function__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Event__Charging__Function__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Output__Octets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Output__Octets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Output__Octets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__User__Location__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__User__Location__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Notification__To__UE__User:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Notification__To__UE__User) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Notification__To__UE__User);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Visited__PLMN__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Visited__PLMN__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Visited__PLMN__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Homogeneous__Support__of__IMS__Voice__Over__PS__Sessions:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Homogeneous__Support__of__IMS__Voice__Over__PS__Sessions) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Homogeneous__Support__of__IMS__Voice__Over__PS__Sessions);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Participant__Group:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Group) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Group);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Play__Alternative:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Play__Alternative) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Play__Alternative);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MBMS__User__Service__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__User__Service__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__User__Service__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Transit__IOI__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Transit__IOI__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Transit__IOI__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Codec__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Codec__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Codec__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Monitoring__Event__Config__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Config__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Config__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Media__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AF__Correlation__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AF__Correlation__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AF__Correlation__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Cost__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Cost__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Cost__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Serving__Node__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Error__Reporting__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Error__Reporting__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Error__Reporting__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Radio__Frequency:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Frequency) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Frequency);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Rule__Activation__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Activation__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__Activation__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__AF__Application__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__AF__Application__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__AF__Application__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__NetLoc__Access__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__NetLoc__Access__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__NetLoc__Access__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Announcing__UE__VPLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__VPLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__VPLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Monitoring__Event__Configuration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Configuration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Monitoring__Event__Configuration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Offline:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Offline) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Offline);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SIP__Method:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Method) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Method);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Definition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Definition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Definition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Additional__Context__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Additional__Context__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Additional__Context__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__Service:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__Service) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__Service);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Security__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Allowed__PLMN__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Allowed__PLMN__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Allowed__PLMN__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Bearer__Control__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Control__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Control__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Active__APN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Active__APN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Active__APN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__HeNB__Local__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__HeNB__Local__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__HeNB__Local__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Packet__Filter__Content:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Content) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Content);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SMS__Register__Request:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SMS__Register__Request) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SMS__Register__Request);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Subscription__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Subscription__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Subscription__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SIP__Response__Timestamp__Fraction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp__Fraction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp__Fraction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Client__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Client__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Client__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__APN__Configuration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Subscriber__Role:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Subscriber__Role) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Subscriber__Role);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Number__Auth__Items:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Number__Auth__Items) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Number__Auth__Items);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__OMC__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__OMC__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__OMC__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__GMLC__Restriction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Restriction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__GMLC__Restriction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Preference:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Preference) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Preference);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Session__Failover:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Session__Failover) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Session__Failover);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Enhanced__Diagnostics:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Enhanced__Diagnostics) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Enhanced__Diagnostics);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CSG__Membership__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Membership__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Membership__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Regional__Subscription__Zone__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Regional__Subscription__Zone__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Regional__Subscription__Zone__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Message__Class:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Class) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Class);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Negotiated__DSCP:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Negotiated__DSCP) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Negotiated__DSCP);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__S2a__Failure__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__S2a__Failure__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__S2a__Failure__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__FA__to__MN__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Trigger:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Called__Identity__Change:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity__Change) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity__Change);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Request__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Request__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Request__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Proxy__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Proxy__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Proxy__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Server__Role:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Server__Role) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Server__Role);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Forwarding__Pending:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Forwarding__Pending) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Forwarding__Pending);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__SIR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__SIR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__SIR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Credit__Control__Failure__Handling:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control__Failure__Handling) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control__Failure__Handling);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP6__Agent__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Agent__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Agent__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__MPS__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__MPS__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__MPS__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Credit__Management__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Credit__Management__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Credit__Management__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MDT__Allowed__PLMN__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Allowed__PLMN__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Allowed__PLMN__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitored__PLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitored__PLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitored__PLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__Result:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Reporting__Level:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Reporting__Level) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Reporting__Level);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MME__Location__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Location__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Location__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Served__Party__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Served__Party__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Served__Party__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Max__Supported__Bandwidth__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Max__Supported__Bandwidth__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__First__Reception:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Reception) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Reception);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Pre__emption__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscribed__VSRVCC:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__VSRVCC) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__VSRVCC);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Monitoring__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Redirect__Max__Cache__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Max__Cache__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Max__Cache__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Feature__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Address__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TCP__Source__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TCP__Source__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TCP__Source__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Application__Detection__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Application__Detection__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Application__Detection__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Emergency__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Emergency__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Remaining__Balance:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Remaining__Balance) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Remaining__Balance);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MPS__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MPS__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MPS__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Next__Tariff:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Next__Tariff) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Next__Tariff);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Requested__Action:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Requested__Action) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Requested__Action);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Record__Route:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Record__Route) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Record__Route);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Tariff__XML:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__XML) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__XML);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Alert__Reason:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Alert__Reason) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Alert__Reason);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Recipient__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Change__Condition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Condition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Change__Condition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__CG__IPv6__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__IPv6__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CG__IPv6__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Idle__Timeout:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Idle__Timeout) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Idle__Timeout);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__Port__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DEA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DEA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DEA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SCS__AS__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__AS__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__AS__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MO__LR:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MO__LR) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MO__LR);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Visited__Network__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Visited__Network__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Visited__Network__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__User__Role:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Announcement__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Non__3GPP__IP__Access:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__IP__Access);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__Event__Report__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Adaptations:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Adaptations) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Adaptations);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Host__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Host__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Host__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Reg__Request:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Request) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Reg__Request);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Quota__Holding__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Holding__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Holding__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Maximum__Wait__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Maximum__Wait__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Maximum__Wait__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Max__Requested__Bandwidth__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Usage__Monitoring__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Maximum__Response__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Response__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Response__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Envelope__Reporting:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Reporting) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__Reporting);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Application__Server:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Sponsor__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Sponsor__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Sponsor__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Appletalk__Link:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Link) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Link);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Interface__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Interface__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Interface__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Proximity__Alert__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Alert__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__CoA__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Trunk__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Trunk__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Trunk__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Default__QoS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Default__QoS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__AN__GW__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Start__Of__Charging:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Of__Charging) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Start__Of__Charging);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Participants__Involved:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Participants__Involved) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Participants__Involved);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__NBIFOM__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Redirect__Support:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Support) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Support);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IMSI__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IMSI__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IMSI__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Cell__Global__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Cell__Global__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Cell__Global__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Vendor__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PDN__Connection__Continuity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Connection__Continuity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Connection__Continuity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Tariff__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Tariff__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Wildcarded__Public__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Wildcarded__Public__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Wildcarded__Public__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__Acct__Session__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__Acct__Session__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__Acct__Session__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DSA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DSA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DSA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Event__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Event__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Event__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__LCS__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Requestor__Id__String:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id__String) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id__String);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PDN__GW__Allocation__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__GW__Allocation__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__GW__Allocation__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Additional__Type__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Type__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Type__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__SGSN__MCC__MNC:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__MCC__MNC) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__MCC__MNC);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__HESSID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__HESSID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__HESSID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Content__Class:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Class) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Class);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Event__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Event__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Event__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__TAD__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__TAD__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__TAD__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Final__Unit__Action:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Action) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Action);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IMEI__Check__In__VPLMN__Result:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI__Check__In__VPLMN__Result) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI__Check__In__VPLMN__Result);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Generic__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Generic__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Generic__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Variable__Part__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Direct__Discovery__Model:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Discovery__Model) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Discovery__Model);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Max__Requested__BW__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Device__Trigger__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__User__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__User__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__User__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Base__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Base__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Base__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IPv6__Pool:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Pool) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Pool);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Restoration__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Restoration__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Restoration__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ISUP__Cause__Diagnostics:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Diagnostics) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Diagnostics);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Association__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Association__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Association__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Definition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Definition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Definition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Rating__Group:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Rating__Group) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Rating__Group);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__MN__HA__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MN__HA__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Min__Requested__Bandwidth__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Application__Specific__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Specific__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Specific__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__CoA__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__CoA__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Report__Amount:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Amount) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Amount);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Secondary__Charging__Collection__Function__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Charging__Collection__Function__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Charging__Collection__Function__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__User__Equipment__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__User__Equipment__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__A__MSISDN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__A__MSISDN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__A__MSISDN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Mobile__Node__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Mobile__Node__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Mobile__Node__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Number__Of__Requested__Vectors:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Number__Of__Requested__Vectors) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Number__Of__Requested__Vectors);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AIR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AIR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AIR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Protocol__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Protocol__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Protocol__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Low__Priority__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Priority__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Priority__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Geographical__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Geographical__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Geographical__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Participant__Action__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Action__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Action__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Node__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Loose__Route__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Loose__Route__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Loose__Route__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Service__Parameter__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MME__User__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MME__User__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MME__User__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Access__Restriction__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Restriction__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Restriction__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Service__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Service__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Service__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__UNI__PDU__CP__Only__Flag:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__UNI__PDU__CP__Only__Flag) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__UNI__PDU__CP__Only__Flag);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Filter__Rule:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Filter__Rule) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Filter__Rule);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Failed__AVP:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Failed__AVP) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Failed__AVP);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__RAT__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__RAT__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__RAT__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SS__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Neighbour__Node__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Neighbour__Node__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Neighbour__Node__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Location__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Quota__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__NIDD__Authorization__Update:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Update) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Update);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Specific__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Specific__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Subscription__Id__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__FA__to__HA__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Connectivity__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Connectivity__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Connectivity__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Packet__Filter__Operation:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Operation) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Operation);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__VCS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__VCS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__VCS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__SCEF__Reference__ID__for__Deletion:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID__for__Deletion) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID__for__Deletion);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Content__Disposition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Disposition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Disposition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__SIP__Forking__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__SIP__Forking__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__SIP__Forking__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__User__Password:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__User__Password) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__User__Password);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Group__IP__Multicast__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Group__IP__Multicast__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Group__IP__Multicast__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__IMEI__Change:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__IMEI__Change) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__IMEI__Change);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__IP__CAN__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Media__Component:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Component) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Component);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Min__Desired__BW__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Direct__Communication__Reception__Data__Container:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Reception__Data__Container) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Reception__Data__Container);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Authorization:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authorization) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authorization);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Revalidation__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Revalidation__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Revalidation__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Logging__Interval:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Interval) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Logging__Interval);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Presence__Reporting__Area__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Filter:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Filter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Filter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__WLAN__offloadability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Data__Coding__Scheme:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Data__Coding__Scheme) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Data__Coding__Scheme);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Metering__Method:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Metering__Method) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Metering__Method);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Acct__Tunnel__Connection:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Connection) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Connection);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Non__IP__Data__Delivery__Mechanism:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__Data__Delivery__Mechanism) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__Data__Delivery__Mechanism);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Initial__IMS__Charging__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Initial__IMS__Charging__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Initial__IMS__Charging__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__Filter__Rule:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Filter__Rule) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Filter__Rule);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Feature__Vector:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Feature__Vector) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Feature__Vector);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Session__Server__Failover:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Session__Server__Failover) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Session__Server__Failover);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Accumulated__Cost:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Accumulated__Cost) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Accumulated__Cost);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Integrity__Key:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Integrity__Key) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Integrity__Key);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__E__UTRAN__Vector:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Vector) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Vector);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SMSC__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SMSC__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SMSC__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PDP__Address__Prefix__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address__Prefix__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address__Prefix__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Experimental__Result:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Experimental__Result);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Acct__Link__Count:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Link__Count) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Link__Count);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Unit__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Unit__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Unit__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Event__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Event__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Event__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Client__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__PDP__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__PDP__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__PDP__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Reply__Message:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Reply__Message) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Reply__Message);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Connect__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Connect__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Connect__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Replay__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Replay__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Replay__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Proxy__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__Of__Talk__Bursts:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Talk__Bursts) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Talk__Bursts);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Short__Network__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Short__Network__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Short__Network__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Message__Size:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Size) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Size);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Additional__Exception__Reports:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Exception__Reports) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Exception__Reports);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Access__Transfer__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Communication__Pattern__Set:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Pattern__Set) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Pattern__Set);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAG__UP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__UP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__UP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MMBox__Storage__Requested:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MMBox__Storage__Requested) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MMBox__Storage__Requested);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Flow__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__CHAP__Challenge:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Challenge) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Challenge);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PC3__Control__Protocol__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__Control__Protocol__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PC3__Control__Protocol__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Unit__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Unit__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Unit__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Calling__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Calling__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Calling__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__MCPTT__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__MCPTT__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__MCPTT__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Group__Monitoring__Event__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Group__Monitoring__Event__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Upgrade:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Upgrade) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Upgrade);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PS__Append__Free__Format__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Append__Free__Format__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Append__Free__Format__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__AN__GW__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__AN__GW__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Service__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Service__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Service__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Monitoring__Key:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Key) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Key);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Measurement__Period__UMTS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__UMTS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Measurement__Period__UMTS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Media__Initiator__Flag:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Flag) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Media__Initiator__Flag);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ISUP__Location__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Location__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Location__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__3GPP__PS__Data__Off__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__3GPP__PS__Data__Off__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__3GPP__PS__Data__Off__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Install:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Install) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Install);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Reset__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Reset__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Reset__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Data__Container:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Data__Container) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Data__Container);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Server__Assignment__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Assignment__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Assignment__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PUR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PUR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PUR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__IP__CAN__Session__Charging__Scope:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Session__Charging__Scope) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__IP__CAN__Session__Charging__Scope);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Routing:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Routing) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Routing);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IMEI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IMEI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__CHAP__Ident:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Ident) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Ident);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Interface__Text:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Text) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Text);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Kc:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Kc) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Kc);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Current__Tariff:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Current__Tariff) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Current__Tariff);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SGSN__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__HPLMN__ODB:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__HPLMN__ODB) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__HPLMN__ODB);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Quota__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Domain__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Domain__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Domain__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Charging__Characteristics:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Characteristics) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Characteristics);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PDP__Context:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Context) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Context);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Money:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Money) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Money);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DER__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DER__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DER__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Data__Coding__Scheme:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Data__Coding__Scheme) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Data__Coding__Scheme);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__GGSN__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Proxy__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Proxy__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Related__IMS__Charging__Identifier__Node:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier__Node) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier__Node);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Node__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Node__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Node__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Talk__Burst__Volume:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Volume) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Volume);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Priority__Sharing__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Priority__Sharing__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Priority__Sharing__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Trigger__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Trigger__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Instance__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Instance__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Instance__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Scheduled__Communication__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Scheduled__Communication__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Scheduled__Communication__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Max__Requested__Bandwidth__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Max__Requested__Bandwidth__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Role__Of__ProSe__Function:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__ProSe__Function) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Role__Of__ProSe__Function);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Maximum__Latency:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Latency) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Latency);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PCC__Rule__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PCC__Rule__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PCC__Rule__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SIP__Response__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Response__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Extended__GBR__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__GBR__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MBSFN__Area:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MBSFN__Area);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__UE__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__UE__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__UE__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Server__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Server__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__APN__Validity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__APN__Validity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__APN__Validity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Allocation__Retention__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Allocation__Retention__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Allocation__Retention__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Check__Balance__Result:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Check__Balance__Result) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Check__Balance__Result);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Job__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Job__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Job__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Destination__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Destination__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Destination__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Positioning__Method:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Positioning__Method) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Positioning__Method);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__LIA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__LIA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__LIA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DL__Buffering__Suggested__Packet__Count:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DL__Buffering__Suggested__Packet__Count) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DL__Buffering__Suggested__Packet__Count);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Service__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__IP__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__IP__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__IP__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IDA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IDA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IDA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Security:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Security);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Origin__AAA__Protocol:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Origin__AAA__Protocol) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Origin__AAA__Protocol);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Last__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Last__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Last__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Charging__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Charging__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Charging__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ULA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ULA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ULA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originator__Interface:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Interface) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Interface);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IMS__Voice__Over__PS__Sessions__Supported:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IMS__Voice__Over__PS__Sessions__Supported) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IMS__Voice__Over__PS__Sessions__Supported);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Roaming__Restricted__Due__To__Unsupported__Feature:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Roaming__Restricted__Due__To__Unsupported__Feature) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Roaming__Restricted__Due__To__Unsupported__Feature);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__File__Repair__Supported:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__File__Repair__Supported) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__File__Repair__Supported);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IPX__Network:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPX__Network) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPX__Network);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Assignment__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Assignment__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Assignment__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Service__Specific__Units:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Service__Specific__Units) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Service__Specific__Units);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Answer__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Answer__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Answer__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__WLAN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Type__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Type__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Type__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__NIDD__Submission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__NIDD__Submission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__NIDD__Submission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__T4__Parameters:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__T4__Parameters) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__T4__Parameters);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Access__Network__Charging__Identifier__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Announcing__UE__HPLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__HPLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Announcing__UE__HPLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__AESE__Error__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Error__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Error__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__FA__to__HA__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__HA__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Event__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Sharing__Key__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Sharing__Key__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Remove:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Remove) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Remove);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Direct__Communication__Transmission__Data__Container:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Transmission__Data__Container) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Direct__Communication__Transmission__Data__Container);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Restricted__PLMN__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Restricted__PLMN__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Restricted__PLMN__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Access__Network__Charging__Identifier__Gx:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Network__Charging__Identifier__Gx) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Network__Charging__Identifier__Gx);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Age__Of__Location__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Age__Of__Location__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Age__Of__Location__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Group__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Group__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Group__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Max__Requested__BW__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Requested__BW__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Flow__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MTC__IWF__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MTC__IWF__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MTC__IWF__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Execution__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Execution__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Execution__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Server__Auth__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Auth__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Auth__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Contact:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Contact) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Contact);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Correlation__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Correlation__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Correlation__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Credit__Control:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Credit__Control);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Accounting__Record__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Event__Threshold__Event__1I:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1I) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1I);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SIP__Request__Timestamp__Fraction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp__Fraction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp__Fraction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__User__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Report__Interval:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Interval) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Report__Interval);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__RAN__NAS__Release__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__NAS__Release__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__RAN__NAS__Release__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Dynamic__Address__Flag__Extension:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag__Extension) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag__Extension);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Client__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Client__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Client__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Redirect__Host__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CSG__Access__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Access__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CSG__Access__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Equipment__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Equipment__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Equipment__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Supplementary__Service:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Supplementary__Service) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Supplementary__Service);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Packet__Filter:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Packet__Filter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Packet__Filter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Redirect__Server__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP6__Auth__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Auth__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Auth__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__EPS__Location__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Location__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Location__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Access__Network__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Network__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Network__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Called__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__Default__APN__Context__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Default__APN__Context__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Default__APN__Context__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SGSN__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SGSN__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SGSN__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SGi__PtP__Tunnelling__Method:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SGi__PtP__Tunnelling__Method) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SGi__PtP__Tunnelling__Method);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Session__Timeout:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Session__Timeout) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Session__Timeout);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Acct__Tunnel__Packets__Lost:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Packets__Lost) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Tunnel__Packets__Lost);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__NNI__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Service__Info__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Service__Info__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Service__Info__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__CIR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__CIR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__CIR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Precedence:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Precedence) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Precedence);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__User__Participating__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__User__Participating__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__User__Participating__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__GGSN__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__GGSN__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__GGSN__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Sponsoring__Action:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Sponsoring__Action) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Sponsoring__Action);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Radio__Resources__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Resources__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Resources__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Granted__Validity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Granted__Validity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Granted__Validity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Priority__Level:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Priority__Level) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Priority__Level);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Node__Functionality:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Functionality) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Node__Functionality);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Flow__Description:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Description) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Flow__Description);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Packet__Filter__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Daylight__Saving__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Daylight__Saving__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Daylight__Saving__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Address__Domain:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Domain) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Domain);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__SCEF__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Content__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Removal__Of__Access:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Removal__Of__Access) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Removal__Of__Access);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Preferred__Data__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Preferred__Data__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Preferred__Data__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Functionality:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Functionality) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Functionality);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Low__Balance__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Balance__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Low__Balance__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Guaranteed__Bitrate__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UE__SRVCC__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UE__SRVCC__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UE__SRVCC__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__LAT__Group:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Group) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Group);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__IPv6__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IPv6__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IPv6__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__MAC__Mobility__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MAC__Mobility__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__MAC__Mobility__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__Accounting__Output__Octets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Octets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Octets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__To__SIP__Header:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__To__SIP__Header) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__To__SIP__Header);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Coupled__Node__Diameter__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Coupled__Node__Diameter__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Coupled__Node__Diameter__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Real__Time__Tariff__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Real__Time__Tariff__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Real__Time__Tariff__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__STN__SR:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__STN__SR) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__STN__SR);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Supported__Vendor__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Supported__Vendor__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Supported__Vendor__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ServiceTypeIdentity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ServiceTypeIdentity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ServiceTypeIdentity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Requested__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Announcement__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Announcement__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Acct__Authentic:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Authentic) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Authentic);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Service__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Service__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Service__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AUTN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AUTN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AUTN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Non__3GPP__User__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__User__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Non__3GPP__User__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Delivery__Report__Requested:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Delivery__Report__Requested) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Delivery__Report__Requested);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__TWAN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__TWAN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__TWAN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Origination__Time__Stamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Origination__Time__Stamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Origination__Time__Stamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__APN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__APN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__APN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Envelope__End__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__End__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope__End__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Sponsored__Connectivity__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Sponsored__Connectivity__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Sponsored__Connectivity__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Auth__Request__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Auth__Request__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Auth__Request__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Application__Server__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Application__Server__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originator__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Network__Call__Reference__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Network__Call__Reference__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Network__Call__Reference__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__AESE__Communication__Pattern:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__NBIFOM__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__NBIFOM__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Redirect__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Redirect__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Validity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Validity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Validity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__UE__VPLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__VPLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__VPLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Event__Handling:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Event__Handling) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Event__Handling);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ToS__Traffic__Class:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ToS__Traffic__Class) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ToS__Traffic__Class);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Tracking__Area__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Tracking__Area__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Tracking__Area__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__HA__to__FA__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__FA__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Min__Desired__Bandwidth__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UVR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UVR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UVR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PS__Free__Format__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Free__Format__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Free__Format__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Originating__Request:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Originating__Request) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Originating__Request);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PDN__Connection__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PDN__Connection__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PDN__Connection__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscription__Data__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IPv6__Route:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Route) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IPv6__Route);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PRA__Remove:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Remove) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Remove);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DSR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DSR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DSR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Granted__Service__Unit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Granted__Service__Unit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Granted__Service__Unit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__Portability__Routing__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Portability__Routing__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Portability__Routing__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscribed__Periodic__RAU__TAU__Timer:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__Periodic__RAU__TAU__Timer) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscribed__Periodic__RAU__TAU__Timer);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Specific__APN__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Specific__APN__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Specific__APN__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Terminal__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Terminal__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Terminal__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Restoration__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Restoration__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Restoration__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Product__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Product__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Product__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__HA__to__MN__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__MN__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__HA__to__MN__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Account__Expiration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Account__Expiration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Account__Expiration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__CSG__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IP__Netmask:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Netmask) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Netmask);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__IPv6__DNS__Servers:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IPv6__DNS__Servers) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IPv6__DNS__Servers);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SSID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SSID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SSID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Call__Barring__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Call__Barring__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Call__Barring__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__BSSID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__BSSID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__BSSID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Service__Parameter__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Service__Parameter__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Talk__Burst__Exchange:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Exchange) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Exchange);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Variable__Part__Order:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Order) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Order);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Quota__Mechanism:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Mechanism) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Quota__Mechanism);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ANID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ANID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ANID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__Event__Report__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Report__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__IP__SM__GW__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Origin__State__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Origin__State__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Origin__State__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Media__Sub__Component:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Media__Sub__Component) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Media__Sub__Component);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CN__Operator__Selection__Entity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CN__Operator__Selection__Entity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CN__Operator__Selection__Entity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Accuracy:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Accuracy) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Accuracy);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Remove:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Remove) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Remove);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originating__IOI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__IOI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__IOI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Min__Requested__Bandwidth__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Min__Requested__Bandwidth__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Function__PLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__PLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__PLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Tunnel__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Bearer__Service:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Service) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Service);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Primary__Charging__Collection__Function__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Charging__Collection__Function__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Primary__Charging__Collection__Function__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Definition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Definition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Definition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Time__Zone:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Time__Zone) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Time__Zone);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Periodic__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Periodic__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Failure__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Failure__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Failure__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__Destination__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Destination__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Local__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Discharge__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Discharge__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Discharge__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Requestor__PLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Requestor__PLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Requestor__PLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Application__Reference__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Application__Reference__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Application__Reference__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Service__Area__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Area__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Area__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__User__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__User__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__User__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UE__PC5__AMBR:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UE__PC5__AMBR) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UE__PC5__AMBR);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Public__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Public__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Public__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Accounting__Sub__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Sub__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Sub__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Acct__Delay__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Delay__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Acct__Delay__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Local__Sequence__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Local__Sequence__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Local__Sequence__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__UAR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__UAR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__UAR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Collection__Period__RRM__UMTS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__UMTS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__UMTS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Operator__Determined__Barring:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Operator__Determined__Barring) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Operator__Determined__Barring);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Recipient__Received__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Received__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Recipient__Received__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Server__Endpoint:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Endpoint) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Server__Endpoint);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Candidate__Home__Agent__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Candidate__Home__Agent__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Candidate__Home__Agent__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Session__Binding:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Session__Binding) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Session__Binding);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__IMEISV:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMEISV) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMEISV);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SS__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SS__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__DCD__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__DCD__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__DCD__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Location__Estimate__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Addressee__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Addressee__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Addressee__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Acct__Multi__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Acct__Multi__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Acct__Multi__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Subscription__Id__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__Connectivity__Parameters:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connectivity__Parameters) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connectivity__Parameters);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Reply__Applic__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Applic__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Applic__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Participant__Access__Priority:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Access__Priority) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Participant__Access__Priority);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__RS__Bandwidth:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__RS__Bandwidth) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__RS__Bandwidth);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Reachability__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Algorithm__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Algorithm__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Algorithm__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Session__Description:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Session__Description) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Session__Description);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Min__Desired__BW__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Desired__BW__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Location__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__APN__Aggregate__Max__Bitrate__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Event__Threshold__RSRQ:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRQ) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__RSRQ);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__Parameters:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__Parameters) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__Parameters);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Presence__Reporting__Area__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SMS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ePDG__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ePDG__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ePDG__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Event__Trigger:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Trigger) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Trigger);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__GCS__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__GCS__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__GCS__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__QoS__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__QoS__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Install:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Install) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Install);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Non__IP__PDN__Type__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__PDN__Type__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Non__IP__PDN__Type__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__G__S__U__Pool__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Outgoing__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Controlling__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Controlling__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Controlling__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Dynamic__Address__Flag:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Dynamic__Address__Flag);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Confidentiality__Key:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Confidentiality__Key) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Confidentiality__Key);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Flow__Label:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Label) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Label);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Authentication__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Authentication__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Authentication__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Transcoder__Inserted__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Transcoder__Inserted__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Transcoder__Inserted__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SMS__Node:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Node) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Node);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Interface__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Interface__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Interface__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SGW__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SGW__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Charging__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Charging__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__CHAP__Algorithm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Algorithm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Algorithm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__APN__Configuration__Profile:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration__Profile) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__APN__Configuration__Profile);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__Of__Received__Talk__Bursts:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Received__Talk__Bursts) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Received__Talk__Bursts);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Full__Network__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Full__Network__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Full__Network__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Message__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__APN__Rate__Control__Uplink:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Uplink) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Uplink);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__CAMEL__Charging__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CAMEL__Charging__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__CAMEL__Charging__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__From__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__From__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__From__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAG__CP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__CP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAG__CP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PDP__Context__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Context__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Context__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Flows:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Flows) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Flows);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__User__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__User__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__User__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Change__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Privacy__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Privacy__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Privacy__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__CIA__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__CIA__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__CIA__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Min__Requested__BW__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Monitoring__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Monitoring__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Input__Octets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Input__Octets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Input__Octets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Teleservice:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Teleservice) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Teleservice);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Quota__Consumption__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Consumption__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Quota__Consumption__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__UE__Reachability__Configuration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__UE__Reachability__Configuration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__UE__Reachability__Configuration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Destination__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Destination__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Destination__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Acceptable__Service__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Acceptable__Service__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Acceptable__Service__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Flow__Direction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Direction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Flow__Direction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Reason__For__Cancellation:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Reason__For__Cancellation) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Reason__For__Cancellation);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Supported__Monitoring__Events:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Monitoring__Events) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Monitoring__Events);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CG__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CG__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CG__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Radio__Parameter__Set__Values:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Values) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Values);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Item__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Item__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Item__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Session__Release__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Release__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Release__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MDT__User__Consent:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__User__Consent) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__User__Consent);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__HSS__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__HSS__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__HSS__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP6__Home__Link__Prefix:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Home__Link__Prefix) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Home__Link__Prefix);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__LAT__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PCSCF__Restoration__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PCSCF__Restoration__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PCSCF__Restoration__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__G__S__U__Pool__Reference:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Reference) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__G__S__U__Pool__Reference);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Layer__2__Group__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Layer__2__Group__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Layer__2__Group__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Interface__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscription__Data__Deletion:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Deletion) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data__Deletion);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__Chargable__User__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__Chargable__User__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__Chargable__User__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__Collection__Entity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Collection__Entity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__Collection__Entity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Request__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Request__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Request__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Feature__List__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Feature__List__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Redirect__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Redirect__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Network__Access__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Network__Access__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Network__Access__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Compression:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Compression) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Compression);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Zone__Access:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Zone__Access) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Zone__Access);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Selection__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Selection__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Selection__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__QoS__Filter__Rule:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__QoS__Filter__Rule) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__QoS__Filter__Rule);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Complete__Data__List__Included__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Complete__Data__List__Included__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Complete__Data__List__Included__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__MN__AAA__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Client__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__SGSN__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__SGSN__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Related__IMS__Charging__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Related__IMS__Charging__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Called__Asserted__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Asserted__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Called__Asserted__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__TWAG__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__TWAG__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__TWAG__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__MSA__Lifetime:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MSA__Lifetime) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MSA__Lifetime);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Talk__Burst__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Talk__Burst__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Token__Text:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Token__Text) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Token__Text);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Rate__Control__Time__Unit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Time__Unit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Time__Unit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__External__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__External__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__External__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Reason__Header:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Reason__Header) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Reason__Header);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__WLCP__Key:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__WLCP__Key) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__WLCP__Key);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Reachability__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Reachability__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SIP__Request__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SIP__Request__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Route:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Route) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Route);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Private__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Private__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Private__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Request__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Source__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Source__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Source__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Type__Of__External__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Type__Of__External__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Type__Of__External__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Event__Report__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Report__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Event__Report__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MDT__Configuration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Configuration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MDT__Configuration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Usage__Monitoring__Report:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Report) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Report);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__Of__Participants:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Participants) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__Of__Participants);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MSC__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MSC__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MSC__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Priviledged__Sender__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Priviledged__Sender__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Priviledged__Sender__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Adjacent__Access__Restriction__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__Access__Restriction__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__Access__Restriction__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Service__Obligatory__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Obligatory__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service__Obligatory__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__RAT__Frequency__Selection__Priority__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__RAT__Frequency__Selection__Priority__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__RAT__Frequency__Selection__Priority__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__First__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Reason__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Default__EPS__Bearer__QoS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Default__EPS__Bearer__QoS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Default__EPS__Bearer__QoS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__CLR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__CLR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__CLR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ULR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ULR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ULR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originating__SCCP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__SCCP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originating__SCCP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__ICS__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__ICS__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__ICS__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Calling__Station__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Calling__Station__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Calling__Station__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Client__Auth__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Auth__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Auth__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Currency__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Currency__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Currency__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Cancellation__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Cancellation__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Cancellation__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__E2E__Sequence:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__E2E__Sequence) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__E2E__Sequence);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Origin__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Origin__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Origin__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PDN__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PDN__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Scale__Factor:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Scale__Factor) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Scale__Factor);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IM__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IM__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IM__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Prompt:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Prompt) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Prompt);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Offer__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Offer__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Offer__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PPR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PPR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PPR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MM__Content__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MM__Content__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MM__Content__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CPDT__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CPDT__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CPDT__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__GGSN__IPv6__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__IPv6__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GGSN__IPv6__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__DER__S6b__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__DER__S6b__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__DER__S6b__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SCS__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SCS__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Requestor__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Requestor__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Access__Network__Charging__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Redirect__Server:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Redirect__Server);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__AESE__Communication__Pattern__Config__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern__Config__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__AESE__Communication__Pattern__Config__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__User__Role__info__Units:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__info__Units) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__User__Role__info__Units);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Variable__Part:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__3rd__Party__Application__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__3rd__Party__Application__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__3rd__Party__Application__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Enhanced__Coverage__Restriction__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Bearer__Operation:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Operation) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Bearer__Operation);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Current__Location__Retrieved:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Current__Location__Retrieved) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Current__Location__Retrieved);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Pre__emption__Control__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Pre__emption__Control__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Pre__emption__Control__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__Application__Instance__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Instance__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Instance__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Device__Trigger__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Device__Trigger__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Service__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Service__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Acct__Interim__Interval:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Acct__Interim__Interval) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Acct__Interim__Interval);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Media__Component__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Path:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Path) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Path);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Packet__Filter__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Event__Threshold__Event__1F:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1F) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Event__Threshold__Event__1F);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__MONTE__Location__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__MONTE__Location__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__MONTE__Location__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Inter__Operator__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__Operator__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__Operator__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__RDS__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__RDS__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__RDS__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Proximity__Cancellation__Timestamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Cancellation__Timestamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Proximity__Cancellation__Timestamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MMTel__SService__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__SService__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__SService__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Optional__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Optional__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Optional__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Tunnel__Header__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Tunnel__Header__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Reporting__Trigger:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Reporting__Trigger) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Reporting__Trigger);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Conditional__APN__Aggregate__Max__Bitrate:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__APN__Aggregate__Max__Bitrate) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Conditional__APN__Aggregate__Max__Bitrate);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Secondary__Event__Charging__Function__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Event__Charging__Function__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Secondary__Event__Charging__Function__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Group__PLMN__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Group__PLMN__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Group__PLMN__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Reply__Path__Requested:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Path__Requested) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Reply__Path__Requested);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__User__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__User__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__User__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Serving__Node__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Serving__Node__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__LAT__Node:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Node) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__LAT__Node);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Originating__Line__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Originating__Line__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Originating__Line__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Exponent:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Exponent) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Exponent);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP__Authenticator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Authenticator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP__Authenticator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Requested__UTRAN__GERAN__Authentication__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__UTRAN__GERAN__Authentication__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Requested__UTRAN__GERAN__Authentication__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__Accounting__Input__Octets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Octets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Input__Octets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__EPS__User__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__User__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__User__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Origin__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Origin__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Origin__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Access__Authorization__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Authorization__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Access__Authorization__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PDP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PDP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CP__CIoT__EPS__Optimisation__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__NNI__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__NNI__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Location__Estimate:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Location__Estimate);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Offline__Charging:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Offline__Charging) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Offline__Charging);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Retry__Interval:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Retry__Interval) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Retry__Interval);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Accounting__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Additional__Content__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Content__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Additional__Content__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Restriction__Filter__Rule:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Restriction__Filter__Rule) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Restriction__Filter__Rule);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Cause__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Cause__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Cause__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__Connection__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connection__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__Connection__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Packet__Filter__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Packet__Filter__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Address__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Address__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__SCEF__Reference__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__SCEF__Reference__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Content__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Content__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Resource__Release__Notification:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Release__Notification) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Resource__Release__Notification);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Function__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Function__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Guaranteed__Bitrate__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Guaranteed__Bitrate__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Disconnect__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Disconnect__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Disconnect__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Error__Diagnostic:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Error__Diagnostic) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Error__Diagnostic);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Max__Supported__BW__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Max__Supported__BW__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__UDP__Source__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__UDP__Source__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__UDP__Source__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Total__Octets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Total__Octets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Total__Octets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Accounting__Record__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Record__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SMS__Result:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Result) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SMS__Result);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MMS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MMS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MMS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__From__SIP__Header:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__From__SIP__Header) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__From__SIP__Header);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Routing__Rule__Definition:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Definition) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Routing__Rule__Definition);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SIPTO__Local__Network__Permission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Local__Network__Permission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SIPTO__Local__Network__Permission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__CUG__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__CUG__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__CUG__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__VPLMN__Dynamic__Address__Allowed:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__Dynamic__Address__Allowed) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__Dynamic__Address__Allowed);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Value__Digits:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Value__Digits) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Value__Digits);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__MN__AAA__Auth:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__Auth) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__AAA__Auth);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Acct__Application__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Acct__Application__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Acct__Application__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Associated__Party__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__Party__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Associated__Party__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Authenticate:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authenticate) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Authenticate);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Service__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Service__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Immediate__Response__Preferred:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Immediate__Response__Preferred) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Immediate__Response__Preferred);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__Appletalk__Zone:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Zone) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__Appletalk__Zone);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__IPv6__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__IPv6__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__IPv6__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Local__GW__Inserted__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Local__GW__Inserted__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Local__GW__Inserted__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__XRES:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__XRES) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__XRES);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Final__Unit__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Final__Unit__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Deferred__Location__Event__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Deferred__Location__Event__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Deferred__Location__Event__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__IMSI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__IMSI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__User__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__User__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__User__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__MN__to__HA__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__HA__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__MN__to__HA__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Result__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Result__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Result__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Envelope:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Envelope);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__Event__Configuration__Activity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Configuration__Activity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Configuration__Activity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Communication__Service__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Communication__Service__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Communication__Service__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trust__Relationship__Update:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trust__Relationship__Update) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trust__Relationship__Update);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__APN__Rate__Control__Downlink:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Downlink) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__APN__Rate__Control__Downlink);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Session__Direction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Session__Direction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Session__Direction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__IP__SM__GW__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__UE__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__UE__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Reference__ID__Validity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Reference__ID__Validity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Reference__ID__Validity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TFT__Packet__Filter__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Packet__Filter__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TFT__Packet__Filter__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__E__UTRAN__Cell__Global__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Cell__Global__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__E__UTRAN__Cell__Global__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Min__Desired__Bandwidth__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Min__Desired__Bandwidth__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Transmitter__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Transmitter__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Transmitter__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Group__Reporting__Guard__Timer:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Group__Reporting__Guard__Timer) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Group__Reporting__Guard__Timer);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PS__Furnish__Charging__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Furnish__Charging__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PS__Furnish__Charging__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Associated__Identities:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Identities) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Associated__Identities);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Session__Linking__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Linking__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Session__Linking__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Auth__Session__State:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Auth__Session__State) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Auth__Session__State);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Maximum__Number__of__Reports:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Number__of__Reports) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Number__of__Reports);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PRA__Install:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Install) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PRA__Install);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__V2X__Permission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Permission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Permission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Range__Class:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Range__Class) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Range__Class);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Carrier__Select__Routing__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Carrier__Select__Routing__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Carrier__Select__Routing__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Negotiation:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Negotiation) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Negotiation);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__LIPA__Permission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__LIPA__Permission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__LIPA__Permission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__SIP__Auth__Data__Item:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Auth__Data__Item) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__SIP__Auth__Data__Item);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__3GPP2__MEID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__3GPP2__MEID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__3GPP2__MEID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__FA__to__MN__MSA:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__MSA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__to__MN__MSA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscription__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscription__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Multiple__Registration__Indication:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Multiple__Registration__Indication) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Multiple__Registration__Indication);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__WLAN__offloadability__UTRAN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__UTRAN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__WLAN__offloadability__UTRAN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Vendor__Specific__Application__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Specific__Application__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Vendor__Specific__Application__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMSI__Unauthenticated__Flag:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMSI__Unauthenticated__Flag) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMSI__Unauthenticated__Flag);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Interface__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Interface__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__CSG__Subscription__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Subscription__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__CSG__Subscription__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Diagnostics:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Diagnostics) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Diagnostics);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__Service__Selection:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__Service__Selection) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__Service__Selection);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TS__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TS__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TS__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Tunnel__Client__Endpoint:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Endpoint) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Tunnel__Client__Endpoint);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AN__Trusted:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AN__Trusted) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AN__Trusted);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Monitoring__Event__Funtionality:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Funtionality) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Monitoring__Event__Funtionality);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Aux__Applic__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Aux__Applic__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Aux__Applic__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Nonce:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Nonce) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Nonce);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__IP__SM__GW__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__IP__SM__GW__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AAR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AAR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AAR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Client__External__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__External__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Client__External__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__VLR__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__VLR__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__VLR__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Install:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Install) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Install);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Rx__Request__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Rx__Request__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Rx__Request__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__NIDD__Authorization__Response:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Response) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__NIDD__Authorization__Response);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Outgoing__Trunk__Group__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Trunk__Group__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Outgoing__Trunk__Group__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Transport__Access__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Transport__Access__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Transport__Access__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Subscription__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Subscription__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__QoS__Rule__Remove:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Remove) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__QoS__Rule__Remove);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__VPLMN__CSG__Subscription__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__CSG__Subscription__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__VPLMN__CSG__Subscription__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Message__Body:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Body) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Message__Body);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Communication__Duration__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Duration__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Communication__Duration__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Access__Availability__Change__Reason:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Availability__Change__Reason) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Access__Availability__Change__Reason);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__Application__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__Application__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Requested__PLMN__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__PLMN__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Requested__PLMN__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Location__Area__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Location__Area__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Location__Area__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Media__Component__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Media__Component__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__eDRX__Cycle__Length__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__eDRX__Cycle__Length__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__FA__Challenge:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__Challenge) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__FA__Challenge);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Visited__Network__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Visited__Network__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Visited__Network__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__RIR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__RIR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__RIR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Volume__Quota__Threshold:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Volume__Quota__Threshold) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Volume__Quota__Threshold);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Incremental__Cost:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Incremental__Cost) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Incremental__Cost);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Usage__Monitoring__Level:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Level) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Usage__Monitoring__Level);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Collection__Period__RRM__LTE:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__LTE) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Collection__Period__RRM__LTE);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Extended__APN__AMBR__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Extended__APN__AMBR__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Subscriber__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Subscriber__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Subscriber__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Identity__with__Emergency__Registration:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Identity__with__Emergency__Registration) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Identity__with__Emergency__Registration);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Originator__Received__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Received__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Originator__Received__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Service:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Service);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Tariff__Change__Usage:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Change__Usage) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Tariff__Change__Usage);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__LCS__PrivacyException:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__PrivacyException) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__LCS__PrivacyException);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__QoS__Subscribed:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__QoS__Subscribed) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__QoS__Subscribed);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__NAS__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__NAS__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Variable__Part__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Variable__Part__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Read__Reply__Report__Requested:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Read__Reply__Report__Requested) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Read__Reply__Report__Requested);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Event__Charging__TimeStamp:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Charging__TimeStamp) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Event__Charging__TimeStamp);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__RR__Bandwidth:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__RR__Bandwidth) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__RR__Bandwidth);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__CHAP__Auth:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Auth) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__CHAP__Auth);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Service__Context__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Service__Context__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Service__Context__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Authenticator__Length:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Length) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Length);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__TimeStamps:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__TimeStamps) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__TimeStamps);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__IMS__Charging__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Charging__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__IMS__Charging__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MIP__FA__RK__SPI:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK__SPI) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MIP__FA__RK__SPI);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Related__Trigger:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Trigger) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Related__Trigger);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__APN__Aggregate__Max__Bitrate__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__APN__Aggregate__Max__Bitrate__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__SCS__Identity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__SCS__Identity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__SCS__Identity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__LCS__Name__String:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Name__String) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__LCS__Name__String);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Access__Network__Charging__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Access__Network__Charging__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Presence__Reporting__Area__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Presence__Reporting__Area__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Inband__Security__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Inband__Security__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Inband__Security__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ISUP__Cause__Value:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Value) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause__Value);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Charging__Rule__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Charging__Rule__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Ip__Domain__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Ip__Domain__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Ip__Domain__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__TDF__IP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__IP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__TDF__IP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__UE__Usage__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__UE__Usage__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__UE__Usage__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Enhanced__Coverage__Restriction:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Enhanced__Coverage__Restriction);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Charged__Party:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Charged__Party) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Charged__Party);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PDN__Connection__Charging__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PDN__Connection__Charging__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PDN__Connection__Charging__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__User__Data__Already__Available:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data__Already__Available) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__User__Data__Already__Available);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Security__Parameter__Index:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Security__Parameter__Index) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Security__Parameter__Index);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__MME__Number__for__MT__SMS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Number__for__MT__SMS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__MME__Number__for__MT__SMS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Traffic__Steering__Policy__Identifier__UL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__UL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Traffic__Steering__Policy__Identifier__UL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Correlation__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Correlation__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Correlation__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Home__Agent__Host:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Host) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Home__Agent__Host);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Route__Record:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Route__Record) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Route__Record);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__User__Data__Header:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__User__Data__Header) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__User__Data__Header);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Carrier__Frequency:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Carrier__Frequency) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Carrier__Frequency);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MMTel__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MMTel__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Mandatory__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Mandatory__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Mandatory__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Trace__NE__Type__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__NE__Type__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Trace__NE__Type__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Charging__Characteristics__Selection__Mode:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Charging__Characteristics__Selection__Mode) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Charging__Characteristics__Selection__Mode);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Port__Limit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Port__Limit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Port__Limit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv6__NONE__MIP6__Feature__Vector:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Feature__Vector) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv6__NONE__MIP6__Feature__Vector);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Multiple__Services__Credit__Control:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Credit__Control) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Multiple__Services__Credit__Control);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__All__APN__Configurations__Included__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__All__APN__Configurations__Included__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__All__APN__Configurations__Included__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__NOR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__NOR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__NOR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Message__ID:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Message__ID) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Message__ID);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__MS__TimeZone:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__MS__TimeZone) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__MS__TimeZone);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__External__Client:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__External__Client) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__External__Client);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Charge__Reason__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Charge__Reason__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Charge__Reason__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Authorization__Lifetime:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Authorization__Lifetime) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Authorization__Lifetime);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__TWAN__PCO:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__PCO) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__TWAN__PCO);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Change__Conditions:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Conditions) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Change__Conditions);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Language:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Language) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Language);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Extended__Min__Requested__BW__DL:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__DL) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Extended__Min__Requested__BW__DL);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Features:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Features) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Features);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Framed__MTU:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Framed__MTU) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Framed__MTU);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Unit__Quota__Threshold:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Quota__Threshold) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Unit__Quota__Threshold);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Accounting__Auth__Method:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Accounting__Auth__Method) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Accounting__Auth__Method);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__MIP__Authenticator__Offset:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Offset) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__MIP__Authenticator__Offset);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MBMS__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Bearer__Capability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Capability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Bearer__Capability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Service__URN:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Service__URN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Service__URN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Supported__Services:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Services) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Supported__Services);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SDP__Media__Description:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Description) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SDP__Media__Description);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__MIPv4__NONE__Accounting__Output__Packets:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Packets) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__MIPv4__NONE__Accounting__Output__Packets);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Radio__Parameter__Set__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Radio__Parameter__Set__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Rule__DeActivation__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__DeActivation__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Rule__DeActivation__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Relay__Node__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Relay__Node__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Relay__Node__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__T4__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__T4__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__T4__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Fixed__User__Location__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Fixed__User__Location__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Fixed__User__Location__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Coverage__Status:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Status) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Coverage__Status);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Online:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Online) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Online);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__ADC__Rule__Base__Name:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Base__Name) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__ADC__Rule__Base__Name);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SCEF__Realm:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SCEF__Realm) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SCEF__Realm);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__MBMS__Charged__Party:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Charged__Party) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__MBMS__Charged__Party);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Requested__Validity__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Requested__Validity__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Requested__Validity__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Request__Number:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Number) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Request__Number);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__AoC__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__AoC__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Supported__Features:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Features) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Features);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Local__Time__Zone:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Time__Zone) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Local__Time__Zone);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__GERAN__Vector:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__GERAN__Vector) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__GERAN__Vector);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Call__ID__SIP__Header:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Call__ID__SIP__Header) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Call__ID__SIP__Header);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Online__Charging__Flag:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Online__Charging__Flag) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Online__Charging__Flag);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Number__of__Messages__Sent:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Number__of__Messages__Sent) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Number__of__Messages__Sent);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__EPS__Subscribed__QoS__Profile:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Subscribed__QoS__Profile) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__EPS__Subscribed__QoS__Profile);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Session__Stop__Indicator:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Session__Stop__Indicator) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Session__Stop__Indicator);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__GPRS__Subscription__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__GPRS__Subscription__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__GPRS__Subscription__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__GPRS__Negotiated__QoS__Profile:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GPRS__Negotiated__QoS__Profile) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__GPRS__Negotiated__QoS__Profile);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Access__Transfer__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Access__Transfer__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Called__Station__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Called__Station__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Called__Station__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Inter__UE__Transfer:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__UE__Transfer) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Inter__UE__Transfer);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__Cost__Unit:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__Cost__Unit) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__Cost__Unit);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Accounting__Realtime__Required:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Realtime__Required) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Accounting__Realtime__Required);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Termination__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Termination__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Termination__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Received__Talk__Burst__Volume:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Volume) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Received__Talk__Burst__Volume);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Rate__Control__Max__Rate:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Rate) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Control__Max__Rate);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Class__Identifier:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Class__Identifier) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Class__Identifier);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__GI__3GPP__3GPP__Allocate__IP__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Allocate__IP__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__GI__3GPP__3GPP__Allocate__IP__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SM__Back__Off__Timer:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SM__Back__Off__Timer) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SM__Back__Off__Timer);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__Specific__Action:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__Specific__Action) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__Specific__Action);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Maximum__Detection__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Detection__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Maximum__Detection__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Login__TCP__Port:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Login__TCP__Port) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Login__TCP__Port);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__Password__Retry:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__Password__Retry) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__Password__Retry);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__Stamps:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Stamps) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__Stamps);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Base__Time__Interval:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Base__Time__Interval) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Base__Time__Interval);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__UWAN__User__Location__Info:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__UWAN__User__Location__Info) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__UWAN__User__Location__Info);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ProSe__Role__Of__UE:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Role__Of__UE) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ProSe__Role__Of__UE);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__RAT__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__RAT__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__RAT__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Ext__PDP__Address:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Address) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Ext__PDP__Address);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__PoC__Session__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__PoC__Session__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__ISUP__Cause:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__ISUP__Cause);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__RX__3GPP__AF__Signalling__Protocol:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__RX__3GPP__AF__Signalling__Protocol) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__RX__3GPP__AF__Signalling__Protocol);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Adjacent__PLMNs:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__PLMNs) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Adjacent__PLMNs);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__S6__3GPP__Service__Result__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__S6__3GPP__Service__Result__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__SGSN__Location__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Location__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__SGSN__Location__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Authorised__QoS:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Authorised__QoS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Authorised__QoS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Time__First__Transmission:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Transmission) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Time__First__Transmission);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Stop__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Stop__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Stop__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Reason__Code:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Code) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Reason__Code);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Pre__emption__Vulnerability:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Vulnerability) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Pre__emption__Vulnerability);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__Equivalent__PLMN__List:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__Equivalent__PLMN__List) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__Equivalent__PLMN__List);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__Default__Access:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Access) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__Default__Access);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__CxDx__3GPP__Supported__Applications:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Applications) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__CxDx__3GPP__Supported__Applications);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__BASE__NONE__Class:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__BASE__NONE__Class) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__BASE__NONE__Class);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DNAS__NONE__ARAP__Challenge__Response:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Challenge__Response) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DNAS__NONE__ARAP__Challenge__Response);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__SM__Message__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Message__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__SM__Message__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCC__NONE__CC__Sub__Session__Id:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__NONE || field_avp__header.avp__code().vendor__id__NONE() != AVP__Code__NONE::avp__code__DCC__NONE__CC__Sub__Session__Id) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__NONE new_val(AVP__Code__NONE::avp__code__DCC__NONE__CC__Sub__Session__Id);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__NONE_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__IDR__Flags:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__IDR__Flags) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__IDR__Flags);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__PCC__3GPP__PS__to__CS__Session__Continuity:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__PCC__3GPP__PS__to__CS__Session__Continuity) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__PCC__3GPP__PS__to__CS__Session__Continuity);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__V2X__Subscription__Data:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Subscription__Data) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__V2X__Subscription__Data);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Refund__Information:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Refund__Information) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Refund__Information);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Rate__Element:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Element) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Rate__Element);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__PDP__Type:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Type) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__PDP__Type);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__AAA__3GPP__AMBR:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__AAA__3GPP__AMBR) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__AAA__3GPP__AMBR);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case AVP__Data::ALT_avp__DCA__3GPP__Submission__Time:
  if (field_avp__header.avp__code().get_selection() != AVP__Code::ALT_vendor__id__3GPP || field_avp__header.avp__code().vendor__id__3GPP() != AVP__Code__3GPP::avp__code__DCA__3GPP__Submission__Time) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 3;
  int new_pos[] = { 0, 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 3, new_pos);
  AVP__Code__3GPP new_val(AVP__Code__3GPP::avp__code__DCA__3GPP__Submission__Time);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(AVP__Code__3GPP_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct AVP_template::single_value_struct {
AVP__Header_template field_avp__header;
AVP__Data_template field_avp__data;
};

void AVP_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_avp__header = ANY_VALUE;
single_value->field_avp__data = ANY_VALUE;
}
}
}

void AVP_template::copy_value(const AVP& other_value)
{
single_value = new single_value_struct;
if (other_value.avp__header().is_bound()) {
  single_value->field_avp__header = other_value.avp__header();
} else {
  single_value->field_avp__header.clean_up();
}
if (other_value.avp__data().is_bound()) {
  single_value->field_avp__data = other_value.avp__data();
} else {
  single_value->field_avp__data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AVP_template::copy_template(const AVP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.avp__header().get_selection()) {
single_value->field_avp__header = other_value.avp__header();
} else {
single_value->field_avp__header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.avp__data().get_selection()) {
single_value->field_avp__data = other_value.avp__data();
} else {
single_value->field_avp__data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AVP_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new AVP_template(*other_value.implication_.precondition);
implication_.implied_template = new AVP_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @DIAMETER_Types.AVP.");
break;
}
set_selection(other_value);
}

AVP_template::AVP_template()
{
}

AVP_template::AVP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

AVP_template::AVP_template(const AVP& other_value)
{
copy_value(other_value);
}

AVP_template::AVP_template(const OPTIONAL<AVP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AVP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @DIAMETER_Types.AVP from an unbound optional field.");
}
}

AVP_template::AVP_template(AVP_template* p_precondition, AVP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

AVP_template::AVP_template(Dynamic_Match_Interface<AVP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AVP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AVP_template::AVP_template(const AVP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

AVP_template::~AVP_template()
{
clean_up();
}

AVP_template& AVP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

AVP_template& AVP_template::operator=(const AVP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AVP_template& AVP_template::operator=(const OPTIONAL<AVP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AVP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @DIAMETER_Types.AVP.");
}
return *this;
}

AVP_template& AVP_template::operator=(const AVP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean AVP_template::match(const AVP& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.avp__header().is_bound()) return FALSE;
if(!single_value->field_avp__header.match(other_value.avp__header(), legacy))return FALSE;
if(!other_value.avp__data().is_bound()) return FALSE;
if(!single_value->field_avp__data.match(other_value.avp__data(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @DIAMETER_Types.AVP.");
}
return FALSE;
}

boolean AVP_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_avp__header.is_bound()
 || single_value->field_avp__data.is_bound();
}

boolean AVP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_avp__header.is_value()
 && single_value->field_avp__data.is_value();
}

void AVP_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

AVP AVP_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @DIAMETER_Types.AVP.");
AVP ret_val;
if (single_value->field_avp__header.is_bound()) {
ret_val.avp__header() = single_value->field_avp__header.valueof();
}
if (single_value->field_avp__data.is_bound()) {
ret_val.avp__data() = single_value->field_avp__data.valueof();
}
return ret_val;
}

void AVP_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @DIAMETER_Types.AVP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AVP_template[list_length];
}

AVP_template& AVP_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @DIAMETER_Types.AVP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @DIAMETER_Types.AVP.");
return value_list.list_value[list_index];
}

AVP__Header_template& AVP_template::avp__header()
{
set_specific();
return single_value->field_avp__header;
}

const AVP__Header_template& AVP_template::avp__header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field avp_header of a non-specific template of type @DIAMETER_Types.AVP.");
return single_value->field_avp__header;
}

AVP__Data_template& AVP_template::avp__data()
{
set_specific();
return single_value->field_avp__data;
}

const AVP__Data_template& AVP_template::avp__data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field avp_data of a non-specific template of type @DIAMETER_Types.AVP.");
return single_value->field_avp__data;
}

int AVP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @DIAMETER_Types.AVP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @DIAMETER_Types.AVP.");
  }
  return 0;
}

void AVP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ avp_header := ");
single_value->field_avp__header.log();
TTCN_Logger::log_event_str(", avp_data := ");
single_value->field_avp__data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AVP_template::log_match(const AVP& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_avp__header.match(match_value.avp__header(), legacy)){
TTCN_Logger::log_logmatch_info(".avp_header");
single_value->field_avp__header.log_match(match_value.avp__header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_avp__data.match(match_value.avp__data(), legacy)){
TTCN_Logger::log_logmatch_info(".avp_data");
single_value->field_avp__data.log_match(match_value.avp__data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ avp_header := ");
single_value->field_avp__header.log_match(match_value.avp__header(), legacy);
TTCN_Logger::log_event_str(", avp_data := ");
single_value->field_avp__data.log_match(match_value.avp__data(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void AVP_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (avp__header().is_bound()) avp__header().set_implicit_omit();
if (avp__data().is_bound()) avp__data().set_implicit_omit();
}

void AVP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_avp__header.encode_text(text_buf);
single_value->field_avp__data.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @DIAMETER_Types.AVP.");
}
}

void AVP_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_avp__header.decode_text(text_buf);
single_value->field_avp__data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AVP_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @DIAMETER_Types.AVP.");
}
}

void AVP_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    AVP_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @DIAMETER_Types.AVP has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) avp__header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) avp__data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "avp_header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          avp__header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "avp_data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          avp__data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @DIAMETER_Types.AVP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AVP_template* precondition = new AVP_template;
    precondition->set_param(*param.get_elem(0));
    AVP_template* implied_template = new AVP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AVP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Types.AVP");
  }
  is_ifpresent = param.get_ifpresent();
}

void AVP_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_avp__header.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Types.AVP");
single_value->field_avp__data.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Types.AVP");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@DIAMETER_Types.AVP");
}

boolean AVP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean AVP_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
