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

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

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

/* Including header files */

#include "MobileL3_GMM_SM_Types.hh"

namespace MobileL3__GMM__SM__Types {

/* Member functions of C++ classes */

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass()
{
}

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass(const BITSTRING& par_dTMGPRSHighMultiSlotClassValue,
    const BITSTRING& par_presenceBitDTMEGPRSHighMultiSlotClass,
    const OPTIONAL< BITSTRING >& par_dTMEGPRSHighMultiSlotClassValue)
  :   field_dTMGPRSHighMultiSlotClassValue(par_dTMGPRSHighMultiSlotClassValue),
  field_presenceBitDTMEGPRSHighMultiSlotClass(par_presenceBitDTMEGPRSHighMultiSlotClass),
  field_dTMEGPRSHighMultiSlotClassValue(par_dTMEGPRSHighMultiSlotClassValue)
{
}

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass(const DTMGPRSHighMultiSlotClass& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
else field_dTMGPRSHighMultiSlotClassValue.clean_up();
if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
else field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}

void DTMGPRSHighMultiSlotClass::clean_up()
{
field_dTMGPRSHighMultiSlotClassValue.clean_up();
field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}

const TTCN_Typedescriptor_t* DTMGPRSHighMultiSlotClass::get_descriptor() const { return &DTMGPRSHighMultiSlotClass_descr_; }
DTMGPRSHighMultiSlotClass& DTMGPRSHighMultiSlotClass::operator=(const DTMGPRSHighMultiSlotClass& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
  if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
  else field_dTMGPRSHighMultiSlotClassValue.clean_up();
  if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
  else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
  if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
  else field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}
return *this;
}

boolean DTMGPRSHighMultiSlotClass::operator==(const DTMGPRSHighMultiSlotClass& other_value) const
{
return field_dTMGPRSHighMultiSlotClassValue==other_value.field_dTMGPRSHighMultiSlotClassValue
  && field_presenceBitDTMEGPRSHighMultiSlotClass==other_value.field_presenceBitDTMEGPRSHighMultiSlotClass
  && field_dTMEGPRSHighMultiSlotClassValue==other_value.field_dTMEGPRSHighMultiSlotClassValue;
}

boolean DTMGPRSHighMultiSlotClass::is_bound() const
{
return (field_dTMGPRSHighMultiSlotClassValue.is_bound())
  || (field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound())
  || (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_bound());
}
boolean DTMGPRSHighMultiSlotClass::is_value() const
{
return field_dTMGPRSHighMultiSlotClassValue.is_value()
  && field_presenceBitDTMEGPRSHighMultiSlotClass.is_value()
  && (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_value());
}
int DTMGPRSHighMultiSlotClass::size_of() const
{
  int ret_val = 2;
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) ret_val++;
  return ret_val;
}

void DTMGPRSHighMultiSlotClass::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := ");
field_dTMGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
field_presenceBitDTMEGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
field_dTMEGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(" }");
}

void DTMGPRSHighMultiSlotClass::set_implicit_omit()
{
if (dTMGPRSHighMultiSlotClassValue().is_bound()) dTMGPRSHighMultiSlotClassValue().set_implicit_omit();
if (presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) presenceBitDTMEGPRSHighMultiSlotClass().set_implicit_omit();
if (!dTMEGPRSHighMultiSlotClassValue().is_bound()) dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE;
else dTMEGPRSHighMultiSlotClassValue().set_implicit_omit();
}

void DTMGPRSHighMultiSlotClass::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass has 3 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) dTMGPRSHighMultiSlotClassValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMEGPRSHighMultiSlotClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTMEGPRSHighMultiSlotClassValue().set_param(*param.get_elem(2));
    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(), "dTMGPRSHighMultiSlotClassValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMGPRSHighMultiSlotClassValue().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(), "presenceBitDTMEGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTMEGPRSHighMultiSlotClass().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(), "dTMEGPRSHighMultiSlotClassValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMEGPRSHighMultiSlotClassValue().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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
  }
}

void DTMGPRSHighMultiSlotClass::encode_text(Text_Buf& text_buf) const
{
field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf);
field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf);
field_dTMEGPRSHighMultiSlotClassValue.encode_text(text_buf);
}

void DTMGPRSHighMultiSlotClass::decode_text(Text_Buf& text_buf)
{
field_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf);
field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf);
field_dTMEGPRSHighMultiSlotClassValue.decode_text(text_buf);
}

void DTMGPRSHighMultiSlotClass::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DTMGPRSHighMultiSlotClass::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DTMGPRSHighMultiSlotClass::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_.raw->forceomit);
  decoded_field_length = field_dTMGPRSHighMultiSlotClassValue.RAW_decode(DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_decode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (limit > 0 && field_presenceBitDTMEGPRSHighMultiSlotClass ==  bs_2){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_.raw->forceomit);
  decoded_field_length = field_dTMEGPRSHighMultiSlotClassValue().RAW_decode(DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dTMEGPRSHighMultiSlotClassValue=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DTMGPRSHighMultiSlotClass::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw);
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_dTMGPRSHighMultiSlotClassValue.RAW_encode(DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_encode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[1]);
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) {
  encoded_length += field_dTMEGPRSHighMultiSlotClassValue().RAW_encode(DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent() && (field_presenceBitDTMEGPRSHighMultiSlotClass !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct DTMGPRSHighMultiSlotClass_template::single_value_struct {
BITSTRING_template field_dTMGPRSHighMultiSlotClassValue;
BITSTRING_template field_presenceBitDTMEGPRSHighMultiSlotClass;
BITSTRING_template field_dTMEGPRSHighMultiSlotClassValue;
};

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue = ANY_VALUE;
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = ANY_VALUE;
single_value->field_dTMEGPRSHighMultiSlotClassValue = ANY_OR_OMIT;
}
}
}

void DTMGPRSHighMultiSlotClass_template::copy_value(const DTMGPRSHighMultiSlotClass& other_value)
{
single_value = new single_value_struct;
if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) {
  single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
} else {
  single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up();
}
if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) {
  single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
} else {
  single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
}
if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) {
  if (other_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue()();
  else single_value->field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
} else {
  single_value->field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DTMGPRSHighMultiSlotClass_template::copy_template(const DTMGPRSHighMultiSlotClass_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTMGPRSHighMultiSlotClassValue().get_selection()) {
single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
} else {
single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTMEGPRSHighMultiSlotClass().get_selection()) {
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
} else {
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTMEGPRSHighMultiSlotClassValue().get_selection()) {
single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
} else {
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_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 DTMGPRSHighMultiSlotClass_template(*other_value.implication_.precondition);
implication_.implied_template = new DTMGPRSHighMultiSlotClass_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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
break;
}
set_selection(other_value);
}

DTMGPRSHighMultiSlotClass_template::DTMGPRSHighMultiSlotClass_template()
{
}

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

DTMGPRSHighMultiSlotClass_template::DTMGPRSHighMultiSlotClass_template(const DTMGPRSHighMultiSlotClass& other_value)
{
copy_value(other_value);
}

DTMGPRSHighMultiSlotClass_template::DTMGPRSHighMultiSlotClass_template(const OPTIONAL<DTMGPRSHighMultiSlotClass>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DTMGPRSHighMultiSlotClass&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass from an unbound optional field.");
}
}

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

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

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

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

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

DTMGPRSHighMultiSlotClass_template& DTMGPRSHighMultiSlotClass_template::operator=(const DTMGPRSHighMultiSlotClass& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

DTMGPRSHighMultiSlotClass_template& DTMGPRSHighMultiSlotClass_template::operator=(const OPTIONAL<DTMGPRSHighMultiSlotClass>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DTMGPRSHighMultiSlotClass&)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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
return *this;
}

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

boolean DTMGPRSHighMultiSlotClass_template::match(const DTMGPRSHighMultiSlotClass& 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.dTMGPRSHighMultiSlotClassValue().is_bound()) return FALSE;
if(!single_value->field_dTMGPRSHighMultiSlotClassValue.match(other_value.dTMGPRSHighMultiSlotClassValue(), legacy))return FALSE;
if(!other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) return FALSE;
if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(other_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy))return FALSE;
if(!other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) return FALSE;
if((other_value.dTMEGPRSHighMultiSlotClassValue().ispresent() ? !single_value->field_dTMEGPRSHighMultiSlotClassValue.match((const BITSTRING&)other_value.dTMEGPRSHighMultiSlotClassValue(), legacy) : !single_value->field_dTMEGPRSHighMultiSlotClassValue.match_omit(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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
return FALSE;
}

boolean DTMGPRSHighMultiSlotClass_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound()
 || single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()
 || (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound());
}

boolean DTMGPRSHighMultiSlotClass_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTMGPRSHighMultiSlotClassValue.is_value()
 && single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_value()
 && (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_value());
}

void DTMGPRSHighMultiSlotClass_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;
}

DTMGPRSHighMultiSlotClass DTMGPRSHighMultiSlotClass_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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
DTMGPRSHighMultiSlotClass ret_val;
if (single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound()) {
ret_val.dTMGPRSHighMultiSlotClassValue() = single_value->field_dTMGPRSHighMultiSlotClassValue.valueof();
}
if (single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()) {
ret_val.presenceBitDTMEGPRSHighMultiSlotClass() = single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.valueof();
}
if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit()) ret_val.dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE;
else if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound()) {
ret_val.dTMEGPRSHighMultiSlotClassValue() = single_value->field_dTMEGPRSHighMultiSlotClassValue.valueof();
}
return ret_val;
}

void DTMGPRSHighMultiSlotClass_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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DTMGPRSHighMultiSlotClass_template[list_length];
}

DTMGPRSHighMultiSlotClass_template& DTMGPRSHighMultiSlotClass_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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return value_list.list_value[list_index];
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMGPRSHighMultiSlotClassValue()
{
set_specific();
return single_value->field_dTMGPRSHighMultiSlotClassValue;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMGPRSHighMultiSlotClassValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMGPRSHighMultiSlotClassValue of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_dTMGPRSHighMultiSlotClassValue;
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::presenceBitDTMEGPRSHighMultiSlotClass()
{
set_specific();
return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::presenceBitDTMEGPRSHighMultiSlotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDTMEGPRSHighMultiSlotClass of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass;
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMEGPRSHighMultiSlotClassValue()
{
set_specific();
return single_value->field_dTMEGPRSHighMultiSlotClassValue;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMEGPRSHighMultiSlotClassValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMEGPRSHighMultiSlotClassValue of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_dTMEGPRSHighMultiSlotClassValue;
}

int DTMGPRSHighMultiSlotClass_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass 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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
  }
  return 0;
}

void DTMGPRSHighMultiSlotClass_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := ");
single_value->field_dTMGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_template::log_match(const DTMGPRSHighMultiSlotClass& 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_dTMGPRSHighMultiSlotClassValue.match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClassValue");
single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDTMEGPRSHighMultiSlotClass");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()){
if(!single_value->field_dTMEGPRSHighMultiSlotClassValue.match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue");
single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dTMEGPRSHighMultiSlotClassValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dTMEGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(" unmatched");
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("{ dTMGPRSHighMultiSlotClassValue := ");
single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) {
single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dTMEGPRSHighMultiSlotClassValue.log();
if (single_value->field_dTMEGPRSHighMultiSlotClassValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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 DTMGPRSHighMultiSlotClass_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf);
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf);
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
}

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf);
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf);
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
}

void DTMGPRSHighMultiSlotClass_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: {
    DTMGPRSHighMultiSlotClass_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass has 3 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) dTMGPRSHighMultiSlotClassValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMEGPRSHighMultiSlotClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTMEGPRSHighMultiSlotClassValue().set_param(*param.get_elem(2));
    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(), "dTMGPRSHighMultiSlotClassValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMGPRSHighMultiSlotClassValue().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(), "presenceBitDTMEGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTMEGPRSHighMultiSlotClass().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(), "dTMEGPRSHighMultiSlotClassValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMEGPRSHighMultiSlotClassValue().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 @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DTMGPRSHighMultiSlotClass_template* precondition = new DTMGPRSHighMultiSlotClass_template;
    precondition->set_param(*param.get_elem(0));
    DTMGPRSHighMultiSlotClass_template* implied_template = new DTMGPRSHighMultiSlotClass_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DTMGPRSHighMultiSlotClass_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
  }
  is_ifpresent = param.get_ifpresent();
}

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
single_value->field_dTMEGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
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 : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
}

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

boolean DTMGPRSHighMultiSlotClass_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;
}

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5()
{
}

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5(const AccessCapAdditionsRel6& par_accessCapAdditionsRel6,
    const OPTIONAL< AccessCapAdditionsAfterRel6 >& par_accessCapAdditionsAfterRel6)
  :   field_accessCapAdditionsRel6(par_accessCapAdditionsRel6),
  field_accessCapAdditionsAfterRel6(par_accessCapAdditionsAfterRel6)
{
}

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5(const AccessCapAdditionsAfterRel5& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
else field_accessCapAdditionsRel6.clean_up();
if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
else field_accessCapAdditionsAfterRel6.clean_up();
}

void AccessCapAdditionsAfterRel5::clean_up()
{
field_accessCapAdditionsRel6.clean_up();
field_accessCapAdditionsAfterRel6.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel5::get_descriptor() const { return &AccessCapAdditionsAfterRel5_descr_; }
AccessCapAdditionsAfterRel5& AccessCapAdditionsAfterRel5::operator=(const AccessCapAdditionsAfterRel5& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
  if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
  else field_accessCapAdditionsRel6.clean_up();
  if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
  else field_accessCapAdditionsAfterRel6.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel5::operator==(const AccessCapAdditionsAfterRel5& other_value) const
{
return field_accessCapAdditionsRel6==other_value.field_accessCapAdditionsRel6
  && field_accessCapAdditionsAfterRel6==other_value.field_accessCapAdditionsAfterRel6;
}

boolean AccessCapAdditionsAfterRel5::is_bound() const
{
return (field_accessCapAdditionsRel6.is_bound())
  || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel6.get_selection() || field_accessCapAdditionsAfterRel6.is_bound());
}
boolean AccessCapAdditionsAfterRel5::is_value() const
{
return field_accessCapAdditionsRel6.is_value()
  && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel6.get_selection() || field_accessCapAdditionsAfterRel6.is_value());
}
int AccessCapAdditionsAfterRel5::size_of() const
{
  int ret_val = 1;
  if (field_accessCapAdditionsAfterRel6.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsAfterRel5::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := ");
field_accessCapAdditionsRel6.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
field_accessCapAdditionsAfterRel6.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel5::set_implicit_omit()
{
if (accessCapAdditionsRel6().is_bound()) accessCapAdditionsRel6().set_implicit_omit();
if (!accessCapAdditionsAfterRel6().is_bound()) accessCapAdditionsAfterRel6() = OMIT_VALUE;
else accessCapAdditionsAfterRel6().set_implicit_omit();
}

void AccessCapAdditionsAfterRel5::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 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) accessCapAdditionsRel6().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel6().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(), "accessCapAdditionsRel6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel6().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(), "accessCapAdditionsAfterRel6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel6().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
  }
}

void AccessCapAdditionsAfterRel5::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel6.encode_text(text_buf);
field_accessCapAdditionsAfterRel6.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel5::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel6.decode_text(text_buf);
field_accessCapAdditionsAfterRel6.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel5::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel5::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel5::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel6.RAW_decode(AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_accessCapAdditionsAfterRel6 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel6().RAW_decode(AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel6=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel5::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, AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_.raw);
  if (field_accessCapAdditionsAfterRel6.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel6.RAW_encode(AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel6.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel6().RAW_encode(AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel5_template::single_value_struct {
AccessCapAdditionsRel6_template field_accessCapAdditionsRel6;
AccessCapAdditionsAfterRel6_template field_accessCapAdditionsAfterRel6;
};

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel6 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel5_template::copy_value(const AccessCapAdditionsAfterRel5& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel6().is_bound()) {
  single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
} else {
  single_value->field_accessCapAdditionsRel6.clean_up();
}
if (other_value.accessCapAdditionsAfterRel6().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel6().ispresent()) single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6()();
  else single_value->field_accessCapAdditionsAfterRel6 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel6.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel5_template::copy_template(const AccessCapAdditionsAfterRel5_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel6().get_selection()) {
single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
} else {
single_value->field_accessCapAdditionsRel6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel6().get_selection()) {
single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
} else {
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_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 AccessCapAdditionsAfterRel5_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel5_template::AccessCapAdditionsAfterRel5_template()
{
}

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

AccessCapAdditionsAfterRel5_template::AccessCapAdditionsAfterRel5_template(const AccessCapAdditionsAfterRel5& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel5_template::AccessCapAdditionsAfterRel5_template(const OPTIONAL<AccessCapAdditionsAfterRel5>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel5&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel5_template::operator=(const AccessCapAdditionsAfterRel5& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel5_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel5>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel5&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel5_template::match(const AccessCapAdditionsAfterRel5& 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.accessCapAdditionsRel6().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel6.match(other_value.accessCapAdditionsRel6(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel6().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel6().ispresent() ? !single_value->field_accessCapAdditionsAfterRel6.match((const AccessCapAdditionsAfterRel6&)other_value.accessCapAdditionsAfterRel6(), legacy) : !single_value->field_accessCapAdditionsAfterRel6.match_omit(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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel5_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel6.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_bound());
}

boolean AccessCapAdditionsAfterRel5_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel6.is_value()
 && (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_value());
}

void AccessCapAdditionsAfterRel5_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;
}

AccessCapAdditionsAfterRel5 AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
AccessCapAdditionsAfterRel5 ret_val;
if (single_value->field_accessCapAdditionsRel6.is_bound()) {
ret_val.accessCapAdditionsRel6() = single_value->field_accessCapAdditionsRel6.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel6.is_omit()) ret_val.accessCapAdditionsAfterRel6() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel6.is_bound()) {
ret_val.accessCapAdditionsAfterRel6() = single_value->field_accessCapAdditionsAfterRel6.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel5_template[list_length];
}

AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsRel6()
{
set_specific();
return single_value->field_accessCapAdditionsRel6;
}

const AccessCapAdditionsRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsRel6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel6 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return single_value->field_accessCapAdditionsRel6;
}

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsAfterRel6()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel6;
}

const AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsAfterRel6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel6 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return single_value->field_accessCapAdditionsAfterRel6;
}

int AccessCapAdditionsAfterRel5_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_accessCapAdditionsAfterRel6.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel5_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := ");
single_value->field_accessCapAdditionsRel6.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_template::log_match(const AccessCapAdditionsAfterRel5& 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_accessCapAdditionsRel6.match(match_value.accessCapAdditionsRel6(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel6");
single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel6().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel6.match(match_value.accessCapAdditionsAfterRel6(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6");
single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel6.log();
TTCN_Logger::log_event_str(" unmatched");
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("{ accessCapAdditionsRel6 := ");
single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
if (match_value.accessCapAdditionsAfterRel6().ispresent()) {
single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel6.log();
if (single_value->field_accessCapAdditionsAfterRel6.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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 AccessCapAdditionsAfterRel5_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel6.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel6.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
}

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
}

void AccessCapAdditionsAfterRel5_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: {
    AccessCapAdditionsAfterRel5_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5 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) accessCapAdditionsRel6().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel6().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(), "accessCapAdditionsRel6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel6().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(), "accessCapAdditionsAfterRel6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel6().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel5_template* precondition = new AccessCapAdditionsAfterRel5_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel5_template* implied_template = new AccessCapAdditionsAfterRel5_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel5_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
single_value->field_accessCapAdditionsAfterRel6.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
}

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

boolean AccessCapAdditionsAfterRel5_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;
}

AccessCapAdditionsRel7::AccessCapAdditionsRel7()
{
}

AccessCapAdditionsRel7::AccessCapAdditionsRel7(const BITSTRING& par_dTMHandoverCapability,
    const BITSTRING& par_presenceBitDownlinkDualCarrier,
    const OPTIONAL< DownlinkDualCarrier >& par_downlinkDualCarrier,
    const BITSTRING& par_flexibleTimeslotAssignment,
    const BITSTRING& par_gANPSHandoverCapability,
    const BITSTRING& par_rLCNonPersistentMode,
    const BITSTRING& par_reducedLatencyCapability,
    const BITSTRING& par_uplinkEGPRS2,
    const BITSTRING& par_downlinkEGPRS2)
  :   field_dTMHandoverCapability(par_dTMHandoverCapability),
  field_presenceBitDownlinkDualCarrier(par_presenceBitDownlinkDualCarrier),
  field_downlinkDualCarrier(par_downlinkDualCarrier),
  field_flexibleTimeslotAssignment(par_flexibleTimeslotAssignment),
  field_gANPSHandoverCapability(par_gANPSHandoverCapability),
  field_rLCNonPersistentMode(par_rLCNonPersistentMode),
  field_reducedLatencyCapability(par_reducedLatencyCapability),
  field_uplinkEGPRS2(par_uplinkEGPRS2),
  field_downlinkEGPRS2(par_downlinkEGPRS2)
{
}

AccessCapAdditionsRel7::AccessCapAdditionsRel7(const AccessCapAdditionsRel7& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability();
else field_dTMHandoverCapability.clean_up();
if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
else field_presenceBitDownlinkDualCarrier.clean_up();
if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier();
else field_downlinkDualCarrier.clean_up();
if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
else field_flexibleTimeslotAssignment.clean_up();
if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
else field_gANPSHandoverCapability.clean_up();
if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
else field_rLCNonPersistentMode.clean_up();
if (other_value.reducedLatencyCapability().is_bound()) field_reducedLatencyCapability = other_value.reducedLatencyCapability();
else field_reducedLatencyCapability.clean_up();
if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
else field_uplinkEGPRS2.clean_up();
if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
else field_downlinkEGPRS2.clean_up();
}

void AccessCapAdditionsRel7::clean_up()
{
field_dTMHandoverCapability.clean_up();
field_presenceBitDownlinkDualCarrier.clean_up();
field_downlinkDualCarrier.clean_up();
field_flexibleTimeslotAssignment.clean_up();
field_gANPSHandoverCapability.clean_up();
field_rLCNonPersistentMode.clean_up();
field_reducedLatencyCapability.clean_up();
field_uplinkEGPRS2.clean_up();
field_downlinkEGPRS2.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel7::get_descriptor() const { return &AccessCapAdditionsRel7_descr_; }
AccessCapAdditionsRel7& AccessCapAdditionsRel7::operator=(const AccessCapAdditionsRel7& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
  if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability();
  else field_dTMHandoverCapability.clean_up();
  if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
  else field_presenceBitDownlinkDualCarrier.clean_up();
  if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier();
  else field_downlinkDualCarrier.clean_up();
  if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
  else field_flexibleTimeslotAssignment.clean_up();
  if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
  else field_gANPSHandoverCapability.clean_up();
  if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
  else field_rLCNonPersistentMode.clean_up();
  if (other_value.reducedLatencyCapability().is_bound()) field_reducedLatencyCapability = other_value.reducedLatencyCapability();
  else field_reducedLatencyCapability.clean_up();
  if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
  else field_uplinkEGPRS2.clean_up();
  if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
  else field_downlinkEGPRS2.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel7::operator==(const AccessCapAdditionsRel7& other_value) const
{
return field_dTMHandoverCapability==other_value.field_dTMHandoverCapability
  && field_presenceBitDownlinkDualCarrier==other_value.field_presenceBitDownlinkDualCarrier
  && field_downlinkDualCarrier==other_value.field_downlinkDualCarrier
  && field_flexibleTimeslotAssignment==other_value.field_flexibleTimeslotAssignment
  && field_gANPSHandoverCapability==other_value.field_gANPSHandoverCapability
  && field_rLCNonPersistentMode==other_value.field_rLCNonPersistentMode
  && field_reducedLatencyCapability==other_value.field_reducedLatencyCapability
  && field_uplinkEGPRS2==other_value.field_uplinkEGPRS2
  && field_downlinkEGPRS2==other_value.field_downlinkEGPRS2;
}

boolean AccessCapAdditionsRel7::is_bound() const
{
return (field_dTMHandoverCapability.is_bound())
  || (field_presenceBitDownlinkDualCarrier.is_bound())
  || (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_bound())
  || (field_flexibleTimeslotAssignment.is_bound())
  || (field_gANPSHandoverCapability.is_bound())
  || (field_rLCNonPersistentMode.is_bound())
  || (field_reducedLatencyCapability.is_bound())
  || (field_uplinkEGPRS2.is_bound())
  || (field_downlinkEGPRS2.is_bound());
}
boolean AccessCapAdditionsRel7::is_value() const
{
return field_dTMHandoverCapability.is_value()
  && field_presenceBitDownlinkDualCarrier.is_value()
  && (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_value())
  && field_flexibleTimeslotAssignment.is_value()
  && field_gANPSHandoverCapability.is_value()
  && field_rLCNonPersistentMode.is_value()
  && field_reducedLatencyCapability.is_value()
  && field_uplinkEGPRS2.is_value()
  && field_downlinkEGPRS2.is_value();
}
int AccessCapAdditionsRel7::size_of() const
{
  int ret_val = 8;
  if (field_downlinkDualCarrier.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel7::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTMHandoverCapability := ");
field_dTMHandoverCapability.log();
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
field_presenceBitDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
field_flexibleTimeslotAssignment.log();
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
field_gANPSHandoverCapability.log();
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
field_rLCNonPersistentMode.log();
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
field_reducedLatencyCapability.log();
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
field_uplinkEGPRS2.log();
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
field_downlinkEGPRS2.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel7::set_implicit_omit()
{
if (dTMHandoverCapability().is_bound()) dTMHandoverCapability().set_implicit_omit();
if (presenceBitDownlinkDualCarrier().is_bound()) presenceBitDownlinkDualCarrier().set_implicit_omit();
if (!downlinkDualCarrier().is_bound()) downlinkDualCarrier() = OMIT_VALUE;
else downlinkDualCarrier().set_implicit_omit();
if (flexibleTimeslotAssignment().is_bound()) flexibleTimeslotAssignment().set_implicit_omit();
if (gANPSHandoverCapability().is_bound()) gANPSHandoverCapability().set_implicit_omit();
if (rLCNonPersistentMode().is_bound()) rLCNonPersistentMode().set_implicit_omit();
if (reducedLatencyCapability().is_bound()) reducedLatencyCapability().set_implicit_omit();
if (uplinkEGPRS2().is_bound()) uplinkEGPRS2().set_implicit_omit();
if (downlinkEGPRS2().is_bound()) downlinkEGPRS2().set_implicit_omit();
}

void AccessCapAdditionsRel7::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 (9<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 has 9 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) dTMHandoverCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyCapability().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8));
    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(), "dTMHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMHandoverCapability().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(), "presenceBitDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDownlinkDualCarrier().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(), "downlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrier().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(), "flexibleTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flexibleTimeslotAssignment().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(), "gANPSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANPSHandoverCapability().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(), "rLCNonPersistentMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rLCNonPersistentMode().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(), "reducedLatencyCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reducedLatencyCapability().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(), "uplinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkEGPRS2().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(), "downlinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkEGPRS2().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
  }
}

void AccessCapAdditionsRel7::encode_text(Text_Buf& text_buf) const
{
field_dTMHandoverCapability.encode_text(text_buf);
field_presenceBitDownlinkDualCarrier.encode_text(text_buf);
field_downlinkDualCarrier.encode_text(text_buf);
field_flexibleTimeslotAssignment.encode_text(text_buf);
field_gANPSHandoverCapability.encode_text(text_buf);
field_rLCNonPersistentMode.encode_text(text_buf);
field_reducedLatencyCapability.encode_text(text_buf);
field_uplinkEGPRS2.encode_text(text_buf);
field_downlinkEGPRS2.encode_text(text_buf);
}

void AccessCapAdditionsRel7::decode_text(Text_Buf& text_buf)
{
field_dTMHandoverCapability.decode_text(text_buf);
field_presenceBitDownlinkDualCarrier.decode_text(text_buf);
field_downlinkDualCarrier.decode_text(text_buf);
field_flexibleTimeslotAssignment.decode_text(text_buf);
field_gANPSHandoverCapability.decode_text(text_buf);
field_rLCNonPersistentMode.decode_text(text_buf);
field_reducedLatencyCapability.decode_text(text_buf);
field_uplinkEGPRS2.decode_text(text_buf);
field_downlinkEGPRS2.decode_text(text_buf);
}

void AccessCapAdditionsRel7::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel7::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel7::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel7_dTMHandoverCapability_descr_.raw->forceomit);
  decoded_field_length = field_dTMHandoverCapability.RAW_decode(AccessCapAdditionsRel7_dTMHandoverCapability_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDownlinkDualCarrier.RAW_decode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (limit > 0 && field_presenceBitDownlinkDualCarrier ==  bs_2){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_downlinkDualCarrier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel7_downlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_downlinkDualCarrier().RAW_decode(AccessCapAdditionsRel7_downlinkDualCarrier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_downlinkDualCarrier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_downlinkDualCarrier=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_.raw->forceomit);
  decoded_field_length = field_flexibleTimeslotAssignment.RAW_decode(AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel7_gANPSHandoverCapability_descr_.raw->forceomit);
  decoded_field_length = field_gANPSHandoverCapability.RAW_decode(AccessCapAdditionsRel7_gANPSHandoverCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel7_rLCNonPersistentMode_descr_.raw->forceomit);
  decoded_field_length = field_rLCNonPersistentMode.RAW_decode(AccessCapAdditionsRel7_rLCNonPersistentMode_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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());
  RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapAdditionsRel7_reducedLatencyCapability_descr_.raw->forceomit);
  decoded_field_length = field_reducedLatencyCapability.RAW_decode(AccessCapAdditionsRel7_reducedLatencyCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_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());
  RAW_Force_Omit field_7_force_omit(7, force_omit, AccessCapAdditionsRel7_uplinkEGPRS2_descr_.raw->forceomit);
  decoded_field_length = field_uplinkEGPRS2.RAW_decode(AccessCapAdditionsRel7_uplinkEGPRS2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_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());
  RAW_Force_Omit field_8_force_omit(8, force_omit, AccessCapAdditionsRel7_downlinkEGPRS2_descr_.raw->forceomit);
  decoded_field_length = field_downlinkEGPRS2.RAW_decode(AccessCapAdditionsRel7_downlinkEGPRS2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel7::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 = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel7_dTMHandoverCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_.raw);
  if (field_downlinkDualCarrier.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel7_downlinkDualCarrier_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel7_gANPSHandoverCapability_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel7_rLCNonPersistentMode_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel7_reducedLatencyCapability_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, AccessCapAdditionsRel7_uplinkEGPRS2_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, AccessCapAdditionsRel7_downlinkEGPRS2_descr_.raw);
  encoded_length += field_dTMHandoverCapability.RAW_encode(AccessCapAdditionsRel7_dTMHandoverCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitDownlinkDualCarrier.RAW_encode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[1]);
  if (field_downlinkDualCarrier.ispresent()) {
  encoded_length += field_downlinkDualCarrier().RAW_encode(AccessCapAdditionsRel7_downlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_flexibleTimeslotAssignment.RAW_encode(AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_gANPSHandoverCapability.RAW_encode(AccessCapAdditionsRel7_gANPSHandoverCapability_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rLCNonPersistentMode.RAW_encode(AccessCapAdditionsRel7_rLCNonPersistentMode_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_reducedLatencyCapability.RAW_encode(AccessCapAdditionsRel7_reducedLatencyCapability_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_uplinkEGPRS2.RAW_encode(AccessCapAdditionsRel7_uplinkEGPRS2_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_downlinkEGPRS2.RAW_encode(AccessCapAdditionsRel7_downlinkEGPRS2_descr_, *myleaf.body.node.nodes[8]);
  if (field_downlinkDualCarrier.ispresent() && (field_presenceBitDownlinkDualCarrier !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel7_template::single_value_struct {
BITSTRING_template field_dTMHandoverCapability;
BITSTRING_template field_presenceBitDownlinkDualCarrier;
DownlinkDualCarrier_template field_downlinkDualCarrier;
BITSTRING_template field_flexibleTimeslotAssignment;
BITSTRING_template field_gANPSHandoverCapability;
BITSTRING_template field_rLCNonPersistentMode;
BITSTRING_template field_reducedLatencyCapability;
BITSTRING_template field_uplinkEGPRS2;
BITSTRING_template field_downlinkEGPRS2;
};

void AccessCapAdditionsRel7_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_dTMHandoverCapability = ANY_VALUE;
single_value->field_presenceBitDownlinkDualCarrier = ANY_VALUE;
single_value->field_downlinkDualCarrier = ANY_OR_OMIT;
single_value->field_flexibleTimeslotAssignment = ANY_VALUE;
single_value->field_gANPSHandoverCapability = ANY_VALUE;
single_value->field_rLCNonPersistentMode = ANY_VALUE;
single_value->field_reducedLatencyCapability = ANY_VALUE;
single_value->field_uplinkEGPRS2 = ANY_VALUE;
single_value->field_downlinkEGPRS2 = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel7_template::copy_value(const AccessCapAdditionsRel7& other_value)
{
single_value = new single_value_struct;
if (other_value.dTMHandoverCapability().is_bound()) {
  single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability();
} else {
  single_value->field_dTMHandoverCapability.clean_up();
}
if (other_value.presenceBitDownlinkDualCarrier().is_bound()) {
  single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
} else {
  single_value->field_presenceBitDownlinkDualCarrier.clean_up();
}
if (other_value.downlinkDualCarrier().is_bound()) {
  if (other_value.downlinkDualCarrier().ispresent()) single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier()();
  else single_value->field_downlinkDualCarrier = OMIT_VALUE;
} else {
  single_value->field_downlinkDualCarrier.clean_up();
}
if (other_value.flexibleTimeslotAssignment().is_bound()) {
  single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
} else {
  single_value->field_flexibleTimeslotAssignment.clean_up();
}
if (other_value.gANPSHandoverCapability().is_bound()) {
  single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
} else {
  single_value->field_gANPSHandoverCapability.clean_up();
}
if (other_value.rLCNonPersistentMode().is_bound()) {
  single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
} else {
  single_value->field_rLCNonPersistentMode.clean_up();
}
if (other_value.reducedLatencyCapability().is_bound()) {
  single_value->field_reducedLatencyCapability = other_value.reducedLatencyCapability();
} else {
  single_value->field_reducedLatencyCapability.clean_up();
}
if (other_value.uplinkEGPRS2().is_bound()) {
  single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
} else {
  single_value->field_uplinkEGPRS2.clean_up();
}
if (other_value.downlinkEGPRS2().is_bound()) {
  single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
} else {
  single_value->field_downlinkEGPRS2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel7_template::copy_template(const AccessCapAdditionsRel7_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTMHandoverCapability().get_selection()) {
single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability();
} else {
single_value->field_dTMHandoverCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDownlinkDualCarrier().get_selection()) {
single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
} else {
single_value->field_presenceBitDownlinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrier().get_selection()) {
single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier();
} else {
single_value->field_downlinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flexibleTimeslotAssignment().get_selection()) {
single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
} else {
single_value->field_flexibleTimeslotAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANPSHandoverCapability().get_selection()) {
single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
} else {
single_value->field_gANPSHandoverCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rLCNonPersistentMode().get_selection()) {
single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
} else {
single_value->field_rLCNonPersistentMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reducedLatencyCapability().get_selection()) {
single_value->field_reducedLatencyCapability = other_value.reducedLatencyCapability();
} else {
single_value->field_reducedLatencyCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uplinkEGPRS2().get_selection()) {
single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
} else {
single_value->field_uplinkEGPRS2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkEGPRS2().get_selection()) {
single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
} else {
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_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 AccessCapAdditionsRel7_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel7_template::AccessCapAdditionsRel7_template()
{
}

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

AccessCapAdditionsRel7_template::AccessCapAdditionsRel7_template(const AccessCapAdditionsRel7& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel7_template::AccessCapAdditionsRel7_template(const OPTIONAL<AccessCapAdditionsRel7>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel7&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel7_template& AccessCapAdditionsRel7_template::operator=(const AccessCapAdditionsRel7& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel7_template& AccessCapAdditionsRel7_template::operator=(const OPTIONAL<AccessCapAdditionsRel7>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel7&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
}
return *this;
}

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

boolean AccessCapAdditionsRel7_template::match(const AccessCapAdditionsRel7& 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.dTMHandoverCapability().is_bound()) return FALSE;
if(!single_value->field_dTMHandoverCapability.match(other_value.dTMHandoverCapability(), legacy))return FALSE;
if(!other_value.presenceBitDownlinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_presenceBitDownlinkDualCarrier.match(other_value.presenceBitDownlinkDualCarrier(), legacy))return FALSE;
if(!other_value.downlinkDualCarrier().is_bound()) return FALSE;
if((other_value.downlinkDualCarrier().ispresent() ? !single_value->field_downlinkDualCarrier.match((const DownlinkDualCarrier&)other_value.downlinkDualCarrier(), legacy) : !single_value->field_downlinkDualCarrier.match_omit(legacy)))return FALSE;
if(!other_value.flexibleTimeslotAssignment().is_bound()) return FALSE;
if(!single_value->field_flexibleTimeslotAssignment.match(other_value.flexibleTimeslotAssignment(), legacy))return FALSE;
if(!other_value.gANPSHandoverCapability().is_bound()) return FALSE;
if(!single_value->field_gANPSHandoverCapability.match(other_value.gANPSHandoverCapability(), legacy))return FALSE;
if(!other_value.rLCNonPersistentMode().is_bound()) return FALSE;
if(!single_value->field_rLCNonPersistentMode.match(other_value.rLCNonPersistentMode(), legacy))return FALSE;
if(!other_value.reducedLatencyCapability().is_bound()) return FALSE;
if(!single_value->field_reducedLatencyCapability.match(other_value.reducedLatencyCapability(), legacy))return FALSE;
if(!other_value.uplinkEGPRS2().is_bound()) return FALSE;
if(!single_value->field_uplinkEGPRS2.match(other_value.uplinkEGPRS2(), legacy))return FALSE;
if(!other_value.downlinkEGPRS2().is_bound()) return FALSE;
if(!single_value->field_downlinkEGPRS2.match(other_value.downlinkEGPRS2(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
}
return FALSE;
}

boolean AccessCapAdditionsRel7_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTMHandoverCapability.is_bound()
 || single_value->field_presenceBitDownlinkDualCarrier.is_bound()
 || (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_bound())
 || single_value->field_flexibleTimeslotAssignment.is_bound()
 || single_value->field_gANPSHandoverCapability.is_bound()
 || single_value->field_rLCNonPersistentMode.is_bound()
 || single_value->field_reducedLatencyCapability.is_bound()
 || single_value->field_uplinkEGPRS2.is_bound()
 || single_value->field_downlinkEGPRS2.is_bound();
}

boolean AccessCapAdditionsRel7_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTMHandoverCapability.is_value()
 && single_value->field_presenceBitDownlinkDualCarrier.is_value()
 && (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_value())
 && single_value->field_flexibleTimeslotAssignment.is_value()
 && single_value->field_gANPSHandoverCapability.is_value()
 && single_value->field_rLCNonPersistentMode.is_value()
 && single_value->field_reducedLatencyCapability.is_value()
 && single_value->field_uplinkEGPRS2.is_value()
 && single_value->field_downlinkEGPRS2.is_value();
}

void AccessCapAdditionsRel7_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;
}

AccessCapAdditionsRel7 AccessCapAdditionsRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
AccessCapAdditionsRel7 ret_val;
if (single_value->field_dTMHandoverCapability.is_bound()) {
ret_val.dTMHandoverCapability() = single_value->field_dTMHandoverCapability.valueof();
}
if (single_value->field_presenceBitDownlinkDualCarrier.is_bound()) {
ret_val.presenceBitDownlinkDualCarrier() = single_value->field_presenceBitDownlinkDualCarrier.valueof();
}
if (single_value->field_downlinkDualCarrier.is_omit()) ret_val.downlinkDualCarrier() = OMIT_VALUE;
else if (single_value->field_downlinkDualCarrier.is_bound()) {
ret_val.downlinkDualCarrier() = single_value->field_downlinkDualCarrier.valueof();
}
if (single_value->field_flexibleTimeslotAssignment.is_bound()) {
ret_val.flexibleTimeslotAssignment() = single_value->field_flexibleTimeslotAssignment.valueof();
}
if (single_value->field_gANPSHandoverCapability.is_bound()) {
ret_val.gANPSHandoverCapability() = single_value->field_gANPSHandoverCapability.valueof();
}
if (single_value->field_rLCNonPersistentMode.is_bound()) {
ret_val.rLCNonPersistentMode() = single_value->field_rLCNonPersistentMode.valueof();
}
if (single_value->field_reducedLatencyCapability.is_bound()) {
ret_val.reducedLatencyCapability() = single_value->field_reducedLatencyCapability.valueof();
}
if (single_value->field_uplinkEGPRS2.is_bound()) {
ret_val.uplinkEGPRS2() = single_value->field_uplinkEGPRS2.valueof();
}
if (single_value->field_downlinkEGPRS2.is_bound()) {
ret_val.downlinkEGPRS2() = single_value->field_downlinkEGPRS2.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel7_template[list_length];
}

AccessCapAdditionsRel7_template& AccessCapAdditionsRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel7_template::dTMHandoverCapability()
{
set_specific();
return single_value->field_dTMHandoverCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::dTMHandoverCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMHandoverCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_dTMHandoverCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::presenceBitDownlinkDualCarrier()
{
set_specific();
return single_value->field_presenceBitDownlinkDualCarrier;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::presenceBitDownlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDownlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_presenceBitDownlinkDualCarrier;
}

DownlinkDualCarrier_template& AccessCapAdditionsRel7_template::downlinkDualCarrier()
{
set_specific();
return single_value->field_downlinkDualCarrier;
}

const DownlinkDualCarrier_template& AccessCapAdditionsRel7_template::downlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_downlinkDualCarrier;
}

BITSTRING_template& AccessCapAdditionsRel7_template::flexibleTimeslotAssignment()
{
set_specific();
return single_value->field_flexibleTimeslotAssignment;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::flexibleTimeslotAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flexibleTimeslotAssignment of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_flexibleTimeslotAssignment;
}

BITSTRING_template& AccessCapAdditionsRel7_template::gANPSHandoverCapability()
{
set_specific();
return single_value->field_gANPSHandoverCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::gANPSHandoverCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANPSHandoverCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_gANPSHandoverCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::rLCNonPersistentMode()
{
set_specific();
return single_value->field_rLCNonPersistentMode;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::rLCNonPersistentMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rLCNonPersistentMode of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_rLCNonPersistentMode;
}

BITSTRING_template& AccessCapAdditionsRel7_template::reducedLatencyCapability()
{
set_specific();
return single_value->field_reducedLatencyCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::reducedLatencyCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reducedLatencyCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_reducedLatencyCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::uplinkEGPRS2()
{
set_specific();
return single_value->field_uplinkEGPRS2;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::uplinkEGPRS2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uplinkEGPRS2 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_uplinkEGPRS2;
}

BITSTRING_template& AccessCapAdditionsRel7_template::downlinkEGPRS2()
{
set_specific();
return single_value->field_downlinkEGPRS2;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::downlinkEGPRS2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkEGPRS2 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_downlinkEGPRS2;
}

int AccessCapAdditionsRel7_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 8;
      if (single_value->field_downlinkDualCarrier.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
  }
  return 0;
}

void AccessCapAdditionsRel7_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTMHandoverCapability := ");
single_value->field_dTMHandoverCapability.log();
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
single_value->field_presenceBitDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
single_value->field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
single_value->field_flexibleTimeslotAssignment.log();
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
single_value->field_gANPSHandoverCapability.log();
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
single_value->field_rLCNonPersistentMode.log();
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
single_value->field_reducedLatencyCapability.log();
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
single_value->field_uplinkEGPRS2.log();
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_template::log_match(const AccessCapAdditionsRel7& 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_dTMHandoverCapability.match(match_value.dTMHandoverCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMHandoverCapability");
single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDownlinkDualCarrier.match(match_value.presenceBitDownlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDownlinkDualCarrier");
single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.downlinkDualCarrier().ispresent()){
if(!single_value->field_downlinkDualCarrier.match(match_value.downlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkDualCarrier");
single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_downlinkDualCarrier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".downlinkDualCarrier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_flexibleTimeslotAssignment.match(match_value.flexibleTimeslotAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".flexibleTimeslotAssignment");
single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gANPSHandoverCapability.match(match_value.gANPSHandoverCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".gANPSHandoverCapability");
single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rLCNonPersistentMode.match(match_value.rLCNonPersistentMode(), legacy)){
TTCN_Logger::log_logmatch_info(".rLCNonPersistentMode");
single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reducedLatencyCapability.match(match_value.reducedLatencyCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".reducedLatencyCapability");
single_value->field_reducedLatencyCapability.log_match(match_value.reducedLatencyCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uplinkEGPRS2.match(match_value.uplinkEGPRS2(), legacy)){
TTCN_Logger::log_logmatch_info(".uplinkEGPRS2");
single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_downlinkEGPRS2.match(match_value.downlinkEGPRS2(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkEGPRS2");
single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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("{ dTMHandoverCapability := ");
single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy);
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy);
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
if (match_value.downlinkDualCarrier().ispresent()) {
single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_downlinkDualCarrier.log();
if (single_value->field_downlinkDualCarrier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy);
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy);
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy);
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
single_value->field_reducedLatencyCapability.log_match(match_value.reducedLatencyCapability(), legacy);
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy);
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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 AccessCapAdditionsRel7_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTMHandoverCapability.encode_text(text_buf);
single_value->field_presenceBitDownlinkDualCarrier.encode_text(text_buf);
single_value->field_downlinkDualCarrier.encode_text(text_buf);
single_value->field_flexibleTimeslotAssignment.encode_text(text_buf);
single_value->field_gANPSHandoverCapability.encode_text(text_buf);
single_value->field_rLCNonPersistentMode.encode_text(text_buf);
single_value->field_reducedLatencyCapability.encode_text(text_buf);
single_value->field_uplinkEGPRS2.encode_text(text_buf);
single_value->field_downlinkEGPRS2.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
}
}

void AccessCapAdditionsRel7_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_dTMHandoverCapability.decode_text(text_buf);
single_value->field_presenceBitDownlinkDualCarrier.decode_text(text_buf);
single_value->field_downlinkDualCarrier.decode_text(text_buf);
single_value->field_flexibleTimeslotAssignment.decode_text(text_buf);
single_value->field_gANPSHandoverCapability.decode_text(text_buf);
single_value->field_rLCNonPersistentMode.decode_text(text_buf);
single_value->field_reducedLatencyCapability.decode_text(text_buf);
single_value->field_uplinkEGPRS2.decode_text(text_buf);
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
}
}

void AccessCapAdditionsRel7_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: {
    AccessCapAdditionsRel7_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 (9<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 has 9 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) dTMHandoverCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyCapability().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8));
    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(), "dTMHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMHandoverCapability().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(), "presenceBitDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDownlinkDualCarrier().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(), "downlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrier().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(), "flexibleTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flexibleTimeslotAssignment().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(), "gANPSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANPSHandoverCapability().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(), "rLCNonPersistentMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rLCNonPersistentMode().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(), "reducedLatencyCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reducedLatencyCapability().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(), "uplinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkEGPRS2().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(), "downlinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkEGPRS2().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel7_template* precondition = new AccessCapAdditionsRel7_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel7_template* implied_template = new AccessCapAdditionsRel7_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel7_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel7_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_dTMHandoverCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_presenceBitDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_downlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_flexibleTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_gANPSHandoverCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_rLCNonPersistentMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_reducedLatencyCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_uplinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_downlinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
}

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

boolean AccessCapAdditionsRel7_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;
}

DownlinkDualCarrier::DownlinkDualCarrier()
{
}

DownlinkDualCarrier::DownlinkDualCarrier(const BITSTRING& par_multislotCapReductionforDownLinkDualCarrier,
    const BITSTRING& par_downlinkDualCarrierforDTMCapability)
  :   field_multislotCapReductionforDownLinkDualCarrier(par_multislotCapReductionforDownLinkDualCarrier),
  field_downlinkDualCarrierforDTMCapability(par_downlinkDualCarrierforDTMCapability)
{
}

DownlinkDualCarrier::DownlinkDualCarrier(const DownlinkDualCarrier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
else field_multislotCapReductionforDownLinkDualCarrier.clean_up();
if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
else field_downlinkDualCarrierforDTMCapability.clean_up();
}

void DownlinkDualCarrier::clean_up()
{
field_multislotCapReductionforDownLinkDualCarrier.clean_up();
field_downlinkDualCarrierforDTMCapability.clean_up();
}

const TTCN_Typedescriptor_t* DownlinkDualCarrier::get_descriptor() const { return &DownlinkDualCarrier_descr_; }
DownlinkDualCarrier& DownlinkDualCarrier::operator=(const DownlinkDualCarrier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
  if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
  else field_multislotCapReductionforDownLinkDualCarrier.clean_up();
  if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
  else field_downlinkDualCarrierforDTMCapability.clean_up();
}
return *this;
}

boolean DownlinkDualCarrier::operator==(const DownlinkDualCarrier& other_value) const
{
return field_multislotCapReductionforDownLinkDualCarrier==other_value.field_multislotCapReductionforDownLinkDualCarrier
  && field_downlinkDualCarrierforDTMCapability==other_value.field_downlinkDualCarrierforDTMCapability;
}

boolean DownlinkDualCarrier::is_bound() const
{
return (field_multislotCapReductionforDownLinkDualCarrier.is_bound())
  || (field_downlinkDualCarrierforDTMCapability.is_bound());
}
boolean DownlinkDualCarrier::is_value() const
{
return field_multislotCapReductionforDownLinkDualCarrier.is_value()
  && field_downlinkDualCarrierforDTMCapability.is_value();
}
void DownlinkDualCarrier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ multislotCapReductionforDownLinkDualCarrier := ");
field_multislotCapReductionforDownLinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
field_downlinkDualCarrierforDTMCapability.log();
TTCN_Logger::log_event_str(" }");
}

void DownlinkDualCarrier::set_implicit_omit()
{
if (multislotCapReductionforDownLinkDualCarrier().is_bound()) multislotCapReductionforDownLinkDualCarrier().set_implicit_omit();
if (downlinkDualCarrierforDTMCapability().is_bound()) downlinkDualCarrierforDTMCapability().set_implicit_omit();
}

void DownlinkDualCarrier::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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier 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) multislotCapReductionforDownLinkDualCarrier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrierforDTMCapability().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(), "multislotCapReductionforDownLinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapReductionforDownLinkDualCarrier().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(), "downlinkDualCarrierforDTMCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrierforDTMCapability().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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
  }
}

void DownlinkDualCarrier::encode_text(Text_Buf& text_buf) const
{
field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf);
field_downlinkDualCarrierforDTMCapability.encode_text(text_buf);
}

void DownlinkDualCarrier::decode_text(Text_Buf& text_buf)
{
field_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf);
field_downlinkDualCarrierforDTMCapability.decode_text(text_buf);
}

void DownlinkDualCarrier::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DownlinkDualCarrier::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DownlinkDualCarrier::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_multislotCapReductionforDownLinkDualCarrier.RAW_decode(DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_.raw->forceomit);
  decoded_field_length = field_downlinkDualCarrierforDTMCapability.RAW_decode(DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DownlinkDualCarrier::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, DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_.raw);
  encoded_length += field_multislotCapReductionforDownLinkDualCarrier.RAW_encode(DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_downlinkDualCarrierforDTMCapability.RAW_encode(DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DownlinkDualCarrier_template::single_value_struct {
BITSTRING_template field_multislotCapReductionforDownLinkDualCarrier;
BITSTRING_template field_downlinkDualCarrierforDTMCapability;
};

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier = ANY_VALUE;
single_value->field_downlinkDualCarrierforDTMCapability = ANY_VALUE;
}
}
}

void DownlinkDualCarrier_template::copy_value(const DownlinkDualCarrier& other_value)
{
single_value = new single_value_struct;
if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) {
  single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
} else {
  single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up();
}
if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) {
  single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
} else {
  single_value->field_downlinkDualCarrierforDTMCapability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DownlinkDualCarrier_template::copy_template(const DownlinkDualCarrier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.multislotCapReductionforDownLinkDualCarrier().get_selection()) {
single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
} else {
single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrierforDTMCapability().get_selection()) {
single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
} else {
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_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 DownlinkDualCarrier_template(*other_value.implication_.precondition);
implication_.implied_template = new DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
break;
}
set_selection(other_value);
}

DownlinkDualCarrier_template::DownlinkDualCarrier_template()
{
}

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

DownlinkDualCarrier_template::DownlinkDualCarrier_template(const DownlinkDualCarrier& other_value)
{
copy_value(other_value);
}

DownlinkDualCarrier_template::DownlinkDualCarrier_template(const OPTIONAL<DownlinkDualCarrier>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DownlinkDualCarrier&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier from an unbound optional field.");
}
}

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

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

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

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

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

DownlinkDualCarrier_template& DownlinkDualCarrier_template::operator=(const DownlinkDualCarrier& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

DownlinkDualCarrier_template& DownlinkDualCarrier_template::operator=(const OPTIONAL<DownlinkDualCarrier>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DownlinkDualCarrier&)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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
}
return *this;
}

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

boolean DownlinkDualCarrier_template::match(const DownlinkDualCarrier& 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.multislotCapReductionforDownLinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_multislotCapReductionforDownLinkDualCarrier.match(other_value.multislotCapReductionforDownLinkDualCarrier(), legacy))return FALSE;
if(!other_value.downlinkDualCarrierforDTMCapability().is_bound()) return FALSE;
if(!single_value->field_downlinkDualCarrierforDTMCapability.match(other_value.downlinkDualCarrierforDTMCapability(), 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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
}
return FALSE;
}

boolean DownlinkDualCarrier_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_multislotCapReductionforDownLinkDualCarrier.is_bound()
 || single_value->field_downlinkDualCarrierforDTMCapability.is_bound();
}

boolean DownlinkDualCarrier_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_multislotCapReductionforDownLinkDualCarrier.is_value()
 && single_value->field_downlinkDualCarrierforDTMCapability.is_value();
}

void DownlinkDualCarrier_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;
}

DownlinkDualCarrier DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
DownlinkDualCarrier ret_val;
if (single_value->field_multislotCapReductionforDownLinkDualCarrier.is_bound()) {
ret_val.multislotCapReductionforDownLinkDualCarrier() = single_value->field_multislotCapReductionforDownLinkDualCarrier.valueof();
}
if (single_value->field_downlinkDualCarrierforDTMCapability.is_bound()) {
ret_val.downlinkDualCarrierforDTMCapability() = single_value->field_downlinkDualCarrierforDTMCapability.valueof();
}
return ret_val;
}

void DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DownlinkDualCarrier_template[list_length];
}

DownlinkDualCarrier_template& DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return value_list.list_value[list_index];
}

BITSTRING_template& DownlinkDualCarrier_template::multislotCapReductionforDownLinkDualCarrier()
{
set_specific();
return single_value->field_multislotCapReductionforDownLinkDualCarrier;
}

const BITSTRING_template& DownlinkDualCarrier_template::multislotCapReductionforDownLinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCapReductionforDownLinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return single_value->field_multislotCapReductionforDownLinkDualCarrier;
}

BITSTRING_template& DownlinkDualCarrier_template::downlinkDualCarrierforDTMCapability()
{
set_specific();
return single_value->field_downlinkDualCarrierforDTMCapability;
}

const BITSTRING_template& DownlinkDualCarrier_template::downlinkDualCarrierforDTMCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkDualCarrierforDTMCapability of a non-specific template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return single_value->field_downlinkDualCarrierforDTMCapability;
}

int DownlinkDualCarrier_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier 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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier 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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
  }
  return 0;
}

void DownlinkDualCarrier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ multislotCapReductionforDownLinkDualCarrier := ");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_template::log_match(const DownlinkDualCarrier& 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_multislotCapReductionforDownLinkDualCarrier.match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCapReductionforDownLinkDualCarrier");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_downlinkDualCarrierforDTMCapability.match(match_value.downlinkDualCarrierforDTMCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkDualCarrierforDTMCapability");
single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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("{ multislotCapReductionforDownLinkDualCarrier := ");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy);
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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 DownlinkDualCarrier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf);
single_value->field_downlinkDualCarrierforDTMCapability.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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
}
}

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf);
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
}
}

void DownlinkDualCarrier_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: {
    DownlinkDualCarrier_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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier 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) multislotCapReductionforDownLinkDualCarrier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrierforDTMCapability().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(), "multislotCapReductionforDownLinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapReductionforDownLinkDualCarrier().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(), "downlinkDualCarrierforDTMCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrierforDTMCapability().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 @MobileL3_GMM_SM_Types.DownlinkDualCarrier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DownlinkDualCarrier_template* precondition = new DownlinkDualCarrier_template;
    precondition->set_param(*param.get_elem(0));
    DownlinkDualCarrier_template* implied_template = new DownlinkDualCarrier_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DownlinkDualCarrier_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
  }
  is_ifpresent = param.get_ifpresent();
}

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
single_value->field_downlinkDualCarrierforDTMCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
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 : "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
}

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

boolean DownlinkDualCarrier_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;
}

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6()
{
}

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6(const AccessCapAdditionsRel7& par_accessCapAdditionsRel7,
    const OPTIONAL< AccessCapAdditionsAfterRel7 >& par_accessCapAdditionsAfterRel7)
  :   field_accessCapAdditionsRel7(par_accessCapAdditionsRel7),
  field_accessCapAdditionsAfterRel7(par_accessCapAdditionsAfterRel7)
{
}

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6(const AccessCapAdditionsAfterRel6& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
else field_accessCapAdditionsRel7.clean_up();
if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
else field_accessCapAdditionsAfterRel7.clean_up();
}

void AccessCapAdditionsAfterRel6::clean_up()
{
field_accessCapAdditionsRel7.clean_up();
field_accessCapAdditionsAfterRel7.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel6::get_descriptor() const { return &AccessCapAdditionsAfterRel6_descr_; }
AccessCapAdditionsAfterRel6& AccessCapAdditionsAfterRel6::operator=(const AccessCapAdditionsAfterRel6& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
  if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
  else field_accessCapAdditionsRel7.clean_up();
  if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
  else field_accessCapAdditionsAfterRel7.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel6::operator==(const AccessCapAdditionsAfterRel6& other_value) const
{
return field_accessCapAdditionsRel7==other_value.field_accessCapAdditionsRel7
  && field_accessCapAdditionsAfterRel7==other_value.field_accessCapAdditionsAfterRel7;
}

boolean AccessCapAdditionsAfterRel6::is_bound() const
{
return (field_accessCapAdditionsRel7.is_bound())
  || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel7.get_selection() || field_accessCapAdditionsAfterRel7.is_bound());
}
boolean AccessCapAdditionsAfterRel6::is_value() const
{
return field_accessCapAdditionsRel7.is_value()
  && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel7.get_selection() || field_accessCapAdditionsAfterRel7.is_value());
}
int AccessCapAdditionsAfterRel6::size_of() const
{
  int ret_val = 1;
  if (field_accessCapAdditionsAfterRel7.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsAfterRel6::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := ");
field_accessCapAdditionsRel7.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
field_accessCapAdditionsAfterRel7.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel6::set_implicit_omit()
{
if (accessCapAdditionsRel7().is_bound()) accessCapAdditionsRel7().set_implicit_omit();
if (!accessCapAdditionsAfterRel7().is_bound()) accessCapAdditionsAfterRel7() = OMIT_VALUE;
else accessCapAdditionsAfterRel7().set_implicit_omit();
}

void AccessCapAdditionsAfterRel6::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 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) accessCapAdditionsRel7().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel7().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(), "accessCapAdditionsRel7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel7().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(), "accessCapAdditionsAfterRel7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel7().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
  }
}

void AccessCapAdditionsAfterRel6::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel7.encode_text(text_buf);
field_accessCapAdditionsAfterRel7.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel6::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel7.decode_text(text_buf);
field_accessCapAdditionsAfterRel7.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel6::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel6::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel6::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel7.RAW_decode(AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_accessCapAdditionsAfterRel7 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel7().RAW_decode(AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel7=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel6::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, AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_.raw);
  if (field_accessCapAdditionsAfterRel7.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel7.RAW_encode(AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel7.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel7().RAW_encode(AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel6_template::single_value_struct {
AccessCapAdditionsRel7_template field_accessCapAdditionsRel7;
AccessCapAdditionsAfterRel7_template field_accessCapAdditionsAfterRel7;
};

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel7 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel6_template::copy_value(const AccessCapAdditionsAfterRel6& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel7().is_bound()) {
  single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
} else {
  single_value->field_accessCapAdditionsRel7.clean_up();
}
if (other_value.accessCapAdditionsAfterRel7().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel7().ispresent()) single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7()();
  else single_value->field_accessCapAdditionsAfterRel7 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel7.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel6_template::copy_template(const AccessCapAdditionsAfterRel6_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel7().get_selection()) {
single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
} else {
single_value->field_accessCapAdditionsRel7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel7().get_selection()) {
single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
} else {
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_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 AccessCapAdditionsAfterRel6_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel6_template::AccessCapAdditionsAfterRel6_template()
{
}

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

AccessCapAdditionsAfterRel6_template::AccessCapAdditionsAfterRel6_template(const AccessCapAdditionsAfterRel6& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel6_template::AccessCapAdditionsAfterRel6_template(const OPTIONAL<AccessCapAdditionsAfterRel6>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel6&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel6_template::operator=(const AccessCapAdditionsAfterRel6& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel6_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel6>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel6&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel6_template::match(const AccessCapAdditionsAfterRel6& 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.accessCapAdditionsRel7().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel7.match(other_value.accessCapAdditionsRel7(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel7().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel7().ispresent() ? !single_value->field_accessCapAdditionsAfterRel7.match((const AccessCapAdditionsAfterRel7&)other_value.accessCapAdditionsAfterRel7(), legacy) : !single_value->field_accessCapAdditionsAfterRel7.match_omit(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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel6_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel7.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_bound());
}

boolean AccessCapAdditionsAfterRel6_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel7.is_value()
 && (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_value());
}

void AccessCapAdditionsAfterRel6_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;
}

AccessCapAdditionsAfterRel6 AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
AccessCapAdditionsAfterRel6 ret_val;
if (single_value->field_accessCapAdditionsRel7.is_bound()) {
ret_val.accessCapAdditionsRel7() = single_value->field_accessCapAdditionsRel7.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel7.is_omit()) ret_val.accessCapAdditionsAfterRel7() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel7.is_bound()) {
ret_val.accessCapAdditionsAfterRel7() = single_value->field_accessCapAdditionsAfterRel7.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel6_template[list_length];
}

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsRel7()
{
set_specific();
return single_value->field_accessCapAdditionsRel7;
}

const AccessCapAdditionsRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsRel7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel7 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return single_value->field_accessCapAdditionsRel7;
}

AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsAfterRel7()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel7;
}

const AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsAfterRel7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel7 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return single_value->field_accessCapAdditionsAfterRel7;
}

int AccessCapAdditionsAfterRel6_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_accessCapAdditionsAfterRel7.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel6_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := ");
single_value->field_accessCapAdditionsRel7.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_template::log_match(const AccessCapAdditionsAfterRel6& 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_accessCapAdditionsRel7.match(match_value.accessCapAdditionsRel7(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel7");
single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel7().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel7.match(match_value.accessCapAdditionsAfterRel7(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7");
single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel7.log();
TTCN_Logger::log_event_str(" unmatched");
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("{ accessCapAdditionsRel7 := ");
single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
if (match_value.accessCapAdditionsAfterRel7().ispresent()) {
single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel7.log();
if (single_value->field_accessCapAdditionsAfterRel7.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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 AccessCapAdditionsAfterRel6_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel7.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel7.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
}

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
}

void AccessCapAdditionsAfterRel6_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: {
    AccessCapAdditionsAfterRel6_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6 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) accessCapAdditionsRel7().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel7().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(), "accessCapAdditionsRel7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel7().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(), "accessCapAdditionsAfterRel7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel7().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel6_template* precondition = new AccessCapAdditionsAfterRel6_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel6_template* implied_template = new AccessCapAdditionsAfterRel6_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel6_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
single_value->field_accessCapAdditionsAfterRel7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
}

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

boolean AccessCapAdditionsAfterRel6_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;
}

AccessCapAdditionsRel8::AccessCapAdditionsRel8()
{
}

AccessCapAdditionsRel8::AccessCapAdditionsRel8(const BITSTRING& par_eUTRAFDDsupport,
    const BITSTRING& par_eUTRATDDsupport,
    const BITSTRING& par_gERANToEUTRASupportInGERANPacketTransferMode,
    const BITSTRING& par_priorityBasedReselectionSupport)
  :   field_eUTRAFDDsupport(par_eUTRAFDDsupport),
  field_eUTRATDDsupport(par_eUTRATDDsupport),
  field_gERANToEUTRASupportInGERANPacketTransferMode(par_gERANToEUTRASupportInGERANPacketTransferMode),
  field_priorityBasedReselectionSupport(par_priorityBasedReselectionSupport)
{
}

AccessCapAdditionsRel8::AccessCapAdditionsRel8(const AccessCapAdditionsRel8& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
if (other_value.eUTRAFDDsupport().is_bound()) field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
else field_eUTRAFDDsupport.clean_up();
if (other_value.eUTRATDDsupport().is_bound()) field_eUTRATDDsupport = other_value.eUTRATDDsupport();
else field_eUTRATDDsupport.clean_up();
if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
else field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
if (other_value.priorityBasedReselectionSupport().is_bound()) field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
else field_priorityBasedReselectionSupport.clean_up();
}

void AccessCapAdditionsRel8::clean_up()
{
field_eUTRAFDDsupport.clean_up();
field_eUTRATDDsupport.clean_up();
field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
field_priorityBasedReselectionSupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel8::get_descriptor() const { return &AccessCapAdditionsRel8_descr_; }
AccessCapAdditionsRel8& AccessCapAdditionsRel8::operator=(const AccessCapAdditionsRel8& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
  if (other_value.eUTRAFDDsupport().is_bound()) field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
  else field_eUTRAFDDsupport.clean_up();
  if (other_value.eUTRATDDsupport().is_bound()) field_eUTRATDDsupport = other_value.eUTRATDDsupport();
  else field_eUTRATDDsupport.clean_up();
  if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
  else field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
  if (other_value.priorityBasedReselectionSupport().is_bound()) field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
  else field_priorityBasedReselectionSupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel8::operator==(const AccessCapAdditionsRel8& other_value) const
{
return field_eUTRAFDDsupport==other_value.field_eUTRAFDDsupport
  && field_eUTRATDDsupport==other_value.field_eUTRATDDsupport
  && field_gERANToEUTRASupportInGERANPacketTransferMode==other_value.field_gERANToEUTRASupportInGERANPacketTransferMode
  && field_priorityBasedReselectionSupport==other_value.field_priorityBasedReselectionSupport;
}

boolean AccessCapAdditionsRel8::is_bound() const
{
return (field_eUTRAFDDsupport.is_bound())
  || (field_eUTRATDDsupport.is_bound())
  || (field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound())
  || (field_priorityBasedReselectionSupport.is_bound());
}
boolean AccessCapAdditionsRel8::is_value() const
{
return field_eUTRAFDDsupport.is_value()
  && field_eUTRATDDsupport.is_value()
  && field_gERANToEUTRASupportInGERANPacketTransferMode.is_value()
  && field_priorityBasedReselectionSupport.is_value();
}
void AccessCapAdditionsRel8::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ eUTRAFDDsupport := ");
field_eUTRAFDDsupport.log();
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
field_eUTRATDDsupport.log();
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
field_gERANToEUTRASupportInGERANPacketTransferMode.log();
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
field_priorityBasedReselectionSupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel8::set_implicit_omit()
{
if (eUTRAFDDsupport().is_bound()) eUTRAFDDsupport().set_implicit_omit();
if (eUTRATDDsupport().is_bound()) eUTRATDDsupport().set_implicit_omit();
if (gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) gERANToEUTRASupportInGERANPacketTransferMode().set_implicit_omit();
if (priorityBasedReselectionSupport().is_bound()) priorityBasedReselectionSupport().set_implicit_omit();
}

void AccessCapAdditionsRel8::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 has 4 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) eUTRAFDDsupport().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRATDDsupport().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANToEUTRASupportInGERANPacketTransferMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) priorityBasedReselectionSupport().set_param(*param.get_elem(3));
    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(), "eUTRAFDDsupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAFDDsupport().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(), "eUTRATDDsupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRATDDsupport().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(), "gERANToEUTRASupportInGERANPacketTransferMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERANToEUTRASupportInGERANPacketTransferMode().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(), "priorityBasedReselectionSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityBasedReselectionSupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
  }
}

void AccessCapAdditionsRel8::encode_text(Text_Buf& text_buf) const
{
field_eUTRAFDDsupport.encode_text(text_buf);
field_eUTRATDDsupport.encode_text(text_buf);
field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf);
field_priorityBasedReselectionSupport.encode_text(text_buf);
}

void AccessCapAdditionsRel8::decode_text(Text_Buf& text_buf)
{
field_eUTRAFDDsupport.decode_text(text_buf);
field_eUTRATDDsupport.decode_text(text_buf);
field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf);
field_priorityBasedReselectionSupport.decode_text(text_buf);
}

void AccessCapAdditionsRel8::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel8::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel8::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel8_eUTRAFDDsupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAFDDsupport.RAW_decode(AccessCapAdditionsRel8_eUTRAFDDsupport_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel8_eUTRATDDsupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRATDDsupport.RAW_decode(AccessCapAdditionsRel8_eUTRATDDsupport_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw->forceomit);
  decoded_field_length = field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_decode(AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_.raw->forceomit);
  decoded_field_length = field_priorityBasedReselectionSupport.RAW_decode(AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel8::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel8_eUTRAFDDsupport_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel8_eUTRATDDsupport_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_.raw);
  encoded_length += field_eUTRAFDDsupport.RAW_encode(AccessCapAdditionsRel8_eUTRAFDDsupport_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eUTRATDDsupport.RAW_encode(AccessCapAdditionsRel8_eUTRATDDsupport_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_encode(AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_priorityBasedReselectionSupport.RAW_encode(AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel8_template::single_value_struct {
BITSTRING_template field_eUTRAFDDsupport;
BITSTRING_template field_eUTRATDDsupport;
BITSTRING_template field_gERANToEUTRASupportInGERANPacketTransferMode;
BITSTRING_template field_priorityBasedReselectionSupport;
};

void AccessCapAdditionsRel8_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_eUTRAFDDsupport = ANY_VALUE;
single_value->field_eUTRATDDsupport = ANY_VALUE;
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = ANY_VALUE;
single_value->field_priorityBasedReselectionSupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel8_template::copy_value(const AccessCapAdditionsRel8& other_value)
{
single_value = new single_value_struct;
if (other_value.eUTRAFDDsupport().is_bound()) {
  single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
} else {
  single_value->field_eUTRAFDDsupport.clean_up();
}
if (other_value.eUTRATDDsupport().is_bound()) {
  single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport();
} else {
  single_value->field_eUTRATDDsupport.clean_up();
}
if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) {
  single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
} else {
  single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
}
if (other_value.priorityBasedReselectionSupport().is_bound()) {
  single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
} else {
  single_value->field_priorityBasedReselectionSupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel8_template::copy_template(const AccessCapAdditionsRel8_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAFDDsupport().get_selection()) {
single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
} else {
single_value->field_eUTRAFDDsupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRATDDsupport().get_selection()) {
single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport();
} else {
single_value->field_eUTRATDDsupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gERANToEUTRASupportInGERANPacketTransferMode().get_selection()) {
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
} else {
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priorityBasedReselectionSupport().get_selection()) {
single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
} else {
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_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 AccessCapAdditionsRel8_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel8_template::AccessCapAdditionsRel8_template()
{
}

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

AccessCapAdditionsRel8_template::AccessCapAdditionsRel8_template(const AccessCapAdditionsRel8& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel8_template::AccessCapAdditionsRel8_template(const OPTIONAL<AccessCapAdditionsRel8>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel8&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel8_template& AccessCapAdditionsRel8_template::operator=(const AccessCapAdditionsRel8& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel8_template& AccessCapAdditionsRel8_template::operator=(const OPTIONAL<AccessCapAdditionsRel8>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel8&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
}
return *this;
}

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

boolean AccessCapAdditionsRel8_template::match(const AccessCapAdditionsRel8& 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.eUTRAFDDsupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAFDDsupport.match(other_value.eUTRAFDDsupport(), legacy))return FALSE;
if(!other_value.eUTRATDDsupport().is_bound()) return FALSE;
if(!single_value->field_eUTRATDDsupport.match(other_value.eUTRATDDsupport(), legacy))return FALSE;
if(!other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) return FALSE;
if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(other_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy))return FALSE;
if(!other_value.priorityBasedReselectionSupport().is_bound()) return FALSE;
if(!single_value->field_priorityBasedReselectionSupport.match(other_value.priorityBasedReselectionSupport(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
}
return FALSE;
}

boolean AccessCapAdditionsRel8_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_eUTRAFDDsupport.is_bound()
 || single_value->field_eUTRATDDsupport.is_bound()
 || single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound()
 || single_value->field_priorityBasedReselectionSupport.is_bound();
}

boolean AccessCapAdditionsRel8_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_eUTRAFDDsupport.is_value()
 && single_value->field_eUTRATDDsupport.is_value()
 && single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_value()
 && single_value->field_priorityBasedReselectionSupport.is_value();
}

void AccessCapAdditionsRel8_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;
}

AccessCapAdditionsRel8 AccessCapAdditionsRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
AccessCapAdditionsRel8 ret_val;
if (single_value->field_eUTRAFDDsupport.is_bound()) {
ret_val.eUTRAFDDsupport() = single_value->field_eUTRAFDDsupport.valueof();
}
if (single_value->field_eUTRATDDsupport.is_bound()) {
ret_val.eUTRATDDsupport() = single_value->field_eUTRATDDsupport.valueof();
}
if (single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound()) {
ret_val.gERANToEUTRASupportInGERANPacketTransferMode() = single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.valueof();
}
if (single_value->field_priorityBasedReselectionSupport.is_bound()) {
ret_val.priorityBasedReselectionSupport() = single_value->field_priorityBasedReselectionSupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel8_template[list_length];
}

AccessCapAdditionsRel8_template& AccessCapAdditionsRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel8_template::eUTRAFDDsupport()
{
set_specific();
return single_value->field_eUTRAFDDsupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::eUTRAFDDsupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAFDDsupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_eUTRAFDDsupport;
}

BITSTRING_template& AccessCapAdditionsRel8_template::eUTRATDDsupport()
{
set_specific();
return single_value->field_eUTRATDDsupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::eUTRATDDsupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRATDDsupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_eUTRATDDsupport;
}

BITSTRING_template& AccessCapAdditionsRel8_template::gERANToEUTRASupportInGERANPacketTransferMode()
{
set_specific();
return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::gERANToEUTRASupportInGERANPacketTransferMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gERANToEUTRASupportInGERANPacketTransferMode of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode;
}

BITSTRING_template& AccessCapAdditionsRel8_template::priorityBasedReselectionSupport()
{
set_specific();
return single_value->field_priorityBasedReselectionSupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::priorityBasedReselectionSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityBasedReselectionSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_priorityBasedReselectionSupport;
}

int AccessCapAdditionsRel8_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
  }
  return 0;
}

void AccessCapAdditionsRel8_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ eUTRAFDDsupport := ");
single_value->field_eUTRAFDDsupport.log();
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
single_value->field_eUTRATDDsupport.log();
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log();
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_template::log_match(const AccessCapAdditionsRel8& 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_eUTRAFDDsupport.match(match_value.eUTRAFDDsupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAFDDsupport");
single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRATDDsupport.match(match_value.eUTRATDDsupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRATDDsupport");
single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy)){
TTCN_Logger::log_logmatch_info(".gERANToEUTRASupportInGERANPacketTransferMode");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_priorityBasedReselectionSupport.match(match_value.priorityBasedReselectionSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityBasedReselectionSupport");
single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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("{ eUTRAFDDsupport := ");
single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy);
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy);
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy);
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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 AccessCapAdditionsRel8_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_eUTRAFDDsupport.encode_text(text_buf);
single_value->field_eUTRATDDsupport.encode_text(text_buf);
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf);
single_value->field_priorityBasedReselectionSupport.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
}
}

void AccessCapAdditionsRel8_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_eUTRAFDDsupport.decode_text(text_buf);
single_value->field_eUTRATDDsupport.decode_text(text_buf);
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf);
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
}
}

void AccessCapAdditionsRel8_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: {
    AccessCapAdditionsRel8_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8 has 4 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) eUTRAFDDsupport().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRATDDsupport().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANToEUTRASupportInGERANPacketTransferMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) priorityBasedReselectionSupport().set_param(*param.get_elem(3));
    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(), "eUTRAFDDsupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAFDDsupport().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(), "eUTRATDDsupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRATDDsupport().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(), "gERANToEUTRASupportInGERANPacketTransferMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERANToEUTRASupportInGERANPacketTransferMode().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(), "priorityBasedReselectionSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityBasedReselectionSupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel8_template* precondition = new AccessCapAdditionsRel8_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel8_template* implied_template = new AccessCapAdditionsRel8_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel8_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel8_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_eUTRAFDDsupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_eUTRATDDsupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_priorityBasedReselectionSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
}

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

boolean AccessCapAdditionsRel8_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;
}

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment()
{
}

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment(const BITSTRING& par_presenceBitalternativeEFTAMultislotClass,
    const BITSTRING& par_alternativeEFTAMultislotClass,
    const BITSTRING& par_eFTAMultislotCapabilityReductionforDownlinkDualCarrier)
  :   field_presenceBitalternativeEFTAMultislotClass(par_presenceBitalternativeEFTAMultislotClass),
  field_alternativeEFTAMultislotClass(par_alternativeEFTAMultislotClass),
  field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier(par_eFTAMultislotCapabilityReductionforDownlinkDualCarrier)
{
}

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment(const EnhancedFlexTimeslotAssignment& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
else field_presenceBitalternativeEFTAMultislotClass.clean_up();
if (other_value.alternativeEFTAMultislotClass().is_bound()) field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
else field_alternativeEFTAMultislotClass.clean_up();
if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
else field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}

void EnhancedFlexTimeslotAssignment::clean_up()
{
field_presenceBitalternativeEFTAMultislotClass.clean_up();
field_alternativeEFTAMultislotClass.clean_up();
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}

const TTCN_Typedescriptor_t* EnhancedFlexTimeslotAssignment::get_descriptor() const { return &EnhancedFlexTimeslotAssignment_descr_; }
EnhancedFlexTimeslotAssignment& EnhancedFlexTimeslotAssignment::operator=(const EnhancedFlexTimeslotAssignment& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
  if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
  else field_presenceBitalternativeEFTAMultislotClass.clean_up();
  if (other_value.alternativeEFTAMultislotClass().is_bound()) field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
  else field_alternativeEFTAMultislotClass.clean_up();
  if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
  else field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}
return *this;
}

boolean EnhancedFlexTimeslotAssignment::operator==(const EnhancedFlexTimeslotAssignment& other_value) const
{
return field_presenceBitalternativeEFTAMultislotClass==other_value.field_presenceBitalternativeEFTAMultislotClass
  && field_alternativeEFTAMultislotClass==other_value.field_alternativeEFTAMultislotClass
  && field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier==other_value.field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

boolean EnhancedFlexTimeslotAssignment::is_bound() const
{
return (field_presenceBitalternativeEFTAMultislotClass.is_bound())
  || (field_alternativeEFTAMultislotClass.is_bound())
  || (field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound());
}
boolean EnhancedFlexTimeslotAssignment::is_value() const
{
return field_presenceBitalternativeEFTAMultislotClass.is_value()
  && field_alternativeEFTAMultislotClass.is_value()
  && field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_value();
}
void EnhancedFlexTimeslotAssignment::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitalternativeEFTAMultislotClass := ");
field_presenceBitalternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
field_alternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(" }");
}

void EnhancedFlexTimeslotAssignment::set_implicit_omit()
{
if (presenceBitalternativeEFTAMultislotClass().is_bound()) presenceBitalternativeEFTAMultislotClass().set_implicit_omit();
if (alternativeEFTAMultislotClass().is_bound()) alternativeEFTAMultislotClass().set_implicit_omit();
if (eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_implicit_omit();
}

void EnhancedFlexTimeslotAssignment::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment has 3 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) presenceBitalternativeEFTAMultislotClass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) alternativeEFTAMultislotClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_param(*param.get_elem(2));
    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(), "presenceBitalternativeEFTAMultislotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitalternativeEFTAMultislotClass().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(), "alternativeEFTAMultislotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alternativeEFTAMultislotClass().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(), "eFTAMultislotCapabilityReductionforDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eFTAMultislotCapabilityReductionforDownlinkDualCarrier().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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
  }
}

void EnhancedFlexTimeslotAssignment::encode_text(Text_Buf& text_buf) const
{
field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf);
field_alternativeEFTAMultislotClass.encode_text(text_buf);
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.encode_text(text_buf);
}

void EnhancedFlexTimeslotAssignment::decode_text(Text_Buf& text_buf)
{
field_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf);
field_alternativeEFTAMultislotClass.decode_text(text_buf);
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.decode_text(text_buf);
}

void EnhancedFlexTimeslotAssignment::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void EnhancedFlexTimeslotAssignment::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int EnhancedFlexTimeslotAssignment::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitalternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_.raw->forceomit);
  decoded_field_length = field_alternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_decode(EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int EnhancedFlexTimeslotAssignment::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw);
  encoded_length += field_presenceBitalternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_alternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_encode(EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct EnhancedFlexTimeslotAssignment_template::single_value_struct {
BITSTRING_template field_presenceBitalternativeEFTAMultislotClass;
BITSTRING_template field_alternativeEFTAMultislotClass;
BITSTRING_template field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
};

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass = ANY_VALUE;
single_value->field_alternativeEFTAMultislotClass = ANY_VALUE;
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = ANY_VALUE;
}
}
}

void EnhancedFlexTimeslotAssignment_template::copy_value(const EnhancedFlexTimeslotAssignment& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) {
  single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
} else {
  single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up();
}
if (other_value.alternativeEFTAMultislotClass().is_bound()) {
  single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
} else {
  single_value->field_alternativeEFTAMultislotClass.clean_up();
}
if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) {
  single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
} else {
  single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EnhancedFlexTimeslotAssignment_template::copy_template(const EnhancedFlexTimeslotAssignment_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitalternativeEFTAMultislotClass().get_selection()) {
single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
} else {
single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alternativeEFTAMultislotClass().get_selection()) {
single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
} else {
single_value->field_alternativeEFTAMultislotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().get_selection()) {
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
} else {
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_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 EnhancedFlexTimeslotAssignment_template(*other_value.implication_.precondition);
implication_.implied_template = new EnhancedFlexTimeslotAssignment_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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
break;
}
set_selection(other_value);
}

EnhancedFlexTimeslotAssignment_template::EnhancedFlexTimeslotAssignment_template()
{
}

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

EnhancedFlexTimeslotAssignment_template::EnhancedFlexTimeslotAssignment_template(const EnhancedFlexTimeslotAssignment& other_value)
{
copy_value(other_value);
}

EnhancedFlexTimeslotAssignment_template::EnhancedFlexTimeslotAssignment_template(const OPTIONAL<EnhancedFlexTimeslotAssignment>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const EnhancedFlexTimeslotAssignment&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment from an unbound optional field.");
}
}

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

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

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

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

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

EnhancedFlexTimeslotAssignment_template& EnhancedFlexTimeslotAssignment_template::operator=(const EnhancedFlexTimeslotAssignment& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

EnhancedFlexTimeslotAssignment_template& EnhancedFlexTimeslotAssignment_template::operator=(const OPTIONAL<EnhancedFlexTimeslotAssignment>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const EnhancedFlexTimeslotAssignment&)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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
return *this;
}

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

boolean EnhancedFlexTimeslotAssignment_template::match(const EnhancedFlexTimeslotAssignment& 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.presenceBitalternativeEFTAMultislotClass().is_bound()) return FALSE;
if(!single_value->field_presenceBitalternativeEFTAMultislotClass.match(other_value.presenceBitalternativeEFTAMultislotClass(), legacy))return FALSE;
if(!other_value.alternativeEFTAMultislotClass().is_bound()) return FALSE;
if(!single_value->field_alternativeEFTAMultislotClass.match(other_value.alternativeEFTAMultislotClass(), legacy))return FALSE;
if(!other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
return FALSE;
}

boolean EnhancedFlexTimeslotAssignment_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound()
 || single_value->field_alternativeEFTAMultislotClass.is_bound()
 || single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound();
}

boolean EnhancedFlexTimeslotAssignment_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitalternativeEFTAMultislotClass.is_value()
 && single_value->field_alternativeEFTAMultislotClass.is_value()
 && single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_value();
}

void EnhancedFlexTimeslotAssignment_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;
}

EnhancedFlexTimeslotAssignment EnhancedFlexTimeslotAssignment_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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
EnhancedFlexTimeslotAssignment ret_val;
if (single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound()) {
ret_val.presenceBitalternativeEFTAMultislotClass() = single_value->field_presenceBitalternativeEFTAMultislotClass.valueof();
}
if (single_value->field_alternativeEFTAMultislotClass.is_bound()) {
ret_val.alternativeEFTAMultislotClass() = single_value->field_alternativeEFTAMultislotClass.valueof();
}
if (single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound()) {
ret_val.eFTAMultislotCapabilityReductionforDownlinkDualCarrier() = single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.valueof();
}
return ret_val;
}

void EnhancedFlexTimeslotAssignment_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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EnhancedFlexTimeslotAssignment_template[list_length];
}

EnhancedFlexTimeslotAssignment_template& EnhancedFlexTimeslotAssignment_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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return value_list.list_value[list_index];
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::presenceBitalternativeEFTAMultislotClass()
{
set_specific();
return single_value->field_presenceBitalternativeEFTAMultislotClass;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::presenceBitalternativeEFTAMultislotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitalternativeEFTAMultislotClass of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_presenceBitalternativeEFTAMultislotClass;
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::alternativeEFTAMultislotClass()
{
set_specific();
return single_value->field_alternativeEFTAMultislotClass;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::alternativeEFTAMultislotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alternativeEFTAMultislotClass of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_alternativeEFTAMultislotClass;
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier()
{
set_specific();
return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eFTAMultislotCapabilityReductionforDownlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

int EnhancedFlexTimeslotAssignment_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment 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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
  }
  return 0;
}

void EnhancedFlexTimeslotAssignment_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitalternativeEFTAMultislotClass := ");
single_value->field_presenceBitalternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
single_value->field_alternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_template::log_match(const EnhancedFlexTimeslotAssignment& 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_presenceBitalternativeEFTAMultislotClass.match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitalternativeEFTAMultislotClass");
single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_alternativeEFTAMultislotClass.match(match_value.alternativeEFTAMultislotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".alternativeEFTAMultislotClass");
single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".eFTAMultislotCapabilityReductionforDownlinkDualCarrier");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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("{ presenceBitalternativeEFTAMultislotClass := ");
single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy);
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy);
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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 EnhancedFlexTimeslotAssignment_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf);
single_value->field_alternativeEFTAMultislotClass.encode_text(text_buf);
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
}

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf);
single_value->field_alternativeEFTAMultislotClass.decode_text(text_buf);
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
}

void EnhancedFlexTimeslotAssignment_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: {
    EnhancedFlexTimeslotAssignment_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment has 3 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) presenceBitalternativeEFTAMultislotClass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) alternativeEFTAMultislotClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_param(*param.get_elem(2));
    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(), "presenceBitalternativeEFTAMultislotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitalternativeEFTAMultislotClass().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(), "alternativeEFTAMultislotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alternativeEFTAMultislotClass().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(), "eFTAMultislotCapabilityReductionforDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eFTAMultislotCapabilityReductionforDownlinkDualCarrier().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 @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EnhancedFlexTimeslotAssignment_template* precondition = new EnhancedFlexTimeslotAssignment_template;
    precondition->set_param(*param.get_elem(0));
    EnhancedFlexTimeslotAssignment_template* implied_template = new EnhancedFlexTimeslotAssignment_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EnhancedFlexTimeslotAssignment_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
  }
  is_ifpresent = param.get_ifpresent();
}

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
single_value->field_alternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
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 : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
}

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

boolean EnhancedFlexTimeslotAssignment_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;
}

AccessCapAdditionsRel9::AccessCapAdditionsRel9()
{
}

AccessCapAdditionsRel9::AccessCapAdditionsRel9(const EnhancedFlexTimeslotAssignment& par_enhancedFlexTimeslotAssignment,
    const BITSTRING& par_indicationofUpperLayerPDUStartCapabilityforRLCUM,
    const BITSTRING& par_eMSTCapability,
    const BITSTRING& par_mTTICapability,
    const BITSTRING& par_uTRACSGCellsReporting,
    const BITSTRING& par_eUTRACSGCellsReporting)
  :   field_enhancedFlexTimeslotAssignment(par_enhancedFlexTimeslotAssignment),
  field_indicationofUpperLayerPDUStartCapabilityforRLCUM(par_indicationofUpperLayerPDUStartCapabilityforRLCUM),
  field_eMSTCapability(par_eMSTCapability),
  field_mTTICapability(par_mTTICapability),
  field_uTRACSGCellsReporting(par_uTRACSGCellsReporting),
  field_eUTRACSGCellsReporting(par_eUTRACSGCellsReporting)
{
}

AccessCapAdditionsRel9::AccessCapAdditionsRel9(const AccessCapAdditionsRel9& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
if (other_value.enhancedFlexTimeslotAssignment().is_bound()) field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
else field_enhancedFlexTimeslotAssignment.clean_up();
if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
else field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
if (other_value.eMSTCapability().is_bound()) field_eMSTCapability = other_value.eMSTCapability();
else field_eMSTCapability.clean_up();
if (other_value.mTTICapability().is_bound()) field_mTTICapability = other_value.mTTICapability();
else field_mTTICapability.clean_up();
if (other_value.uTRACSGCellsReporting().is_bound()) field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
else field_uTRACSGCellsReporting.clean_up();
if (other_value.eUTRACSGCellsReporting().is_bound()) field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
else field_eUTRACSGCellsReporting.clean_up();
}

void AccessCapAdditionsRel9::clean_up()
{
field_enhancedFlexTimeslotAssignment.clean_up();
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
field_eMSTCapability.clean_up();
field_mTTICapability.clean_up();
field_uTRACSGCellsReporting.clean_up();
field_eUTRACSGCellsReporting.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel9::get_descriptor() const { return &AccessCapAdditionsRel9_descr_; }
AccessCapAdditionsRel9& AccessCapAdditionsRel9::operator=(const AccessCapAdditionsRel9& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
  if (other_value.enhancedFlexTimeslotAssignment().is_bound()) field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
  else field_enhancedFlexTimeslotAssignment.clean_up();
  if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
  else field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
  if (other_value.eMSTCapability().is_bound()) field_eMSTCapability = other_value.eMSTCapability();
  else field_eMSTCapability.clean_up();
  if (other_value.mTTICapability().is_bound()) field_mTTICapability = other_value.mTTICapability();
  else field_mTTICapability.clean_up();
  if (other_value.uTRACSGCellsReporting().is_bound()) field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
  else field_uTRACSGCellsReporting.clean_up();
  if (other_value.eUTRACSGCellsReporting().is_bound()) field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
  else field_eUTRACSGCellsReporting.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel9::operator==(const AccessCapAdditionsRel9& other_value) const
{
return field_enhancedFlexTimeslotAssignment==other_value.field_enhancedFlexTimeslotAssignment
  && field_indicationofUpperLayerPDUStartCapabilityforRLCUM==other_value.field_indicationofUpperLayerPDUStartCapabilityforRLCUM
  && field_eMSTCapability==other_value.field_eMSTCapability
  && field_mTTICapability==other_value.field_mTTICapability
  && field_uTRACSGCellsReporting==other_value.field_uTRACSGCellsReporting
  && field_eUTRACSGCellsReporting==other_value.field_eUTRACSGCellsReporting;
}

boolean AccessCapAdditionsRel9::is_bound() const
{
return (field_enhancedFlexTimeslotAssignment.is_bound())
  || (field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound())
  || (field_eMSTCapability.is_bound())
  || (field_mTTICapability.is_bound())
  || (field_uTRACSGCellsReporting.is_bound())
  || (field_eUTRACSGCellsReporting.is_bound());
}
boolean AccessCapAdditionsRel9::is_value() const
{
return field_enhancedFlexTimeslotAssignment.is_value()
  && field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_value()
  && field_eMSTCapability.is_value()
  && field_mTTICapability.is_value()
  && field_uTRACSGCellsReporting.is_value()
  && field_eUTRACSGCellsReporting.is_value();
}
void AccessCapAdditionsRel9::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ enhancedFlexTimeslotAssignment := ");
field_enhancedFlexTimeslotAssignment.log();
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log();
TTCN_Logger::log_event_str(", eMSTCapability := ");
field_eMSTCapability.log();
TTCN_Logger::log_event_str(", mTTICapability := ");
field_mTTICapability.log();
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
field_uTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
field_eUTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel9::set_implicit_omit()
{
if (enhancedFlexTimeslotAssignment().is_bound()) enhancedFlexTimeslotAssignment().set_implicit_omit();
if (indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_implicit_omit();
if (eMSTCapability().is_bound()) eMSTCapability().set_implicit_omit();
if (mTTICapability().is_bound()) mTTICapability().set_implicit_omit();
if (uTRACSGCellsReporting().is_bound()) uTRACSGCellsReporting().set_implicit_omit();
if (eUTRACSGCellsReporting().is_bound()) eUTRACSGCellsReporting().set_implicit_omit();
}

void AccessCapAdditionsRel9::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 (6<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 has 6 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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().set_param(*param.get_elem(5));
    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(), "enhancedFlexTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhancedFlexTimeslotAssignment().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(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          indicationofUpperLayerPDUStartCapabilityforRLCUM().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(), "eMSTCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSTCapability().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(), "mTTICapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mTTICapability().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(), "uTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRACSGCellsReporting().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(), "eUTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRACSGCellsReporting().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
  }
}

void AccessCapAdditionsRel9::encode_text(Text_Buf& text_buf) const
{
field_enhancedFlexTimeslotAssignment.encode_text(text_buf);
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf);
field_eMSTCapability.encode_text(text_buf);
field_mTTICapability.encode_text(text_buf);
field_uTRACSGCellsReporting.encode_text(text_buf);
field_eUTRACSGCellsReporting.encode_text(text_buf);
}

void AccessCapAdditionsRel9::decode_text(Text_Buf& text_buf)
{
field_enhancedFlexTimeslotAssignment.decode_text(text_buf);
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf);
field_eMSTCapability.decode_text(text_buf);
field_mTTICapability.decode_text(text_buf);
field_uTRACSGCellsReporting.decode_text(text_buf);
field_eUTRACSGCellsReporting.decode_text(text_buf);
}

void AccessCapAdditionsRel9::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel9::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel9::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_.raw->forceomit);
  decoded_field_length = field_enhancedFlexTimeslotAssignment.RAW_decode(AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw->forceomit);
  decoded_field_length = field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_decode(AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel9_eMSTCapability_descr_.raw->forceomit);
  decoded_field_length = field_eMSTCapability.RAW_decode(AccessCapAdditionsRel9_eMSTCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel9_mTTICapability_descr_.raw->forceomit);
  decoded_field_length = field_mTTICapability.RAW_decode(AccessCapAdditionsRel9_mTTICapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_.raw->forceomit);
  decoded_field_length = field_uTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_.raw->forceomit);
  decoded_field_length = field_eUTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel9::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 = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel9_eMSTCapability_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel9_mTTICapability_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_.raw);
  encoded_length += field_enhancedFlexTimeslotAssignment.RAW_encode(AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_encode(AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_eMSTCapability.RAW_encode(AccessCapAdditionsRel9_eMSTCapability_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mTTICapability.RAW_encode(AccessCapAdditionsRel9_mTTICapability_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_uTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_eUTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel9_template::single_value_struct {
EnhancedFlexTimeslotAssignment_template field_enhancedFlexTimeslotAssignment;
BITSTRING_template field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
BITSTRING_template field_eMSTCapability;
BITSTRING_template field_mTTICapability;
BITSTRING_template field_uTRACSGCellsReporting;
BITSTRING_template field_eUTRACSGCellsReporting;
};

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment = ANY_VALUE;
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = ANY_VALUE;
single_value->field_eMSTCapability = ANY_VALUE;
single_value->field_mTTICapability = ANY_VALUE;
single_value->field_uTRACSGCellsReporting = ANY_VALUE;
single_value->field_eUTRACSGCellsReporting = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel9_template::copy_value(const AccessCapAdditionsRel9& other_value)
{
single_value = new single_value_struct;
if (other_value.enhancedFlexTimeslotAssignment().is_bound()) {
  single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
} else {
  single_value->field_enhancedFlexTimeslotAssignment.clean_up();
}
if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) {
  single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
} else {
  single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
}
if (other_value.eMSTCapability().is_bound()) {
  single_value->field_eMSTCapability = other_value.eMSTCapability();
} else {
  single_value->field_eMSTCapability.clean_up();
}
if (other_value.mTTICapability().is_bound()) {
  single_value->field_mTTICapability = other_value.mTTICapability();
} else {
  single_value->field_mTTICapability.clean_up();
}
if (other_value.uTRACSGCellsReporting().is_bound()) {
  single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
} else {
  single_value->field_uTRACSGCellsReporting.clean_up();
}
if (other_value.eUTRACSGCellsReporting().is_bound()) {
  single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
} else {
  single_value->field_eUTRACSGCellsReporting.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel9_template::copy_template(const AccessCapAdditionsRel9_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.enhancedFlexTimeslotAssignment().get_selection()) {
single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
} else {
single_value->field_enhancedFlexTimeslotAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().get_selection()) {
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
} else {
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eMSTCapability().get_selection()) {
single_value->field_eMSTCapability = other_value.eMSTCapability();
} else {
single_value->field_eMSTCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mTTICapability().get_selection()) {
single_value->field_mTTICapability = other_value.mTTICapability();
} else {
single_value->field_mTTICapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uTRACSGCellsReporting().get_selection()) {
single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
} else {
single_value->field_uTRACSGCellsReporting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRACSGCellsReporting().get_selection()) {
single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
} else {
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_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 AccessCapAdditionsRel9_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel9_template::AccessCapAdditionsRel9_template()
{
}

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

AccessCapAdditionsRel9_template::AccessCapAdditionsRel9_template(const AccessCapAdditionsRel9& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel9_template::AccessCapAdditionsRel9_template(const OPTIONAL<AccessCapAdditionsRel9>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel9&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel9_template& AccessCapAdditionsRel9_template::operator=(const AccessCapAdditionsRel9& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel9_template& AccessCapAdditionsRel9_template::operator=(const OPTIONAL<AccessCapAdditionsRel9>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel9&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
}
return *this;
}

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

boolean AccessCapAdditionsRel9_template::match(const AccessCapAdditionsRel9& 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.enhancedFlexTimeslotAssignment().is_bound()) return FALSE;
if(!single_value->field_enhancedFlexTimeslotAssignment.match(other_value.enhancedFlexTimeslotAssignment(), legacy))return FALSE;
if(!other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) return FALSE;
if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy))return FALSE;
if(!other_value.eMSTCapability().is_bound()) return FALSE;
if(!single_value->field_eMSTCapability.match(other_value.eMSTCapability(), legacy))return FALSE;
if(!other_value.mTTICapability().is_bound()) return FALSE;
if(!single_value->field_mTTICapability.match(other_value.mTTICapability(), legacy))return FALSE;
if(!other_value.uTRACSGCellsReporting().is_bound()) return FALSE;
if(!single_value->field_uTRACSGCellsReporting.match(other_value.uTRACSGCellsReporting(), legacy))return FALSE;
if(!other_value.eUTRACSGCellsReporting().is_bound()) return FALSE;
if(!single_value->field_eUTRACSGCellsReporting.match(other_value.eUTRACSGCellsReporting(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
}
return FALSE;
}

boolean AccessCapAdditionsRel9_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_enhancedFlexTimeslotAssignment.is_bound()
 || single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound()
 || single_value->field_eMSTCapability.is_bound()
 || single_value->field_mTTICapability.is_bound()
 || single_value->field_uTRACSGCellsReporting.is_bound()
 || single_value->field_eUTRACSGCellsReporting.is_bound();
}

boolean AccessCapAdditionsRel9_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_enhancedFlexTimeslotAssignment.is_value()
 && single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_value()
 && single_value->field_eMSTCapability.is_value()
 && single_value->field_mTTICapability.is_value()
 && single_value->field_uTRACSGCellsReporting.is_value()
 && single_value->field_eUTRACSGCellsReporting.is_value();
}

void AccessCapAdditionsRel9_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;
}

AccessCapAdditionsRel9 AccessCapAdditionsRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
AccessCapAdditionsRel9 ret_val;
if (single_value->field_enhancedFlexTimeslotAssignment.is_bound()) {
ret_val.enhancedFlexTimeslotAssignment() = single_value->field_enhancedFlexTimeslotAssignment.valueof();
}
if (single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound()) {
ret_val.indicationofUpperLayerPDUStartCapabilityforRLCUM() = single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.valueof();
}
if (single_value->field_eMSTCapability.is_bound()) {
ret_val.eMSTCapability() = single_value->field_eMSTCapability.valueof();
}
if (single_value->field_mTTICapability.is_bound()) {
ret_val.mTTICapability() = single_value->field_mTTICapability.valueof();
}
if (single_value->field_uTRACSGCellsReporting.is_bound()) {
ret_val.uTRACSGCellsReporting() = single_value->field_uTRACSGCellsReporting.valueof();
}
if (single_value->field_eUTRACSGCellsReporting.is_bound()) {
ret_val.eUTRACSGCellsReporting() = single_value->field_eUTRACSGCellsReporting.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel9_template[list_length];
}

AccessCapAdditionsRel9_template& AccessCapAdditionsRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return value_list.list_value[list_index];
}

EnhancedFlexTimeslotAssignment_template& AccessCapAdditionsRel9_template::enhancedFlexTimeslotAssignment()
{
set_specific();
return single_value->field_enhancedFlexTimeslotAssignment;
}

const EnhancedFlexTimeslotAssignment_template& AccessCapAdditionsRel9_template::enhancedFlexTimeslotAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field enhancedFlexTimeslotAssignment of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_enhancedFlexTimeslotAssignment;
}

BITSTRING_template& AccessCapAdditionsRel9_template::indicationofUpperLayerPDUStartCapabilityforRLCUM()
{
set_specific();
return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::indicationofUpperLayerPDUStartCapabilityforRLCUM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field indicationofUpperLayerPDUStartCapabilityforRLCUM of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
}

BITSTRING_template& AccessCapAdditionsRel9_template::eMSTCapability()
{
set_specific();
return single_value->field_eMSTCapability;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::eMSTCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMSTCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_eMSTCapability;
}

BITSTRING_template& AccessCapAdditionsRel9_template::mTTICapability()
{
set_specific();
return single_value->field_mTTICapability;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::mTTICapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mTTICapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_mTTICapability;
}

BITSTRING_template& AccessCapAdditionsRel9_template::uTRACSGCellsReporting()
{
set_specific();
return single_value->field_uTRACSGCellsReporting;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::uTRACSGCellsReporting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRACSGCellsReporting of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_uTRACSGCellsReporting;
}

BITSTRING_template& AccessCapAdditionsRel9_template::eUTRACSGCellsReporting()
{
set_specific();
return single_value->field_eUTRACSGCellsReporting;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::eUTRACSGCellsReporting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRACSGCellsReporting of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_eUTRACSGCellsReporting;
}

int AccessCapAdditionsRel9_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 6;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
  }
  return 0;
}

void AccessCapAdditionsRel9_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ enhancedFlexTimeslotAssignment := ");
single_value->field_enhancedFlexTimeslotAssignment.log();
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log();
TTCN_Logger::log_event_str(", eMSTCapability := ");
single_value->field_eMSTCapability.log();
TTCN_Logger::log_event_str(", mTTICapability := ");
single_value->field_mTTICapability.log();
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
single_value->field_uTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_template::log_match(const AccessCapAdditionsRel9& 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_enhancedFlexTimeslotAssignment.match(match_value.enhancedFlexTimeslotAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".enhancedFlexTimeslotAssignment");
single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy)){
TTCN_Logger::log_logmatch_info(".indicationofUpperLayerPDUStartCapabilityforRLCUM");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eMSTCapability.match(match_value.eMSTCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".eMSTCapability");
single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mTTICapability.match(match_value.mTTICapability(), legacy)){
TTCN_Logger::log_logmatch_info(".mTTICapability");
single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uTRACSGCellsReporting.match(match_value.uTRACSGCellsReporting(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRACSGCellsReporting");
single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRACSGCellsReporting.match(match_value.eUTRACSGCellsReporting(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRACSGCellsReporting");
single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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("{ enhancedFlexTimeslotAssignment := ");
single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy);
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy);
TTCN_Logger::log_event_str(", eMSTCapability := ");
single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy);
TTCN_Logger::log_event_str(", mTTICapability := ");
single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy);
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy);
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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 AccessCapAdditionsRel9_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_enhancedFlexTimeslotAssignment.encode_text(text_buf);
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf);
single_value->field_eMSTCapability.encode_text(text_buf);
single_value->field_mTTICapability.encode_text(text_buf);
single_value->field_uTRACSGCellsReporting.encode_text(text_buf);
single_value->field_eUTRACSGCellsReporting.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
}
}

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment.decode_text(text_buf);
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf);
single_value->field_eMSTCapability.decode_text(text_buf);
single_value->field_mTTICapability.decode_text(text_buf);
single_value->field_uTRACSGCellsReporting.decode_text(text_buf);
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
}
}

void AccessCapAdditionsRel9_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: {
    AccessCapAdditionsRel9_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 (6<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9 has 6 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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().set_param(*param.get_elem(5));
    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(), "enhancedFlexTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhancedFlexTimeslotAssignment().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(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          indicationofUpperLayerPDUStartCapabilityforRLCUM().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(), "eMSTCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSTCapability().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(), "mTTICapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mTTICapability().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(), "uTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRACSGCellsReporting().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(), "eUTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRACSGCellsReporting().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel9_template* precondition = new AccessCapAdditionsRel9_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel9_template* implied_template = new AccessCapAdditionsRel9_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel9_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_eMSTCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_mTTICapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_uTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_eUTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
}

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

boolean AccessCapAdditionsRel9_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;
}

AccessCapAdditionsRel10::AccessCapAdditionsRel10()
{
}

AccessCapAdditionsRel10::AccessCapAdditionsRel10(const BITSTRING& par_dTRCapability,
    const BITSTRING& par_eMSRCapability,
    const BITSTRING& par_fastDownlinkFrequencySwitchingCapability,
    const BITSTRING& par_tIGHTER__Capability)
  :   field_dTRCapability(par_dTRCapability),
  field_eMSRCapability(par_eMSRCapability),
  field_fastDownlinkFrequencySwitchingCapability(par_fastDownlinkFrequencySwitchingCapability),
  field_tIGHTER__Capability(par_tIGHTER__Capability)
{
}

AccessCapAdditionsRel10::AccessCapAdditionsRel10(const AccessCapAdditionsRel10& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
if (other_value.dTRCapability().is_bound()) field_dTRCapability = other_value.dTRCapability();
else field_dTRCapability.clean_up();
if (other_value.eMSRCapability().is_bound()) field_eMSRCapability = other_value.eMSRCapability();
else field_eMSRCapability.clean_up();
if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
else field_fastDownlinkFrequencySwitchingCapability.clean_up();
if (other_value.tIGHTER__Capability().is_bound()) field_tIGHTER__Capability = other_value.tIGHTER__Capability();
else field_tIGHTER__Capability.clean_up();
}

void AccessCapAdditionsRel10::clean_up()
{
field_dTRCapability.clean_up();
field_eMSRCapability.clean_up();
field_fastDownlinkFrequencySwitchingCapability.clean_up();
field_tIGHTER__Capability.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel10::get_descriptor() const { return &AccessCapAdditionsRel10_descr_; }
AccessCapAdditionsRel10& AccessCapAdditionsRel10::operator=(const AccessCapAdditionsRel10& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
  if (other_value.dTRCapability().is_bound()) field_dTRCapability = other_value.dTRCapability();
  else field_dTRCapability.clean_up();
  if (other_value.eMSRCapability().is_bound()) field_eMSRCapability = other_value.eMSRCapability();
  else field_eMSRCapability.clean_up();
  if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
  else field_fastDownlinkFrequencySwitchingCapability.clean_up();
  if (other_value.tIGHTER__Capability().is_bound()) field_tIGHTER__Capability = other_value.tIGHTER__Capability();
  else field_tIGHTER__Capability.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel10::operator==(const AccessCapAdditionsRel10& other_value) const
{
return field_dTRCapability==other_value.field_dTRCapability
  && field_eMSRCapability==other_value.field_eMSRCapability
  && field_fastDownlinkFrequencySwitchingCapability==other_value.field_fastDownlinkFrequencySwitchingCapability
  && field_tIGHTER__Capability==other_value.field_tIGHTER__Capability;
}

boolean AccessCapAdditionsRel10::is_bound() const
{
return (field_dTRCapability.is_bound())
  || (field_eMSRCapability.is_bound())
  || (field_fastDownlinkFrequencySwitchingCapability.is_bound())
  || (field_tIGHTER__Capability.is_bound());
}
boolean AccessCapAdditionsRel10::is_value() const
{
return field_dTRCapability.is_value()
  && field_eMSRCapability.is_value()
  && field_fastDownlinkFrequencySwitchingCapability.is_value()
  && field_tIGHTER__Capability.is_value();
}
void AccessCapAdditionsRel10::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTRCapability := ");
field_dTRCapability.log();
TTCN_Logger::log_event_str(", eMSRCapability := ");
field_eMSRCapability.log();
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
field_fastDownlinkFrequencySwitchingCapability.log();
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
field_tIGHTER__Capability.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel10::set_implicit_omit()
{
if (dTRCapability().is_bound()) dTRCapability().set_implicit_omit();
if (eMSRCapability().is_bound()) eMSRCapability().set_implicit_omit();
if (fastDownlinkFrequencySwitchingCapability().is_bound()) fastDownlinkFrequencySwitchingCapability().set_implicit_omit();
if (tIGHTER__Capability().is_bound()) tIGHTER__Capability().set_implicit_omit();
}

void AccessCapAdditionsRel10::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 has 4 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) dTRCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eMSRCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fastDownlinkFrequencySwitchingCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIGHTER__Capability().set_param(*param.get_elem(3));
    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(), "dTRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTRCapability().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(), "eMSRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSRCapability().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(), "fastDownlinkFrequencySwitchingCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fastDownlinkFrequencySwitchingCapability().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(), "tIGHTER_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIGHTER__Capability().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
  }
}

void AccessCapAdditionsRel10::encode_text(Text_Buf& text_buf) const
{
field_dTRCapability.encode_text(text_buf);
field_eMSRCapability.encode_text(text_buf);
field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf);
field_tIGHTER__Capability.encode_text(text_buf);
}

void AccessCapAdditionsRel10::decode_text(Text_Buf& text_buf)
{
field_dTRCapability.decode_text(text_buf);
field_eMSRCapability.decode_text(text_buf);
field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf);
field_tIGHTER__Capability.decode_text(text_buf);
}

void AccessCapAdditionsRel10::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel10::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel10::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel10_dTRCapability_descr_.raw->forceomit);
  decoded_field_length = field_dTRCapability.RAW_decode(AccessCapAdditionsRel10_dTRCapability_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel10_eMSRCapability_descr_.raw->forceomit);
  decoded_field_length = field_eMSRCapability.RAW_decode(AccessCapAdditionsRel10_eMSRCapability_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_.raw->forceomit);
  decoded_field_length = field_fastDownlinkFrequencySwitchingCapability.RAW_decode(AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel10_tIGHTER__Capability_descr_.raw->forceomit);
  decoded_field_length = field_tIGHTER__Capability.RAW_decode(AccessCapAdditionsRel10_tIGHTER__Capability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel10::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel10_dTRCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel10_eMSRCapability_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel10_tIGHTER__Capability_descr_.raw);
  encoded_length += field_dTRCapability.RAW_encode(AccessCapAdditionsRel10_dTRCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eMSRCapability.RAW_encode(AccessCapAdditionsRel10_eMSRCapability_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_fastDownlinkFrequencySwitchingCapability.RAW_encode(AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tIGHTER__Capability.RAW_encode(AccessCapAdditionsRel10_tIGHTER__Capability_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel10_template::single_value_struct {
BITSTRING_template field_dTRCapability;
BITSTRING_template field_eMSRCapability;
BITSTRING_template field_fastDownlinkFrequencySwitchingCapability;
BITSTRING_template field_tIGHTER__Capability;
};

void AccessCapAdditionsRel10_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_dTRCapability = ANY_VALUE;
single_value->field_eMSRCapability = ANY_VALUE;
single_value->field_fastDownlinkFrequencySwitchingCapability = ANY_VALUE;
single_value->field_tIGHTER__Capability = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel10_template::copy_value(const AccessCapAdditionsRel10& other_value)
{
single_value = new single_value_struct;
if (other_value.dTRCapability().is_bound()) {
  single_value->field_dTRCapability = other_value.dTRCapability();
} else {
  single_value->field_dTRCapability.clean_up();
}
if (other_value.eMSRCapability().is_bound()) {
  single_value->field_eMSRCapability = other_value.eMSRCapability();
} else {
  single_value->field_eMSRCapability.clean_up();
}
if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) {
  single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
} else {
  single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up();
}
if (other_value.tIGHTER__Capability().is_bound()) {
  single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability();
} else {
  single_value->field_tIGHTER__Capability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel10_template::copy_template(const AccessCapAdditionsRel10_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTRCapability().get_selection()) {
single_value->field_dTRCapability = other_value.dTRCapability();
} else {
single_value->field_dTRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eMSRCapability().get_selection()) {
single_value->field_eMSRCapability = other_value.eMSRCapability();
} else {
single_value->field_eMSRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fastDownlinkFrequencySwitchingCapability().get_selection()) {
single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
} else {
single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tIGHTER__Capability().get_selection()) {
single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability();
} else {
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_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 AccessCapAdditionsRel10_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel10_template::AccessCapAdditionsRel10_template()
{
}

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

AccessCapAdditionsRel10_template::AccessCapAdditionsRel10_template(const AccessCapAdditionsRel10& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel10_template::AccessCapAdditionsRel10_template(const OPTIONAL<AccessCapAdditionsRel10>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel10&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel10_template& AccessCapAdditionsRel10_template::operator=(const AccessCapAdditionsRel10& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel10_template& AccessCapAdditionsRel10_template::operator=(const OPTIONAL<AccessCapAdditionsRel10>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel10&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
}
return *this;
}

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

boolean AccessCapAdditionsRel10_template::match(const AccessCapAdditionsRel10& 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.dTRCapability().is_bound()) return FALSE;
if(!single_value->field_dTRCapability.match(other_value.dTRCapability(), legacy))return FALSE;
if(!other_value.eMSRCapability().is_bound()) return FALSE;
if(!single_value->field_eMSRCapability.match(other_value.eMSRCapability(), legacy))return FALSE;
if(!other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) return FALSE;
if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(other_value.fastDownlinkFrequencySwitchingCapability(), legacy))return FALSE;
if(!other_value.tIGHTER__Capability().is_bound()) return FALSE;
if(!single_value->field_tIGHTER__Capability.match(other_value.tIGHTER__Capability(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
}
return FALSE;
}

boolean AccessCapAdditionsRel10_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTRCapability.is_bound()
 || single_value->field_eMSRCapability.is_bound()
 || single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound()
 || single_value->field_tIGHTER__Capability.is_bound();
}

boolean AccessCapAdditionsRel10_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTRCapability.is_value()
 && single_value->field_eMSRCapability.is_value()
 && single_value->field_fastDownlinkFrequencySwitchingCapability.is_value()
 && single_value->field_tIGHTER__Capability.is_value();
}

void AccessCapAdditionsRel10_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;
}

AccessCapAdditionsRel10 AccessCapAdditionsRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
AccessCapAdditionsRel10 ret_val;
if (single_value->field_dTRCapability.is_bound()) {
ret_val.dTRCapability() = single_value->field_dTRCapability.valueof();
}
if (single_value->field_eMSRCapability.is_bound()) {
ret_val.eMSRCapability() = single_value->field_eMSRCapability.valueof();
}
if (single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound()) {
ret_val.fastDownlinkFrequencySwitchingCapability() = single_value->field_fastDownlinkFrequencySwitchingCapability.valueof();
}
if (single_value->field_tIGHTER__Capability.is_bound()) {
ret_val.tIGHTER__Capability() = single_value->field_tIGHTER__Capability.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel10_template[list_length];
}

AccessCapAdditionsRel10_template& AccessCapAdditionsRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel10_template::dTRCapability()
{
set_specific();
return single_value->field_dTRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::dTRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_dTRCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::eMSRCapability()
{
set_specific();
return single_value->field_eMSRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::eMSRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMSRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_eMSRCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::fastDownlinkFrequencySwitchingCapability()
{
set_specific();
return single_value->field_fastDownlinkFrequencySwitchingCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::fastDownlinkFrequencySwitchingCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fastDownlinkFrequencySwitchingCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_fastDownlinkFrequencySwitchingCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::tIGHTER__Capability()
{
set_specific();
return single_value->field_tIGHTER__Capability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::tIGHTER__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tIGHTER_Capability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_tIGHTER__Capability;
}

int AccessCapAdditionsRel10_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
  }
  return 0;
}

void AccessCapAdditionsRel10_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTRCapability := ");
single_value->field_dTRCapability.log();
TTCN_Logger::log_event_str(", eMSRCapability := ");
single_value->field_eMSRCapability.log();
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
single_value->field_fastDownlinkFrequencySwitchingCapability.log();
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_template::log_match(const AccessCapAdditionsRel10& 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_dTRCapability.match(match_value.dTRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dTRCapability");
single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eMSRCapability.match(match_value.eMSRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".eMSRCapability");
single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".fastDownlinkFrequencySwitchingCapability");
single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tIGHTER__Capability.match(match_value.tIGHTER__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".tIGHTER_Capability");
single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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("{ dTRCapability := ");
single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy);
TTCN_Logger::log_event_str(", eMSRCapability := ");
single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy);
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy);
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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 AccessCapAdditionsRel10_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTRCapability.encode_text(text_buf);
single_value->field_eMSRCapability.encode_text(text_buf);
single_value->field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf);
single_value->field_tIGHTER__Capability.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
}
}

void AccessCapAdditionsRel10_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_dTRCapability.decode_text(text_buf);
single_value->field_eMSRCapability.decode_text(text_buf);
single_value->field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf);
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
}
}

void AccessCapAdditionsRel10_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: {
    AccessCapAdditionsRel10_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10 has 4 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) dTRCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eMSRCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fastDownlinkFrequencySwitchingCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIGHTER__Capability().set_param(*param.get_elem(3));
    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(), "dTRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTRCapability().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(), "eMSRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSRCapability().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(), "fastDownlinkFrequencySwitchingCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fastDownlinkFrequencySwitchingCapability().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(), "tIGHTER_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIGHTER__Capability().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel10_template* precondition = new AccessCapAdditionsRel10_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel10_template* implied_template = new AccessCapAdditionsRel10_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel10_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel10_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_dTRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_eMSRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_fastDownlinkFrequencySwitchingCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_tIGHTER__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
}

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

boolean AccessCapAdditionsRel10_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;
}

AccessCapAdditionsRel11::AccessCapAdditionsRel11()
{
}

AccessCapAdditionsRel11::AccessCapAdditionsRel11(const BITSTRING& par_fANRCapability,
    const BITSTRING& par_iPACapability,
    const BITSTRING& par_gERANNetworkSharingSupport,
    const BITSTRING& par_eUTRAWidebandRSRQMeasurementsSupport)
  :   field_fANRCapability(par_fANRCapability),
  field_iPACapability(par_iPACapability),
  field_gERANNetworkSharingSupport(par_gERANNetworkSharingSupport),
  field_eUTRAWidebandRSRQMeasurementsSupport(par_eUTRAWidebandRSRQMeasurementsSupport)
{
}

AccessCapAdditionsRel11::AccessCapAdditionsRel11(const AccessCapAdditionsRel11& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
if (other_value.fANRCapability().is_bound()) field_fANRCapability = other_value.fANRCapability();
else field_fANRCapability.clean_up();
if (other_value.iPACapability().is_bound()) field_iPACapability = other_value.iPACapability();
else field_iPACapability.clean_up();
if (other_value.gERANNetworkSharingSupport().is_bound()) field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
else field_gERANNetworkSharingSupport.clean_up();
if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
else field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}

void AccessCapAdditionsRel11::clean_up()
{
field_fANRCapability.clean_up();
field_iPACapability.clean_up();
field_gERANNetworkSharingSupport.clean_up();
field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel11::get_descriptor() const { return &AccessCapAdditionsRel11_descr_; }
AccessCapAdditionsRel11& AccessCapAdditionsRel11::operator=(const AccessCapAdditionsRel11& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
  if (other_value.fANRCapability().is_bound()) field_fANRCapability = other_value.fANRCapability();
  else field_fANRCapability.clean_up();
  if (other_value.iPACapability().is_bound()) field_iPACapability = other_value.iPACapability();
  else field_iPACapability.clean_up();
  if (other_value.gERANNetworkSharingSupport().is_bound()) field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
  else field_gERANNetworkSharingSupport.clean_up();
  if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
  else field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel11::operator==(const AccessCapAdditionsRel11& other_value) const
{
return field_fANRCapability==other_value.field_fANRCapability
  && field_iPACapability==other_value.field_iPACapability
  && field_gERANNetworkSharingSupport==other_value.field_gERANNetworkSharingSupport
  && field_eUTRAWidebandRSRQMeasurementsSupport==other_value.field_eUTRAWidebandRSRQMeasurementsSupport;
}

boolean AccessCapAdditionsRel11::is_bound() const
{
return (field_fANRCapability.is_bound())
  || (field_iPACapability.is_bound())
  || (field_gERANNetworkSharingSupport.is_bound())
  || (field_eUTRAWidebandRSRQMeasurementsSupport.is_bound());
}
boolean AccessCapAdditionsRel11::is_value() const
{
return field_fANRCapability.is_value()
  && field_iPACapability.is_value()
  && field_gERANNetworkSharingSupport.is_value()
  && field_eUTRAWidebandRSRQMeasurementsSupport.is_value();
}
void AccessCapAdditionsRel11::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ fANRCapability := ");
field_fANRCapability.log();
TTCN_Logger::log_event_str(", iPACapability := ");
field_iPACapability.log();
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
field_gERANNetworkSharingSupport.log();
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
field_eUTRAWidebandRSRQMeasurementsSupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel11::set_implicit_omit()
{
if (fANRCapability().is_bound()) fANRCapability().set_implicit_omit();
if (iPACapability().is_bound()) iPACapability().set_implicit_omit();
if (gERANNetworkSharingSupport().is_bound()) gERANNetworkSharingSupport().set_implicit_omit();
if (eUTRAWidebandRSRQMeasurementsSupport().is_bound()) eUTRAWidebandRSRQMeasurementsSupport().set_implicit_omit();
}

void AccessCapAdditionsRel11::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 has 4 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) fANRCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iPACapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANNetworkSharingSupport().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRAWidebandRSRQMeasurementsSupport().set_param(*param.get_elem(3));
    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(), "fANRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fANRCapability().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(), "iPACapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPACapability().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(), "gERANNetworkSharingSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERANNetworkSharingSupport().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(), "eUTRAWidebandRSRQMeasurementsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAWidebandRSRQMeasurementsSupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
  }
}

void AccessCapAdditionsRel11::encode_text(Text_Buf& text_buf) const
{
field_fANRCapability.encode_text(text_buf);
field_iPACapability.encode_text(text_buf);
field_gERANNetworkSharingSupport.encode_text(text_buf);
field_eUTRAWidebandRSRQMeasurementsSupport.encode_text(text_buf);
}

void AccessCapAdditionsRel11::decode_text(Text_Buf& text_buf)
{
field_fANRCapability.decode_text(text_buf);
field_iPACapability.decode_text(text_buf);
field_gERANNetworkSharingSupport.decode_text(text_buf);
field_eUTRAWidebandRSRQMeasurementsSupport.decode_text(text_buf);
}

void AccessCapAdditionsRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel11::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel11_fANRCapability_descr_.raw->forceomit);
  decoded_field_length = field_fANRCapability.RAW_decode(AccessCapAdditionsRel11_fANRCapability_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel11_iPACapability_descr_.raw->forceomit);
  decoded_field_length = field_iPACapability.RAW_decode(AccessCapAdditionsRel11_iPACapability_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_.raw->forceomit);
  decoded_field_length = field_gERANNetworkSharingSupport.RAW_decode(AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAWidebandRSRQMeasurementsSupport.RAW_decode(AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel11::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel11_fANRCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel11_iPACapability_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw);
  encoded_length += field_fANRCapability.RAW_encode(AccessCapAdditionsRel11_fANRCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iPACapability.RAW_encode(AccessCapAdditionsRel11_iPACapability_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gERANNetworkSharingSupport.RAW_encode(AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_eUTRAWidebandRSRQMeasurementsSupport.RAW_encode(AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel11_template::single_value_struct {
BITSTRING_template field_fANRCapability;
BITSTRING_template field_iPACapability;
BITSTRING_template field_gERANNetworkSharingSupport;
BITSTRING_template field_eUTRAWidebandRSRQMeasurementsSupport;
};

void AccessCapAdditionsRel11_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_fANRCapability = ANY_VALUE;
single_value->field_iPACapability = ANY_VALUE;
single_value->field_gERANNetworkSharingSupport = ANY_VALUE;
single_value->field_eUTRAWidebandRSRQMeasurementsSupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel11_template::copy_value(const AccessCapAdditionsRel11& other_value)
{
single_value = new single_value_struct;
if (other_value.fANRCapability().is_bound()) {
  single_value->field_fANRCapability = other_value.fANRCapability();
} else {
  single_value->field_fANRCapability.clean_up();
}
if (other_value.iPACapability().is_bound()) {
  single_value->field_iPACapability = other_value.iPACapability();
} else {
  single_value->field_iPACapability.clean_up();
}
if (other_value.gERANNetworkSharingSupport().is_bound()) {
  single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
} else {
  single_value->field_gERANNetworkSharingSupport.clean_up();
}
if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) {
  single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
} else {
  single_value->field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel11_template::copy_template(const AccessCapAdditionsRel11_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.fANRCapability().get_selection()) {
single_value->field_fANRCapability = other_value.fANRCapability();
} else {
single_value->field_fANRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iPACapability().get_selection()) {
single_value->field_iPACapability = other_value.iPACapability();
} else {
single_value->field_iPACapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gERANNetworkSharingSupport().get_selection()) {
single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
} else {
single_value->field_gERANNetworkSharingSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAWidebandRSRQMeasurementsSupport().get_selection()) {
single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
} else {
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_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 AccessCapAdditionsRel11_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel11_template::AccessCapAdditionsRel11_template()
{
}

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

AccessCapAdditionsRel11_template::AccessCapAdditionsRel11_template(const AccessCapAdditionsRel11& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel11_template::AccessCapAdditionsRel11_template(const OPTIONAL<AccessCapAdditionsRel11>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel11&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel11_template& AccessCapAdditionsRel11_template::operator=(const AccessCapAdditionsRel11& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel11_template& AccessCapAdditionsRel11_template::operator=(const OPTIONAL<AccessCapAdditionsRel11>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel11&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
}
return *this;
}

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

boolean AccessCapAdditionsRel11_template::match(const AccessCapAdditionsRel11& 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.fANRCapability().is_bound()) return FALSE;
if(!single_value->field_fANRCapability.match(other_value.fANRCapability(), legacy))return FALSE;
if(!other_value.iPACapability().is_bound()) return FALSE;
if(!single_value->field_iPACapability.match(other_value.iPACapability(), legacy))return FALSE;
if(!other_value.gERANNetworkSharingSupport().is_bound()) return FALSE;
if(!single_value->field_gERANNetworkSharingSupport.match(other_value.gERANNetworkSharingSupport(), legacy))return FALSE;
if(!other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(other_value.eUTRAWidebandRSRQMeasurementsSupport(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
}
return FALSE;
}

boolean AccessCapAdditionsRel11_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_fANRCapability.is_bound()
 || single_value->field_iPACapability.is_bound()
 || single_value->field_gERANNetworkSharingSupport.is_bound()
 || single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound();
}

boolean AccessCapAdditionsRel11_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_fANRCapability.is_value()
 && single_value->field_iPACapability.is_value()
 && single_value->field_gERANNetworkSharingSupport.is_value()
 && single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_value();
}

void AccessCapAdditionsRel11_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;
}

AccessCapAdditionsRel11 AccessCapAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
AccessCapAdditionsRel11 ret_val;
if (single_value->field_fANRCapability.is_bound()) {
ret_val.fANRCapability() = single_value->field_fANRCapability.valueof();
}
if (single_value->field_iPACapability.is_bound()) {
ret_val.iPACapability() = single_value->field_iPACapability.valueof();
}
if (single_value->field_gERANNetworkSharingSupport.is_bound()) {
ret_val.gERANNetworkSharingSupport() = single_value->field_gERANNetworkSharingSupport.valueof();
}
if (single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound()) {
ret_val.eUTRAWidebandRSRQMeasurementsSupport() = single_value->field_eUTRAWidebandRSRQMeasurementsSupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel11_template[list_length];
}

AccessCapAdditionsRel11_template& AccessCapAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel11_template::fANRCapability()
{
set_specific();
return single_value->field_fANRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::fANRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fANRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_fANRCapability;
}

BITSTRING_template& AccessCapAdditionsRel11_template::iPACapability()
{
set_specific();
return single_value->field_iPACapability;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::iPACapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iPACapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_iPACapability;
}

BITSTRING_template& AccessCapAdditionsRel11_template::gERANNetworkSharingSupport()
{
set_specific();
return single_value->field_gERANNetworkSharingSupport;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::gERANNetworkSharingSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gERANNetworkSharingSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_gERANNetworkSharingSupport;
}

BITSTRING_template& AccessCapAdditionsRel11_template::eUTRAWidebandRSRQMeasurementsSupport()
{
set_specific();
return single_value->field_eUTRAWidebandRSRQMeasurementsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::eUTRAWidebandRSRQMeasurementsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAWidebandRSRQMeasurementsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_eUTRAWidebandRSRQMeasurementsSupport;
}

int AccessCapAdditionsRel11_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
  }
  return 0;
}

void AccessCapAdditionsRel11_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ fANRCapability := ");
single_value->field_fANRCapability.log();
TTCN_Logger::log_event_str(", iPACapability := ");
single_value->field_iPACapability.log();
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
single_value->field_gERANNetworkSharingSupport.log();
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_template::log_match(const AccessCapAdditionsRel11& 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_fANRCapability.match(match_value.fANRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".fANRCapability");
single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iPACapability.match(match_value.iPACapability(), legacy)){
TTCN_Logger::log_logmatch_info(".iPACapability");
single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gERANNetworkSharingSupport.match(match_value.gERANNetworkSharingSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".gERANNetworkSharingSupport");
single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAWidebandRSRQMeasurementsSupport");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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("{ fANRCapability := ");
single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy);
TTCN_Logger::log_event_str(", iPACapability := ");
single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy);
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy);
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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 AccessCapAdditionsRel11_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_fANRCapability.encode_text(text_buf);
single_value->field_iPACapability.encode_text(text_buf);
single_value->field_gERANNetworkSharingSupport.encode_text(text_buf);
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
}
}

void AccessCapAdditionsRel11_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_fANRCapability.decode_text(text_buf);
single_value->field_iPACapability.decode_text(text_buf);
single_value->field_gERANNetworkSharingSupport.decode_text(text_buf);
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
}
}

void AccessCapAdditionsRel11_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: {
    AccessCapAdditionsRel11_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11 has 4 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) fANRCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iPACapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANNetworkSharingSupport().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRAWidebandRSRQMeasurementsSupport().set_param(*param.get_elem(3));
    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(), "fANRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fANRCapability().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(), "iPACapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPACapability().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(), "gERANNetworkSharingSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERANNetworkSharingSupport().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(), "eUTRAWidebandRSRQMeasurementsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAWidebandRSRQMeasurementsSupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel11_template* precondition = new AccessCapAdditionsRel11_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel11_template* implied_template = new AccessCapAdditionsRel11_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel11_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel11_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_fANRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_iPACapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_gERANNetworkSharingSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
}

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

boolean AccessCapAdditionsRel11_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;
}

AccessCapAdditionsRel12::AccessCapAdditionsRel12()
{
}

AccessCapAdditionsRel12::AccessCapAdditionsRel12(const BITSTRING& par_uTRAMultipleFrequencyBandIndicatorsSupport,
    const BITSTRING& par_eUTRAMultipleFrequencyBandIndicatorsSupport,
    const BITSTRING& par_presenceBitDLMCCapability,
    const OPTIONAL< DLMCCapability >& par_dLMCCapability,
    const BITSTRING& par_extendedTSCSetCapabilitySupport)
  :   field_uTRAMultipleFrequencyBandIndicatorsSupport(par_uTRAMultipleFrequencyBandIndicatorsSupport),
  field_eUTRAMultipleFrequencyBandIndicatorsSupport(par_eUTRAMultipleFrequencyBandIndicatorsSupport),
  field_presenceBitDLMCCapability(par_presenceBitDLMCCapability),
  field_dLMCCapability(par_dLMCCapability),
  field_extendedTSCSetCapabilitySupport(par_extendedTSCSetCapabilitySupport)
{
}

AccessCapAdditionsRel12::AccessCapAdditionsRel12(const AccessCapAdditionsRel12& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
else field_presenceBitDLMCCapability.clean_up();
if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability();
else field_dLMCCapability.clean_up();
if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
else field_extendedTSCSetCapabilitySupport.clean_up();
}

void AccessCapAdditionsRel12::clean_up()
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
field_presenceBitDLMCCapability.clean_up();
field_dLMCCapability.clean_up();
field_extendedTSCSetCapabilitySupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel12::get_descriptor() const { return &AccessCapAdditionsRel12_descr_; }
AccessCapAdditionsRel12& AccessCapAdditionsRel12::operator=(const AccessCapAdditionsRel12& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
  if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
  else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
  if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
  else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
  if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
  else field_presenceBitDLMCCapability.clean_up();
  if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability();
  else field_dLMCCapability.clean_up();
  if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
  else field_extendedTSCSetCapabilitySupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel12::operator==(const AccessCapAdditionsRel12& other_value) const
{
return field_uTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_uTRAMultipleFrequencyBandIndicatorsSupport
  && field_eUTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_eUTRAMultipleFrequencyBandIndicatorsSupport
  && field_presenceBitDLMCCapability==other_value.field_presenceBitDLMCCapability
  && field_dLMCCapability==other_value.field_dLMCCapability
  && field_extendedTSCSetCapabilitySupport==other_value.field_extendedTSCSetCapabilitySupport;
}

boolean AccessCapAdditionsRel12::is_bound() const
{
return (field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound())
  || (field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound())
  || (field_presenceBitDLMCCapability.is_bound())
  || (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_bound())
  || (field_extendedTSCSetCapabilitySupport.is_bound());
}
boolean AccessCapAdditionsRel12::is_value() const
{
return field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value()
  && field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value()
  && field_presenceBitDLMCCapability.is_value()
  && (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_value())
  && field_extendedTSCSetCapabilitySupport.is_value();
}
int AccessCapAdditionsRel12::size_of() const
{
  int ret_val = 4;
  if (field_dLMCCapability.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel12::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
field_uTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
field_eUTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
field_presenceBitDLMCCapability.log();
TTCN_Logger::log_event_str(", dLMCCapability := ");
field_dLMCCapability.log();
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
field_extendedTSCSetCapabilitySupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel12::set_implicit_omit()
{
if (uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) uTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) eUTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (presenceBitDLMCCapability().is_bound()) presenceBitDLMCCapability().set_implicit_omit();
if (!dLMCCapability().is_bound()) dLMCCapability() = OMIT_VALUE;
else dLMCCapability().set_implicit_omit();
if (extendedTSCSetCapabilitySupport().is_bound()) extendedTSCSetCapabilitySupport().set_implicit_omit();
}

void AccessCapAdditionsRel12::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 (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 has 5 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) uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDLMCCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCCapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSetCapabilitySupport().set_param(*param.get_elem(4));
    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(), "uTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRAMultipleFrequencyBandIndicatorsSupport().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(), "eUTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAMultipleFrequencyBandIndicatorsSupport().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(), "presenceBitDLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDLMCCapability().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(), "dLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCCapability().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(), "extendedTSCSetCapabilitySupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSetCapabilitySupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
  }
}

void AccessCapAdditionsRel12::encode_text(Text_Buf& text_buf) const
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
field_presenceBitDLMCCapability.encode_text(text_buf);
field_dLMCCapability.encode_text(text_buf);
field_extendedTSCSetCapabilitySupport.encode_text(text_buf);
}

void AccessCapAdditionsRel12::decode_text(Text_Buf& text_buf)
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
field_presenceBitDLMCCapability.decode_text(text_buf);
field_dLMCCapability.decode_text(text_buf);
field_extendedTSCSetCapabilitySupport.decode_text(text_buf);
}

void AccessCapAdditionsRel12::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsRel12::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsRel12::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit);
  decoded_field_length = field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDLMCCapability.RAW_decode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  if (limit > 0 && field_presenceBitDLMCCapability ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_dLMCCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel12_dLMCCapability_descr_.raw->forceomit);
  decoded_field_length = field_dLMCCapability().RAW_decode(AccessCapAdditionsRel12_dLMCCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_dLMCCapability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dLMCCapability=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSetCapabilitySupport.RAW_decode(AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel12::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 = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_.raw);
  if (field_dLMCCapability.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel12_dLMCCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_.raw);
  encoded_length += field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_presenceBitDLMCCapability.RAW_encode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_, *myleaf.body.node.nodes[2]);
  if (field_dLMCCapability.ispresent()) {
  encoded_length += field_dLMCCapability().RAW_encode(AccessCapAdditionsRel12_dLMCCapability_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_extendedTSCSetCapabilitySupport.RAW_encode(AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_, *myleaf.body.node.nodes[4]);
  if (field_dLMCCapability.ispresent() && (field_presenceBitDLMCCapability !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel12_template::single_value_struct {
BITSTRING_template field_uTRAMultipleFrequencyBandIndicatorsSupport;
BITSTRING_template field_eUTRAMultipleFrequencyBandIndicatorsSupport;
BITSTRING_template field_presenceBitDLMCCapability;
DLMCCapability_template field_dLMCCapability;
BITSTRING_template field_extendedTSCSetCapabilitySupport;
};

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE;
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE;
single_value->field_presenceBitDLMCCapability = ANY_VALUE;
single_value->field_dLMCCapability = ANY_OR_OMIT;
single_value->field_extendedTSCSetCapabilitySupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel12_template::copy_value(const AccessCapAdditionsRel12& other_value)
{
single_value = new single_value_struct;
if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) {
  single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
} else {
  single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) {
  single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
} else {
  single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (other_value.presenceBitDLMCCapability().is_bound()) {
  single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
} else {
  single_value->field_presenceBitDLMCCapability.clean_up();
}
if (other_value.dLMCCapability().is_bound()) {
  if (other_value.dLMCCapability().ispresent()) single_value->field_dLMCCapability = other_value.dLMCCapability()();
  else single_value->field_dLMCCapability = OMIT_VALUE;
} else {
  single_value->field_dLMCCapability.clean_up();
}
if (other_value.extendedTSCSetCapabilitySupport().is_bound()) {
  single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
} else {
  single_value->field_extendedTSCSetCapabilitySupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel12_template::copy_template(const AccessCapAdditionsRel12_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.uTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) {
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
} else {
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) {
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
} else {
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDLMCCapability().get_selection()) {
single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
} else {
single_value->field_presenceBitDLMCCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCCapability().get_selection()) {
single_value->field_dLMCCapability = other_value.dLMCCapability();
} else {
single_value->field_dLMCCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSetCapabilitySupport().get_selection()) {
single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
} else {
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_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 AccessCapAdditionsRel12_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel12_template::AccessCapAdditionsRel12_template()
{
}

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

AccessCapAdditionsRel12_template::AccessCapAdditionsRel12_template(const AccessCapAdditionsRel12& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsRel12_template::AccessCapAdditionsRel12_template(const OPTIONAL<AccessCapAdditionsRel12>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel12&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsRel12_template& AccessCapAdditionsRel12_template::operator=(const AccessCapAdditionsRel12& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsRel12_template& AccessCapAdditionsRel12_template::operator=(const OPTIONAL<AccessCapAdditionsRel12>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsRel12&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
}
return *this;
}

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

boolean AccessCapAdditionsRel12_template::match(const AccessCapAdditionsRel12& 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.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE;
if(!single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE;
if(!other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE;
if(!other_value.presenceBitDLMCCapability().is_bound()) return FALSE;
if(!single_value->field_presenceBitDLMCCapability.match(other_value.presenceBitDLMCCapability(), legacy))return FALSE;
if(!other_value.dLMCCapability().is_bound()) return FALSE;
if((other_value.dLMCCapability().ispresent() ? !single_value->field_dLMCCapability.match((const DLMCCapability&)other_value.dLMCCapability(), legacy) : !single_value->field_dLMCCapability.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSetCapabilitySupport().is_bound()) return FALSE;
if(!single_value->field_extendedTSCSetCapabilitySupport.match(other_value.extendedTSCSetCapabilitySupport(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
}
return FALSE;
}

boolean AccessCapAdditionsRel12_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()
 || single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()
 || single_value->field_presenceBitDLMCCapability.is_bound()
 || (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_bound())
 || single_value->field_extendedTSCSetCapabilitySupport.is_bound();
}

boolean AccessCapAdditionsRel12_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value()
 && single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value()
 && single_value->field_presenceBitDLMCCapability.is_value()
 && (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_value())
 && single_value->field_extendedTSCSetCapabilitySupport.is_value();
}

void AccessCapAdditionsRel12_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;
}

AccessCapAdditionsRel12 AccessCapAdditionsRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
AccessCapAdditionsRel12 ret_val;
if (single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) {
ret_val.uTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.valueof();
}
if (single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) {
ret_val.eUTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.valueof();
}
if (single_value->field_presenceBitDLMCCapability.is_bound()) {
ret_val.presenceBitDLMCCapability() = single_value->field_presenceBitDLMCCapability.valueof();
}
if (single_value->field_dLMCCapability.is_omit()) ret_val.dLMCCapability() = OMIT_VALUE;
else if (single_value->field_dLMCCapability.is_bound()) {
ret_val.dLMCCapability() = single_value->field_dLMCCapability.valueof();
}
if (single_value->field_extendedTSCSetCapabilitySupport.is_bound()) {
ret_val.extendedTSCSetCapabilitySupport() = single_value->field_extendedTSCSetCapabilitySupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel12_template[list_length];
}

AccessCapAdditionsRel12_template& AccessCapAdditionsRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel12_template::uTRAMultipleFrequencyBandIndicatorsSupport()
{
set_specific();
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::uTRAMultipleFrequencyBandIndicatorsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport;
}

BITSTRING_template& AccessCapAdditionsRel12_template::eUTRAMultipleFrequencyBandIndicatorsSupport()
{
set_specific();
return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::eUTRAMultipleFrequencyBandIndicatorsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport;
}

BITSTRING_template& AccessCapAdditionsRel12_template::presenceBitDLMCCapability()
{
set_specific();
return single_value->field_presenceBitDLMCCapability;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::presenceBitDLMCCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDLMCCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_presenceBitDLMCCapability;
}

DLMCCapability_template& AccessCapAdditionsRel12_template::dLMCCapability()
{
set_specific();
return single_value->field_dLMCCapability;
}

const DLMCCapability_template& AccessCapAdditionsRel12_template::dLMCCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_dLMCCapability;
}

BITSTRING_template& AccessCapAdditionsRel12_template::extendedTSCSetCapabilitySupport()
{
set_specific();
return single_value->field_extendedTSCSetCapabilitySupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::extendedTSCSetCapabilitySupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSetCapabilitySupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_extendedTSCSetCapabilitySupport;
}

int AccessCapAdditionsRel12_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_dLMCCapability.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
  }
  return 0;
}

void AccessCapAdditionsRel12_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
single_value->field_presenceBitDLMCCapability.log();
TTCN_Logger::log_event_str(", dLMCCapability := ");
single_value->field_dLMCCapability.log();
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_template::log_match(const AccessCapAdditionsRel12& 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_uTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRAMultipleFrequencyBandIndicatorsSupport");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAMultipleFrequencyBandIndicatorsSupport");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDLMCCapability.match(match_value.presenceBitDLMCCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDLMCCapability");
single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dLMCCapability().ispresent()){
if(!single_value->field_dLMCCapability.match(match_value.dLMCCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCCapability");
single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dLMCCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dLMCCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dLMCCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_extendedTSCSetCapabilitySupport.match(match_value.extendedTSCSetCapabilitySupport(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSetCapabilitySupport");
single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy);
TTCN_Logger::log_event_str(", dLMCCapability := ");
if (match_value.dLMCCapability().ispresent()) {
single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dLMCCapability.log();
if (single_value->field_dLMCCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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 AccessCapAdditionsRel12_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
single_value->field_presenceBitDLMCCapability.encode_text(text_buf);
single_value->field_dLMCCapability.encode_text(text_buf);
single_value->field_extendedTSCSetCapabilitySupport.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
}
}

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
single_value->field_presenceBitDLMCCapability.decode_text(text_buf);
single_value->field_dLMCCapability.decode_text(text_buf);
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
}
}

void AccessCapAdditionsRel12_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: {
    AccessCapAdditionsRel12_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 (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12 has 5 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) uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDLMCCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCCapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSetCapabilitySupport().set_param(*param.get_elem(4));
    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(), "uTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRAMultipleFrequencyBandIndicatorsSupport().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(), "eUTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAMultipleFrequencyBandIndicatorsSupport().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(), "presenceBitDLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDLMCCapability().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(), "dLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCCapability().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(), "extendedTSCSetCapabilitySupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSetCapabilitySupport().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel12_template* precondition = new AccessCapAdditionsRel12_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel12_template* implied_template = new AccessCapAdditionsRel12_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel12_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_presenceBitDLMCCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_dLMCCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_extendedTSCSetCapabilitySupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
}

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

boolean AccessCapAdditionsRel12_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;
}

DLMCCapability::DLMCCapability()
{
}

DLMCCapability::DLMCCapability(const BITSTRING& par_presenceDLMC,
    const OPTIONAL< DLMCBandReception >& par_dLMCBandReception,
    const BITSTRING& par_dLMCMaxBandwidth,
    const BITSTRING& par_dLMCMaxNumOfDownlinkTimeslots,
    const BITSTRING& par_dLMCMaxNumOfDownlinkCarriers)
  :   field_presenceDLMC(par_presenceDLMC),
  field_dLMCBandReception(par_dLMCBandReception),
  field_dLMCMaxBandwidth(par_dLMCMaxBandwidth),
  field_dLMCMaxNumOfDownlinkTimeslots(par_dLMCMaxNumOfDownlinkTimeslots),
  field_dLMCMaxNumOfDownlinkCarriers(par_dLMCMaxNumOfDownlinkCarriers)
{
}

DLMCCapability::DLMCCapability(const DLMCCapability& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DLMCCapability.");
if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC();
else field_presenceDLMC.clean_up();
if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception();
else field_dLMCBandReception.clean_up();
if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
else field_dLMCMaxBandwidth.clean_up();
if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
else field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
else field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}

void DLMCCapability::clean_up()
{
field_presenceDLMC.clean_up();
field_dLMCBandReception.clean_up();
field_dLMCMaxBandwidth.clean_up();
field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}

const TTCN_Typedescriptor_t* DLMCCapability::get_descriptor() const { return &DLMCCapability_descr_; }
DLMCCapability& DLMCCapability::operator=(const DLMCCapability& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DLMCCapability.");
  if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC();
  else field_presenceDLMC.clean_up();
  if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception();
  else field_dLMCBandReception.clean_up();
  if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
  else field_dLMCMaxBandwidth.clean_up();
  if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
  else field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
  if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
  else field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}
return *this;
}

boolean DLMCCapability::operator==(const DLMCCapability& other_value) const
{
return field_presenceDLMC==other_value.field_presenceDLMC
  && field_dLMCBandReception==other_value.field_dLMCBandReception
  && field_dLMCMaxBandwidth==other_value.field_dLMCMaxBandwidth
  && field_dLMCMaxNumOfDownlinkTimeslots==other_value.field_dLMCMaxNumOfDownlinkTimeslots
  && field_dLMCMaxNumOfDownlinkCarriers==other_value.field_dLMCMaxNumOfDownlinkCarriers;
}

boolean DLMCCapability::is_bound() const
{
return (field_presenceDLMC.is_bound())
  || (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_bound())
  || (field_dLMCMaxBandwidth.is_bound())
  || (field_dLMCMaxNumOfDownlinkTimeslots.is_bound())
  || (field_dLMCMaxNumOfDownlinkCarriers.is_bound());
}
boolean DLMCCapability::is_value() const
{
return field_presenceDLMC.is_value()
  && (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_value())
  && field_dLMCMaxBandwidth.is_value()
  && field_dLMCMaxNumOfDownlinkTimeslots.is_value()
  && field_dLMCMaxNumOfDownlinkCarriers.is_value();
}
int DLMCCapability::size_of() const
{
  int ret_val = 4;
  if (field_dLMCBandReception.ispresent()) ret_val++;
  return ret_val;
}

void DLMCCapability::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceDLMC := ");
field_presenceDLMC.log();
TTCN_Logger::log_event_str(", dLMCBandReception := ");
field_dLMCBandReception.log();
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
field_dLMCMaxBandwidth.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
field_dLMCMaxNumOfDownlinkTimeslots.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
field_dLMCMaxNumOfDownlinkCarriers.log();
TTCN_Logger::log_event_str(" }");
}

void DLMCCapability::set_implicit_omit()
{
if (presenceDLMC().is_bound()) presenceDLMC().set_implicit_omit();
if (!dLMCBandReception().is_bound()) dLMCBandReception() = OMIT_VALUE;
else dLMCBandReception().set_implicit_omit();
if (dLMCMaxBandwidth().is_bound()) dLMCMaxBandwidth().set_implicit_omit();
if (dLMCMaxNumOfDownlinkTimeslots().is_bound()) dLMCMaxNumOfDownlinkTimeslots().set_implicit_omit();
if (dLMCMaxNumOfDownlinkCarriers().is_bound()) dLMCMaxNumOfDownlinkCarriers().set_implicit_omit();
}

void DLMCCapability::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 (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.DLMCCapability has 5 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) presenceDLMC().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCBandReception().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxBandwidth().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkTimeslots().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkCarriers().set_param(*param.get_elem(4));
    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(), "presenceDLMC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceDLMC().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(), "dLMCBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCBandReception().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(), "dLMCMaxBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxBandwidth().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(), "dLMCMaxNumOfDownlinkTimeslots")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkTimeslots().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(), "dLMCMaxNumOfDownlinkCarriers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkCarriers().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 @MobileL3_GMM_SM_Types.DLMCCapability: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.DLMCCapability");
  }
}

void DLMCCapability::encode_text(Text_Buf& text_buf) const
{
field_presenceDLMC.encode_text(text_buf);
field_dLMCBandReception.encode_text(text_buf);
field_dLMCMaxBandwidth.encode_text(text_buf);
field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf);
field_dLMCMaxNumOfDownlinkCarriers.encode_text(text_buf);
}

void DLMCCapability::decode_text(Text_Buf& text_buf)
{
field_presenceDLMC.decode_text(text_buf);
field_dLMCBandReception.decode_text(text_buf);
field_dLMCMaxBandwidth.decode_text(text_buf);
field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf);
field_dLMCMaxNumOfDownlinkCarriers.decode_text(text_buf);
}

void DLMCCapability::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DLMCCapability::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DLMCCapability::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, DLMCCapability_presenceDLMC_descr_.raw->forceomit);
  decoded_field_length = field_presenceDLMC.RAW_decode(DLMCCapability_presenceDLMC_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());
  if (limit > 0 && field_presenceDLMC ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_dLMCBandReception = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, DLMCCapability_dLMCBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCBandReception().RAW_decode(DLMCCapability_dLMCBandReception_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_dLMCBandReception = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dLMCBandReception=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, DLMCCapability_dLMCMaxBandwidth_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxBandwidth.RAW_decode(DLMCCapability_dLMCMaxBandwidth_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxNumOfDownlinkTimeslots.RAW_decode(DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxNumOfDownlinkCarriers.RAW_decode(DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DLMCCapability::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 = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DLMCCapability_presenceDLMC_descr_.raw);
  if (field_dLMCBandReception.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCCapability_dLMCBandReception_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DLMCCapability_dLMCMaxBandwidth_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_.raw);
  encoded_length += field_presenceDLMC.RAW_encode(DLMCCapability_presenceDLMC_descr_, *myleaf.body.node.nodes[0]);
  if (field_dLMCBandReception.ispresent()) {
  encoded_length += field_dLMCBandReception().RAW_encode(DLMCCapability_dLMCBandReception_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_dLMCMaxBandwidth.RAW_encode(DLMCCapability_dLMCMaxBandwidth_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dLMCMaxNumOfDownlinkTimeslots.RAW_encode(DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_dLMCMaxNumOfDownlinkCarriers.RAW_encode(DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_, *myleaf.body.node.nodes[4]);
  if (field_dLMCBandReception.ispresent() && (field_presenceDLMC !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(DLMCCapability_presenceDLMC_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct DLMCCapability_template::single_value_struct {
BITSTRING_template field_presenceDLMC;
DLMCBandReception_template field_dLMCBandReception;
BITSTRING_template field_dLMCMaxBandwidth;
BITSTRING_template field_dLMCMaxNumOfDownlinkTimeslots;
BITSTRING_template field_dLMCMaxNumOfDownlinkCarriers;
};

void DLMCCapability_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_presenceDLMC = ANY_VALUE;
single_value->field_dLMCBandReception = ANY_OR_OMIT;
single_value->field_dLMCMaxBandwidth = ANY_VALUE;
single_value->field_dLMCMaxNumOfDownlinkTimeslots = ANY_VALUE;
single_value->field_dLMCMaxNumOfDownlinkCarriers = ANY_VALUE;
}
}
}

void DLMCCapability_template::copy_value(const DLMCCapability& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceDLMC().is_bound()) {
  single_value->field_presenceDLMC = other_value.presenceDLMC();
} else {
  single_value->field_presenceDLMC.clean_up();
}
if (other_value.dLMCBandReception().is_bound()) {
  if (other_value.dLMCBandReception().ispresent()) single_value->field_dLMCBandReception = other_value.dLMCBandReception()();
  else single_value->field_dLMCBandReception = OMIT_VALUE;
} else {
  single_value->field_dLMCBandReception.clean_up();
}
if (other_value.dLMCMaxBandwidth().is_bound()) {
  single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
} else {
  single_value->field_dLMCMaxBandwidth.clean_up();
}
if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) {
  single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
} else {
  single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
}
if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) {
  single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
} else {
  single_value->field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DLMCCapability_template::copy_template(const DLMCCapability_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceDLMC().get_selection()) {
single_value->field_presenceDLMC = other_value.presenceDLMC();
} else {
single_value->field_presenceDLMC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCBandReception().get_selection()) {
single_value->field_dLMCBandReception = other_value.dLMCBandReception();
} else {
single_value->field_dLMCBandReception.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxBandwidth().get_selection()) {
single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
} else {
single_value->field_dLMCMaxBandwidth.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkTimeslots().get_selection()) {
single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
} else {
single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkCarriers().get_selection()) {
single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
} else {
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_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 DLMCCapability_template(*other_value.implication_.precondition);
implication_.implied_template = new DLMCCapability_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 @MobileL3_GMM_SM_Types.DLMCCapability.");
break;
}
set_selection(other_value);
}

DLMCCapability_template::DLMCCapability_template()
{
}

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

DLMCCapability_template::DLMCCapability_template(const DLMCCapability& other_value)
{
copy_value(other_value);
}

DLMCCapability_template::DLMCCapability_template(const OPTIONAL<DLMCCapability>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DLMCCapability&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.DLMCCapability from an unbound optional field.");
}
}

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

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

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

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

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

DLMCCapability_template& DLMCCapability_template::operator=(const DLMCCapability& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

DLMCCapability_template& DLMCCapability_template::operator=(const OPTIONAL<DLMCCapability>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DLMCCapability&)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 @MobileL3_GMM_SM_Types.DLMCCapability.");
}
return *this;
}

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

boolean DLMCCapability_template::match(const DLMCCapability& 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.presenceDLMC().is_bound()) return FALSE;
if(!single_value->field_presenceDLMC.match(other_value.presenceDLMC(), legacy))return FALSE;
if(!other_value.dLMCBandReception().is_bound()) return FALSE;
if((other_value.dLMCBandReception().ispresent() ? !single_value->field_dLMCBandReception.match((const DLMCBandReception&)other_value.dLMCBandReception(), legacy) : !single_value->field_dLMCBandReception.match_omit(legacy)))return FALSE;
if(!other_value.dLMCMaxBandwidth().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxBandwidth.match(other_value.dLMCMaxBandwidth(), legacy))return FALSE;
if(!other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(other_value.dLMCMaxNumOfDownlinkTimeslots(), legacy))return FALSE;
if(!other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(other_value.dLMCMaxNumOfDownlinkCarriers(), 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 @MobileL3_GMM_SM_Types.DLMCCapability.");
}
return FALSE;
}

boolean DLMCCapability_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceDLMC.is_bound()
 || (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_bound())
 || single_value->field_dLMCMaxBandwidth.is_bound()
 || single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound()
 || single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound();
}

boolean DLMCCapability_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceDLMC.is_value()
 && (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_value())
 && single_value->field_dLMCMaxBandwidth.is_value()
 && single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_value()
 && single_value->field_dLMCMaxNumOfDownlinkCarriers.is_value();
}

void DLMCCapability_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;
}

DLMCCapability DLMCCapability_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 @MobileL3_GMM_SM_Types.DLMCCapability.");
DLMCCapability ret_val;
if (single_value->field_presenceDLMC.is_bound()) {
ret_val.presenceDLMC() = single_value->field_presenceDLMC.valueof();
}
if (single_value->field_dLMCBandReception.is_omit()) ret_val.dLMCBandReception() = OMIT_VALUE;
else if (single_value->field_dLMCBandReception.is_bound()) {
ret_val.dLMCBandReception() = single_value->field_dLMCBandReception.valueof();
}
if (single_value->field_dLMCMaxBandwidth.is_bound()) {
ret_val.dLMCMaxBandwidth() = single_value->field_dLMCMaxBandwidth.valueof();
}
if (single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound()) {
ret_val.dLMCMaxNumOfDownlinkTimeslots() = single_value->field_dLMCMaxNumOfDownlinkTimeslots.valueof();
}
if (single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound()) {
ret_val.dLMCMaxNumOfDownlinkCarriers() = single_value->field_dLMCMaxNumOfDownlinkCarriers.valueof();
}
return ret_val;
}

void DLMCCapability_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 @MobileL3_GMM_SM_Types.DLMCCapability.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DLMCCapability_template[list_length];
}

DLMCCapability_template& DLMCCapability_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 @MobileL3_GMM_SM_Types.DLMCCapability.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return value_list.list_value[list_index];
}

BITSTRING_template& DLMCCapability_template::presenceDLMC()
{
set_specific();
return single_value->field_presenceDLMC;
}

const BITSTRING_template& DLMCCapability_template::presenceDLMC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceDLMC of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_presenceDLMC;
}

DLMCBandReception_template& DLMCCapability_template::dLMCBandReception()
{
set_specific();
return single_value->field_dLMCBandReception;
}

const DLMCBandReception_template& DLMCCapability_template::dLMCBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCBandReception;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxBandwidth()
{
set_specific();
return single_value->field_dLMCMaxBandwidth;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxBandwidth() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxBandwidth of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxBandwidth;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkTimeslots()
{
set_specific();
return single_value->field_dLMCMaxNumOfDownlinkTimeslots;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkTimeslots() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxNumOfDownlinkTimeslots of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxNumOfDownlinkTimeslots;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkCarriers()
{
set_specific();
return single_value->field_dLMCMaxNumOfDownlinkCarriers;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkCarriers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxNumOfDownlinkCarriers of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxNumOfDownlinkCarriers;
}

int DLMCCapability_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_dLMCBandReception.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability 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 @MobileL3_GMM_SM_Types.DLMCCapability containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCCapability containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
  }
  return 0;
}

void DLMCCapability_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceDLMC := ");
single_value->field_presenceDLMC.log();
TTCN_Logger::log_event_str(", dLMCBandReception := ");
single_value->field_dLMCBandReception.log();
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
single_value->field_dLMCMaxBandwidth.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_template::log_match(const DLMCCapability& 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_presenceDLMC.match(match_value.presenceDLMC(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceDLMC");
single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dLMCBandReception().ispresent()){
if(!single_value->field_dLMCBandReception.match(match_value.dLMCBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCBandReception");
single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dLMCBandReception.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dLMCBandReception := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dLMCBandReception.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_dLMCMaxBandwidth.match(match_value.dLMCMaxBandwidth(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxBandwidth");
single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkTimeslots");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(match_value.dLMCMaxNumOfDownlinkCarriers(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkCarriers");
single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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("{ presenceDLMC := ");
single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy);
TTCN_Logger::log_event_str(", dLMCBandReception := ");
if (match_value.dLMCBandReception().ispresent()) {
single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dLMCBandReception.log();
if (single_value->field_dLMCBandReception.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy);
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy);
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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 DLMCCapability_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceDLMC.encode_text(text_buf);
single_value->field_dLMCBandReception.encode_text(text_buf);
single_value->field_dLMCMaxBandwidth.encode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 @MobileL3_GMM_SM_Types.DLMCCapability.");
}
}

void DLMCCapability_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_presenceDLMC.decode_text(text_buf);
single_value->field_dLMCBandReception.decode_text(text_buf);
single_value->field_dLMCMaxBandwidth.decode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_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 @MobileL3_GMM_SM_Types.DLMCCapability.");
}
}

void DLMCCapability_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: {
    DLMCCapability_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 (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.DLMCCapability has 5 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) presenceDLMC().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCBandReception().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxBandwidth().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkTimeslots().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkCarriers().set_param(*param.get_elem(4));
    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(), "presenceDLMC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceDLMC().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(), "dLMCBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCBandReception().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(), "dLMCMaxBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxBandwidth().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(), "dLMCMaxNumOfDownlinkTimeslots")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkTimeslots().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(), "dLMCMaxNumOfDownlinkCarriers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkCarriers().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 @MobileL3_GMM_SM_Types.DLMCCapability: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DLMCCapability_template* precondition = new DLMCCapability_template;
    precondition->set_param(*param.get_elem(0));
    DLMCCapability_template* implied_template = new DLMCCapability_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DLMCCapability_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.DLMCCapability");
  }
  is_ifpresent = param.get_ifpresent();
}

void DLMCCapability_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_presenceDLMC.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxBandwidth.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxNumOfDownlinkCarriers.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
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 : "@MobileL3_GMM_SM_Types.DLMCCapability");
}

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

boolean DLMCCapability_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;
}

DLMCBandReception::DLMCBandReception()
{
}

DLMCBandReception::DLMCBandReception(const BITSTRING& par_dLMCNonContiguousIntraBandReception,
    const BITSTRING& par_dLMCInterBandReception)
  :   field_dLMCNonContiguousIntraBandReception(par_dLMCNonContiguousIntraBandReception),
  field_dLMCInterBandReception(par_dLMCInterBandReception)
{
}

DLMCBandReception::DLMCBandReception(const DLMCBandReception& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
else field_dLMCNonContiguousIntraBandReception.clean_up();
if (other_value.dLMCInterBandReception().is_bound()) field_dLMCInterBandReception = other_value.dLMCInterBandReception();
else field_dLMCInterBandReception.clean_up();
}

void DLMCBandReception::clean_up()
{
field_dLMCNonContiguousIntraBandReception.clean_up();
field_dLMCInterBandReception.clean_up();
}

const TTCN_Typedescriptor_t* DLMCBandReception::get_descriptor() const { return &DLMCBandReception_descr_; }
DLMCBandReception& DLMCBandReception::operator=(const DLMCBandReception& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
  if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
  else field_dLMCNonContiguousIntraBandReception.clean_up();
  if (other_value.dLMCInterBandReception().is_bound()) field_dLMCInterBandReception = other_value.dLMCInterBandReception();
  else field_dLMCInterBandReception.clean_up();
}
return *this;
}

boolean DLMCBandReception::operator==(const DLMCBandReception& other_value) const
{
return field_dLMCNonContiguousIntraBandReception==other_value.field_dLMCNonContiguousIntraBandReception
  && field_dLMCInterBandReception==other_value.field_dLMCInterBandReception;
}

boolean DLMCBandReception::is_bound() const
{
return (field_dLMCNonContiguousIntraBandReception.is_bound())
  || (field_dLMCInterBandReception.is_bound());
}
boolean DLMCBandReception::is_value() const
{
return field_dLMCNonContiguousIntraBandReception.is_value()
  && field_dLMCInterBandReception.is_value();
}
void DLMCBandReception::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dLMCNonContiguousIntraBandReception := ");
field_dLMCNonContiguousIntraBandReception.log();
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
field_dLMCInterBandReception.log();
TTCN_Logger::log_event_str(" }");
}

void DLMCBandReception::set_implicit_omit()
{
if (dLMCNonContiguousIntraBandReception().is_bound()) dLMCNonContiguousIntraBandReception().set_implicit_omit();
if (dLMCInterBandReception().is_bound()) dLMCInterBandReception().set_implicit_omit();
}

void DLMCBandReception::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 @MobileL3_GMM_SM_Types.DLMCBandReception 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) dLMCNonContiguousIntraBandReception().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCInterBandReception().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(), "dLMCNonContiguousIntraBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCNonContiguousIntraBandReception().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(), "dLMCInterBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCInterBandReception().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 @MobileL3_GMM_SM_Types.DLMCBandReception: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.DLMCBandReception");
  }
}

void DLMCBandReception::encode_text(Text_Buf& text_buf) const
{
field_dLMCNonContiguousIntraBandReception.encode_text(text_buf);
field_dLMCInterBandReception.encode_text(text_buf);
}

void DLMCBandReception::decode_text(Text_Buf& text_buf)
{
field_dLMCNonContiguousIntraBandReception.decode_text(text_buf);
field_dLMCInterBandReception.decode_text(text_buf);
}

void DLMCBandReception::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DLMCBandReception::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DLMCBandReception::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCNonContiguousIntraBandReception.RAW_decode(DLMCBandReception_dLMCNonContiguousIntraBandReception_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, DLMCBandReception_dLMCInterBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCInterBandReception.RAW_decode(DLMCBandReception_dLMCInterBandReception_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DLMCBandReception::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, DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCBandReception_dLMCInterBandReception_descr_.raw);
  encoded_length += field_dLMCNonContiguousIntraBandReception.RAW_encode(DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_dLMCInterBandReception.RAW_encode(DLMCBandReception_dLMCInterBandReception_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DLMCBandReception_template::single_value_struct {
BITSTRING_template field_dLMCNonContiguousIntraBandReception;
BITSTRING_template field_dLMCInterBandReception;
};

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception = ANY_VALUE;
single_value->field_dLMCInterBandReception = ANY_VALUE;
}
}
}

void DLMCBandReception_template::copy_value(const DLMCBandReception& other_value)
{
single_value = new single_value_struct;
if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) {
  single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
} else {
  single_value->field_dLMCNonContiguousIntraBandReception.clean_up();
}
if (other_value.dLMCInterBandReception().is_bound()) {
  single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception();
} else {
  single_value->field_dLMCInterBandReception.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DLMCBandReception_template::copy_template(const DLMCBandReception_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dLMCNonContiguousIntraBandReception().get_selection()) {
single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
} else {
single_value->field_dLMCNonContiguousIntraBandReception.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCInterBandReception().get_selection()) {
single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception();
} else {
single_value->field_dLMCInterBandReception.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 DLMCBandReception_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 DLMCBandReception_template(*other_value.implication_.precondition);
implication_.implied_template = new DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
break;
}
set_selection(other_value);
}

DLMCBandReception_template::DLMCBandReception_template()
{
}

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

DLMCBandReception_template::DLMCBandReception_template(const DLMCBandReception& other_value)
{
copy_value(other_value);
}

DLMCBandReception_template::DLMCBandReception_template(const OPTIONAL<DLMCBandReception>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DLMCBandReception&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.DLMCBandReception from an unbound optional field.");
}
}

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

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

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

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

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

DLMCBandReception_template& DLMCBandReception_template::operator=(const DLMCBandReception& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

DLMCBandReception_template& DLMCBandReception_template::operator=(const OPTIONAL<DLMCBandReception>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DLMCBandReception&)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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
}
return *this;
}

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

boolean DLMCBandReception_template::match(const DLMCBandReception& 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.dLMCNonContiguousIntraBandReception().is_bound()) return FALSE;
if(!single_value->field_dLMCNonContiguousIntraBandReception.match(other_value.dLMCNonContiguousIntraBandReception(), legacy))return FALSE;
if(!other_value.dLMCInterBandReception().is_bound()) return FALSE;
if(!single_value->field_dLMCInterBandReception.match(other_value.dLMCInterBandReception(), 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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
}
return FALSE;
}

boolean DLMCBandReception_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dLMCNonContiguousIntraBandReception.is_bound()
 || single_value->field_dLMCInterBandReception.is_bound();
}

boolean DLMCBandReception_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dLMCNonContiguousIntraBandReception.is_value()
 && single_value->field_dLMCInterBandReception.is_value();
}

void DLMCBandReception_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;
}

DLMCBandReception DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
DLMCBandReception ret_val;
if (single_value->field_dLMCNonContiguousIntraBandReception.is_bound()) {
ret_val.dLMCNonContiguousIntraBandReception() = single_value->field_dLMCNonContiguousIntraBandReception.valueof();
}
if (single_value->field_dLMCInterBandReception.is_bound()) {
ret_val.dLMCInterBandReception() = single_value->field_dLMCInterBandReception.valueof();
}
return ret_val;
}

void DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DLMCBandReception_template[list_length];
}

DLMCBandReception_template& DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return value_list.list_value[list_index];
}

BITSTRING_template& DLMCBandReception_template::dLMCNonContiguousIntraBandReception()
{
set_specific();
return single_value->field_dLMCNonContiguousIntraBandReception;
}

const BITSTRING_template& DLMCBandReception_template::dLMCNonContiguousIntraBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCNonContiguousIntraBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return single_value->field_dLMCNonContiguousIntraBandReception;
}

BITSTRING_template& DLMCBandReception_template::dLMCInterBandReception()
{
set_specific();
return single_value->field_dLMCInterBandReception;
}

const BITSTRING_template& DLMCBandReception_template::dLMCInterBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCInterBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return single_value->field_dLMCInterBandReception;
}

int DLMCBandReception_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception 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 @MobileL3_GMM_SM_Types.DLMCBandReception 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 @MobileL3_GMM_SM_Types.DLMCBandReception containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.DLMCBandReception containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
  }
  return 0;
}

void DLMCBandReception_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dLMCNonContiguousIntraBandReception := ");
single_value->field_dLMCNonContiguousIntraBandReception.log();
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
single_value->field_dLMCInterBandReception.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 DLMCBandReception_template::log_match(const DLMCBandReception& 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_dLMCNonContiguousIntraBandReception.match(match_value.dLMCNonContiguousIntraBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCNonContiguousIntraBandReception");
single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCInterBandReception.match(match_value.dLMCInterBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCInterBandReception");
single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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("{ dLMCNonContiguousIntraBandReception := ");
single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy);
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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 DLMCBandReception_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dLMCNonContiguousIntraBandReception.encode_text(text_buf);
single_value->field_dLMCInterBandReception.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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
}
}

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception.decode_text(text_buf);
single_value->field_dLMCInterBandReception.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 DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception.");
}
}

void DLMCBandReception_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: {
    DLMCBandReception_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 @MobileL3_GMM_SM_Types.DLMCBandReception 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) dLMCNonContiguousIntraBandReception().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCInterBandReception().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(), "dLMCNonContiguousIntraBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCNonContiguousIntraBandReception().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(), "dLMCInterBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCInterBandReception().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 @MobileL3_GMM_SM_Types.DLMCBandReception: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DLMCBandReception_template* precondition = new DLMCBandReception_template;
    precondition->set_param(*param.get_elem(0));
    DLMCBandReception_template* implied_template = new DLMCBandReception_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DLMCBandReception_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.DLMCBandReception");
  }
  is_ifpresent = param.get_ifpresent();
}

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCBandReception");
single_value->field_dLMCInterBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCBandReception");
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 : "@MobileL3_GMM_SM_Types.DLMCBandReception");
}

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

boolean DLMCBandReception_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;
}

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11()
{
}

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11(const BITSTRING& par_extendedEARFCNValueRange)
  :   field_extendedEARFCNValueRange(par_extendedEARFCNValueRange)
{
}

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11(const AccessCapLateAdditionsRel11& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
if (other_value.extendedEARFCNValueRange().is_bound()) field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
else field_extendedEARFCNValueRange.clean_up();
}

void AccessCapLateAdditionsRel11::clean_up()
{
field_extendedEARFCNValueRange.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapLateAdditionsRel11::get_descriptor() const { return &AccessCapLateAdditionsRel11_descr_; }
AccessCapLateAdditionsRel11& AccessCapLateAdditionsRel11::operator=(const AccessCapLateAdditionsRel11& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
  if (other_value.extendedEARFCNValueRange().is_bound()) field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
  else field_extendedEARFCNValueRange.clean_up();
}
return *this;
}

boolean AccessCapLateAdditionsRel11::operator==(const AccessCapLateAdditionsRel11& other_value) const
{
return field_extendedEARFCNValueRange==other_value.field_extendedEARFCNValueRange;
}

boolean AccessCapLateAdditionsRel11::is_bound() const
{
return (field_extendedEARFCNValueRange.is_bound());
}
boolean AccessCapLateAdditionsRel11::is_value() const
{
return field_extendedEARFCNValueRange.is_value();
}
void AccessCapLateAdditionsRel11::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extendedEARFCNValueRange := ");
field_extendedEARFCNValueRange.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapLateAdditionsRel11::set_implicit_omit()
{
if (extendedEARFCNValueRange().is_bound()) extendedEARFCNValueRange().set_implicit_omit();
}

void AccessCapLateAdditionsRel11::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 has 1 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) extendedEARFCNValueRange().set_param(*param.get_elem(0));
    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(), "extendedEARFCNValueRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedEARFCNValueRange().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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11");
  }
}

void AccessCapLateAdditionsRel11::encode_text(Text_Buf& text_buf) const
{
field_extendedEARFCNValueRange.encode_text(text_buf);
}

void AccessCapLateAdditionsRel11::decode_text(Text_Buf& text_buf)
{
field_extendedEARFCNValueRange.decode_text(text_buf);
}

void AccessCapLateAdditionsRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapLateAdditionsRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapLateAdditionsRel11::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_extendedEARFCNValueRange.RAW_decode(General__Types::BIT1_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapLateAdditionsRel11::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  encoded_length += field_extendedEARFCNValueRange.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct AccessCapLateAdditionsRel11_template::single_value_struct {
BITSTRING_template field_extendedEARFCNValueRange;
};

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange = ANY_VALUE;
}
}
}

void AccessCapLateAdditionsRel11_template::copy_value(const AccessCapLateAdditionsRel11& other_value)
{
single_value = new single_value_struct;
if (other_value.extendedEARFCNValueRange().is_bound()) {
  single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
} else {
  single_value->field_extendedEARFCNValueRange.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapLateAdditionsRel11_template::copy_template(const AccessCapLateAdditionsRel11_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extendedEARFCNValueRange().get_selection()) {
single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
} else {
single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_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 AccessCapLateAdditionsRel11_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapLateAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
break;
}
set_selection(other_value);
}

AccessCapLateAdditionsRel11_template::AccessCapLateAdditionsRel11_template()
{
}

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

AccessCapLateAdditionsRel11_template::AccessCapLateAdditionsRel11_template(const AccessCapLateAdditionsRel11& other_value)
{
copy_value(other_value);
}

AccessCapLateAdditionsRel11_template::AccessCapLateAdditionsRel11_template(const OPTIONAL<AccessCapLateAdditionsRel11>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapLateAdditionsRel11&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapLateAdditionsRel11_template& AccessCapLateAdditionsRel11_template::operator=(const AccessCapLateAdditionsRel11& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapLateAdditionsRel11_template& AccessCapLateAdditionsRel11_template::operator=(const OPTIONAL<AccessCapLateAdditionsRel11>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapLateAdditionsRel11&)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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
return *this;
}

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

boolean AccessCapLateAdditionsRel11_template::match(const AccessCapLateAdditionsRel11& 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.extendedEARFCNValueRange().is_bound()) return FALSE;
if(!single_value->field_extendedEARFCNValueRange.match(other_value.extendedEARFCNValueRange(), 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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
return FALSE;
}

boolean AccessCapLateAdditionsRel11_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_extendedEARFCNValueRange.is_bound();
}

boolean AccessCapLateAdditionsRel11_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_extendedEARFCNValueRange.is_value();
}

void AccessCapLateAdditionsRel11_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;
}

AccessCapLateAdditionsRel11 AccessCapLateAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
AccessCapLateAdditionsRel11 ret_val;
if (single_value->field_extendedEARFCNValueRange.is_bound()) {
ret_val.extendedEARFCNValueRange() = single_value->field_extendedEARFCNValueRange.valueof();
}
return ret_val;
}

void AccessCapLateAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapLateAdditionsRel11_template[list_length];
}

AccessCapLateAdditionsRel11_template& AccessCapLateAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapLateAdditionsRel11_template::extendedEARFCNValueRange()
{
set_specific();
return single_value->field_extendedEARFCNValueRange;
}

const BITSTRING_template& AccessCapLateAdditionsRel11_template::extendedEARFCNValueRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedEARFCNValueRange of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
return single_value->field_extendedEARFCNValueRange;
}

int AccessCapLateAdditionsRel11_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
  }
  return 0;
}

void AccessCapLateAdditionsRel11_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ extendedEARFCNValueRange := ");
single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_template::log_match(const AccessCapLateAdditionsRel11& 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_extendedEARFCNValueRange.match(match_value.extendedEARFCNValueRange(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedEARFCNValueRange");
single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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("{ extendedEARFCNValueRange := ");
single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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 AccessCapLateAdditionsRel11_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_extendedEARFCNValueRange.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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
}

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
}

void AccessCapLateAdditionsRel11_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: {
    AccessCapLateAdditionsRel11_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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11 has 1 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) extendedEARFCNValueRange().set_param(*param.get_elem(0));
    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(), "extendedEARFCNValueRange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedEARFCNValueRange().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 @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapLateAdditionsRel11_template* precondition = new AccessCapLateAdditionsRel11_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapLateAdditionsRel11_template* implied_template = new AccessCapLateAdditionsRel11_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapLateAdditionsRel11_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11");
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 : "@MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11");
}

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

boolean AccessCapLateAdditionsRel11_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;
}

AccessCapAdditionsAfterRel12::AccessCapAdditionsAfterRel12()
{
}

AccessCapAdditionsAfterRel12::AccessCapAdditionsAfterRel12(const AccessCapLateAdditionsRel11& par_accessCapLateAdditionsRel11,
    const OCTETSTRING& par_accessCapLateAdditionsAfterRel11)
  :   field_accessCapLateAdditionsRel11(par_accessCapLateAdditionsRel11),
  field_accessCapLateAdditionsAfterRel11(par_accessCapLateAdditionsAfterRel11)
{
}

AccessCapAdditionsAfterRel12::AccessCapAdditionsAfterRel12(const AccessCapAdditionsAfterRel12& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
if (other_value.accessCapLateAdditionsRel11().is_bound()) field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11();
else field_accessCapLateAdditionsRel11.clean_up();
if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11();
else field_accessCapLateAdditionsAfterRel11.clean_up();
}

void AccessCapAdditionsAfterRel12::clean_up()
{
field_accessCapLateAdditionsRel11.clean_up();
field_accessCapLateAdditionsAfterRel11.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel12::get_descriptor() const { return &AccessCapAdditionsAfterRel12_descr_; }
AccessCapAdditionsAfterRel12& AccessCapAdditionsAfterRel12::operator=(const AccessCapAdditionsAfterRel12& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
  if (other_value.accessCapLateAdditionsRel11().is_bound()) field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11();
  else field_accessCapLateAdditionsRel11.clean_up();
  if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11();
  else field_accessCapLateAdditionsAfterRel11.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel12::operator==(const AccessCapAdditionsAfterRel12& other_value) const
{
return field_accessCapLateAdditionsRel11==other_value.field_accessCapLateAdditionsRel11
  && field_accessCapLateAdditionsAfterRel11==other_value.field_accessCapLateAdditionsAfterRel11;
}

boolean AccessCapAdditionsAfterRel12::is_bound() const
{
return (field_accessCapLateAdditionsRel11.is_bound())
  || (field_accessCapLateAdditionsAfterRel11.is_bound());
}
boolean AccessCapAdditionsAfterRel12::is_value() const
{
return field_accessCapLateAdditionsRel11.is_value()
  && field_accessCapLateAdditionsAfterRel11.is_value();
}
void AccessCapAdditionsAfterRel12::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapLateAdditionsRel11 := ");
field_accessCapLateAdditionsRel11.log();
TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := ");
field_accessCapLateAdditionsAfterRel11.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel12::set_implicit_omit()
{
if (accessCapLateAdditionsRel11().is_bound()) accessCapLateAdditionsRel11().set_implicit_omit();
if (accessCapLateAdditionsAfterRel11().is_bound()) accessCapLateAdditionsAfterRel11().set_implicit_omit();
}

void AccessCapAdditionsAfterRel12::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 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) accessCapLateAdditionsRel11().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapLateAdditionsAfterRel11().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(), "accessCapLateAdditionsRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapLateAdditionsRel11().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(), "accessCapLateAdditionsAfterRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapLateAdditionsAfterRel11().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12");
  }
}

void AccessCapAdditionsAfterRel12::encode_text(Text_Buf& text_buf) const
{
field_accessCapLateAdditionsRel11.encode_text(text_buf);
field_accessCapLateAdditionsAfterRel11.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel12::decode_text(Text_Buf& text_buf)
{
field_accessCapLateAdditionsRel11.decode_text(text_buf);
field_accessCapLateAdditionsAfterRel11.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel12::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel12::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel12::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel12_accessCapLateAdditionsRel11_descr_.raw->forceomit);
  decoded_field_length = field_accessCapLateAdditionsRel11.RAW_decode(AccessCapAdditionsAfterRel12_accessCapLateAdditionsRel11_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel12_accessCapLateAdditionsAfterRel11_descr_.raw->forceomit);
  decoded_field_length = field_accessCapLateAdditionsAfterRel11.RAW_decode(AccessCapAdditionsAfterRel12_accessCapLateAdditionsAfterRel11_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel12::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, AccessCapAdditionsAfterRel12_accessCapLateAdditionsRel11_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel12_accessCapLateAdditionsAfterRel11_descr_.raw);
  encoded_length += field_accessCapLateAdditionsRel11.RAW_encode(AccessCapAdditionsAfterRel12_accessCapLateAdditionsRel11_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapLateAdditionsAfterRel11.RAW_encode(AccessCapAdditionsAfterRel12_accessCapLateAdditionsAfterRel11_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel12_template::single_value_struct {
AccessCapLateAdditionsRel11_template field_accessCapLateAdditionsRel11;
OCTETSTRING_template field_accessCapLateAdditionsAfterRel11;
};

void AccessCapAdditionsAfterRel12_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_accessCapLateAdditionsRel11 = ANY_VALUE;
single_value->field_accessCapLateAdditionsAfterRel11 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel12_template::copy_value(const AccessCapAdditionsAfterRel12& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapLateAdditionsRel11().is_bound()) {
  single_value->field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11();
} else {
  single_value->field_accessCapLateAdditionsRel11.clean_up();
}
if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) {
  single_value->field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11();
} else {
  single_value->field_accessCapLateAdditionsAfterRel11.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel12_template::copy_template(const AccessCapAdditionsAfterRel12_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapLateAdditionsRel11().get_selection()) {
single_value->field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11();
} else {
single_value->field_accessCapLateAdditionsRel11.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapLateAdditionsAfterRel11().get_selection()) {
single_value->field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11();
} else {
single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12_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 AccessCapAdditionsAfterRel12_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel12_template::AccessCapAdditionsAfterRel12_template()
{
}

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

AccessCapAdditionsAfterRel12_template::AccessCapAdditionsAfterRel12_template(const AccessCapAdditionsAfterRel12& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel12_template::AccessCapAdditionsAfterRel12_template(const OPTIONAL<AccessCapAdditionsAfterRel12>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel12&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel12_template& AccessCapAdditionsAfterRel12_template::operator=(const AccessCapAdditionsAfterRel12& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel12_template& AccessCapAdditionsAfterRel12_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel12>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel12&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel12_template::match(const AccessCapAdditionsAfterRel12& 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.accessCapLateAdditionsRel11().is_bound()) return FALSE;
if(!single_value->field_accessCapLateAdditionsRel11.match(other_value.accessCapLateAdditionsRel11(), legacy))return FALSE;
if(!other_value.accessCapLateAdditionsAfterRel11().is_bound()) return FALSE;
if(!single_value->field_accessCapLateAdditionsAfterRel11.match(other_value.accessCapLateAdditionsAfterRel11(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel12_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapLateAdditionsRel11.is_bound()
 || single_value->field_accessCapLateAdditionsAfterRel11.is_bound();
}

boolean AccessCapAdditionsAfterRel12_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapLateAdditionsRel11.is_value()
 && single_value->field_accessCapLateAdditionsAfterRel11.is_value();
}

void AccessCapAdditionsAfterRel12_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;
}

AccessCapAdditionsAfterRel12 AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
AccessCapAdditionsAfterRel12 ret_val;
if (single_value->field_accessCapLateAdditionsRel11.is_bound()) {
ret_val.accessCapLateAdditionsRel11() = single_value->field_accessCapLateAdditionsRel11.valueof();
}
if (single_value->field_accessCapLateAdditionsAfterRel11.is_bound()) {
ret_val.accessCapLateAdditionsAfterRel11() = single_value->field_accessCapLateAdditionsAfterRel11.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel12_template[list_length];
}

AccessCapAdditionsAfterRel12_template& AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
return value_list.list_value[list_index];
}

AccessCapLateAdditionsRel11_template& AccessCapAdditionsAfterRel12_template::accessCapLateAdditionsRel11()
{
set_specific();
return single_value->field_accessCapLateAdditionsRel11;
}

const AccessCapLateAdditionsRel11_template& AccessCapAdditionsAfterRel12_template::accessCapLateAdditionsRel11() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapLateAdditionsRel11 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
return single_value->field_accessCapLateAdditionsRel11;
}

OCTETSTRING_template& AccessCapAdditionsAfterRel12_template::accessCapLateAdditionsAfterRel11()
{
set_specific();
return single_value->field_accessCapLateAdditionsAfterRel11;
}

const OCTETSTRING_template& AccessCapAdditionsAfterRel12_template::accessCapLateAdditionsAfterRel11() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapLateAdditionsAfterRel11 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
return single_value->field_accessCapLateAdditionsAfterRel11;
}

int AccessCapAdditionsAfterRel12_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel12_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapLateAdditionsRel11 := ");
single_value->field_accessCapLateAdditionsRel11.log();
TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := ");
single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12_template::log_match(const AccessCapAdditionsAfterRel12& 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_accessCapLateAdditionsRel11.match(match_value.accessCapLateAdditionsRel11(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapLateAdditionsRel11");
single_value->field_accessCapLateAdditionsRel11.log_match(match_value.accessCapLateAdditionsRel11(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapLateAdditionsAfterRel11.match(match_value.accessCapLateAdditionsAfterRel11(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapLateAdditionsAfterRel11");
single_value->field_accessCapLateAdditionsAfterRel11.log_match(match_value.accessCapLateAdditionsAfterRel11(), 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("{ accessCapLateAdditionsRel11 := ");
single_value->field_accessCapLateAdditionsRel11.log_match(match_value.accessCapLateAdditionsRel11(), legacy);
TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := ");
single_value->field_accessCapLateAdditionsAfterRel11.log_match(match_value.accessCapLateAdditionsAfterRel11(), 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 AccessCapAdditionsAfterRel12_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapLateAdditionsRel11.encode_text(text_buf);
single_value->field_accessCapLateAdditionsAfterRel11.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
}
}

void AccessCapAdditionsAfterRel12_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_accessCapLateAdditionsRel11.decode_text(text_buf);
single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12.");
}
}

void AccessCapAdditionsAfterRel12_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: {
    AccessCapAdditionsAfterRel12_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12 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) accessCapLateAdditionsRel11().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapLateAdditionsAfterRel11().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(), "accessCapLateAdditionsRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapLateAdditionsRel11().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(), "accessCapLateAdditionsAfterRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapLateAdditionsAfterRel11().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel12_template* precondition = new AccessCapAdditionsAfterRel12_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel12_template* implied_template = new AccessCapAdditionsAfterRel12_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel12_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel12_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_accessCapLateAdditionsRel11.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12");
single_value->field_accessCapLateAdditionsAfterRel11.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel12");
}

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

boolean AccessCapAdditionsAfterRel12_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;
}

AccessCapAdditionsAfterRel11::AccessCapAdditionsAfterRel11()
{
}

AccessCapAdditionsAfterRel11::AccessCapAdditionsAfterRel11(const AccessCapAdditionsRel12& par_accessCapAdditionsRel12,
    const AccessCapAdditionsAfterRel12& par_accessCapAdditionsAfterRel12)
  :   field_accessCapAdditionsRel12(par_accessCapAdditionsRel12),
  field_accessCapAdditionsAfterRel12(par_accessCapAdditionsAfterRel12)
{
}

AccessCapAdditionsAfterRel11::AccessCapAdditionsAfterRel11(const AccessCapAdditionsAfterRel11& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
if (other_value.accessCapAdditionsRel12().is_bound()) field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12();
else field_accessCapAdditionsRel12.clean_up();
if (other_value.accessCapAdditionsAfterRel12().is_bound()) field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12();
else field_accessCapAdditionsAfterRel12.clean_up();
}

void AccessCapAdditionsAfterRel11::clean_up()
{
field_accessCapAdditionsRel12.clean_up();
field_accessCapAdditionsAfterRel12.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel11::get_descriptor() const { return &AccessCapAdditionsAfterRel11_descr_; }
AccessCapAdditionsAfterRel11& AccessCapAdditionsAfterRel11::operator=(const AccessCapAdditionsAfterRel11& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
  if (other_value.accessCapAdditionsRel12().is_bound()) field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12();
  else field_accessCapAdditionsRel12.clean_up();
  if (other_value.accessCapAdditionsAfterRel12().is_bound()) field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12();
  else field_accessCapAdditionsAfterRel12.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel11::operator==(const AccessCapAdditionsAfterRel11& other_value) const
{
return field_accessCapAdditionsRel12==other_value.field_accessCapAdditionsRel12
  && field_accessCapAdditionsAfterRel12==other_value.field_accessCapAdditionsAfterRel12;
}

boolean AccessCapAdditionsAfterRel11::is_bound() const
{
return (field_accessCapAdditionsRel12.is_bound())
  || (field_accessCapAdditionsAfterRel12.is_bound());
}
boolean AccessCapAdditionsAfterRel11::is_value() const
{
return field_accessCapAdditionsRel12.is_value()
  && field_accessCapAdditionsAfterRel12.is_value();
}
void AccessCapAdditionsAfterRel11::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel12 := ");
field_accessCapAdditionsRel12.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := ");
field_accessCapAdditionsAfterRel12.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel11::set_implicit_omit()
{
if (accessCapAdditionsRel12().is_bound()) accessCapAdditionsRel12().set_implicit_omit();
if (accessCapAdditionsAfterRel12().is_bound()) accessCapAdditionsAfterRel12().set_implicit_omit();
}

void AccessCapAdditionsAfterRel11::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 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) accessCapAdditionsRel12().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel12().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(), "accessCapAdditionsRel12")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel12().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(), "accessCapAdditionsAfterRel12")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel12().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11");
  }
}

void AccessCapAdditionsAfterRel11::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel12.encode_text(text_buf);
field_accessCapAdditionsAfterRel12.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel11::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel12.decode_text(text_buf);
field_accessCapAdditionsAfterRel12.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel11::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel11::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel11_accessCapAdditionsRel12_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel12.RAW_decode(AccessCapAdditionsAfterRel11_accessCapAdditionsRel12_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel11_accessCapAdditionsAfterRel12_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel12.RAW_decode(AccessCapAdditionsAfterRel11_accessCapAdditionsAfterRel12_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel11::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, AccessCapAdditionsAfterRel11_accessCapAdditionsRel12_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel11_accessCapAdditionsAfterRel12_descr_.raw);
  encoded_length += field_accessCapAdditionsRel12.RAW_encode(AccessCapAdditionsAfterRel11_accessCapAdditionsRel12_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapAdditionsAfterRel12.RAW_encode(AccessCapAdditionsAfterRel11_accessCapAdditionsAfterRel12_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel11_template::single_value_struct {
AccessCapAdditionsRel12_template field_accessCapAdditionsRel12;
AccessCapAdditionsAfterRel12_template field_accessCapAdditionsAfterRel12;
};

void AccessCapAdditionsAfterRel11_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_accessCapAdditionsRel12 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel12 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel11_template::copy_value(const AccessCapAdditionsAfterRel11& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel12().is_bound()) {
  single_value->field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12();
} else {
  single_value->field_accessCapAdditionsRel12.clean_up();
}
if (other_value.accessCapAdditionsAfterRel12().is_bound()) {
  single_value->field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12();
} else {
  single_value->field_accessCapAdditionsAfterRel12.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel11_template::copy_template(const AccessCapAdditionsAfterRel11_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel12().get_selection()) {
single_value->field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12();
} else {
single_value->field_accessCapAdditionsRel12.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel12().get_selection()) {
single_value->field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12();
} else {
single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11_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 AccessCapAdditionsAfterRel11_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel11_template::AccessCapAdditionsAfterRel11_template()
{
}

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

AccessCapAdditionsAfterRel11_template::AccessCapAdditionsAfterRel11_template(const AccessCapAdditionsAfterRel11& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel11_template::AccessCapAdditionsAfterRel11_template(const OPTIONAL<AccessCapAdditionsAfterRel11>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel11&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel11_template& AccessCapAdditionsAfterRel11_template::operator=(const AccessCapAdditionsAfterRel11& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel11_template& AccessCapAdditionsAfterRel11_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel11>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel11&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel11_template::match(const AccessCapAdditionsAfterRel11& 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.accessCapAdditionsRel12().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel12.match(other_value.accessCapAdditionsRel12(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel12().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsAfterRel12.match(other_value.accessCapAdditionsAfterRel12(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel11_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel12.is_bound()
 || single_value->field_accessCapAdditionsAfterRel12.is_bound();
}

boolean AccessCapAdditionsAfterRel11_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel12.is_value()
 && single_value->field_accessCapAdditionsAfterRel12.is_value();
}

void AccessCapAdditionsAfterRel11_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;
}

AccessCapAdditionsAfterRel11 AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
AccessCapAdditionsAfterRel11 ret_val;
if (single_value->field_accessCapAdditionsRel12.is_bound()) {
ret_val.accessCapAdditionsRel12() = single_value->field_accessCapAdditionsRel12.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel12.is_bound()) {
ret_val.accessCapAdditionsAfterRel12() = single_value->field_accessCapAdditionsAfterRel12.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel11_template[list_length];
}

AccessCapAdditionsAfterRel11_template& AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel12_template& AccessCapAdditionsAfterRel11_template::accessCapAdditionsRel12()
{
set_specific();
return single_value->field_accessCapAdditionsRel12;
}

const AccessCapAdditionsRel12_template& AccessCapAdditionsAfterRel11_template::accessCapAdditionsRel12() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel12 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
return single_value->field_accessCapAdditionsRel12;
}

AccessCapAdditionsAfterRel12_template& AccessCapAdditionsAfterRel11_template::accessCapAdditionsAfterRel12()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel12;
}

const AccessCapAdditionsAfterRel12_template& AccessCapAdditionsAfterRel11_template::accessCapAdditionsAfterRel12() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel12 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
return single_value->field_accessCapAdditionsAfterRel12;
}

int AccessCapAdditionsAfterRel11_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel11_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel12 := ");
single_value->field_accessCapAdditionsRel12.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := ");
single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11_template::log_match(const AccessCapAdditionsAfterRel11& 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_accessCapAdditionsRel12.match(match_value.accessCapAdditionsRel12(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel12");
single_value->field_accessCapAdditionsRel12.log_match(match_value.accessCapAdditionsRel12(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapAdditionsAfterRel12.match(match_value.accessCapAdditionsAfterRel12(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel12");
single_value->field_accessCapAdditionsAfterRel12.log_match(match_value.accessCapAdditionsAfterRel12(), 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("{ accessCapAdditionsRel12 := ");
single_value->field_accessCapAdditionsRel12.log_match(match_value.accessCapAdditionsRel12(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := ");
single_value->field_accessCapAdditionsAfterRel12.log_match(match_value.accessCapAdditionsAfterRel12(), 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 AccessCapAdditionsAfterRel11_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel12.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel12.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
}
}

void AccessCapAdditionsAfterRel11_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_accessCapAdditionsRel12.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11.");
}
}

void AccessCapAdditionsAfterRel11_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: {
    AccessCapAdditionsAfterRel11_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11 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) accessCapAdditionsRel12().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel12().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(), "accessCapAdditionsRel12")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel12().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(), "accessCapAdditionsAfterRel12")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel12().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel11_template* precondition = new AccessCapAdditionsAfterRel11_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel11_template* implied_template = new AccessCapAdditionsAfterRel11_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel11_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel11_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_accessCapAdditionsRel12.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11");
single_value->field_accessCapAdditionsAfterRel12.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel11");
}

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

boolean AccessCapAdditionsAfterRel11_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;
}

AccessCapAdditionsAfterRel10::AccessCapAdditionsAfterRel10()
{
}

AccessCapAdditionsAfterRel10::AccessCapAdditionsAfterRel10(const AccessCapAdditionsRel11& par_accessCapAdditionsRel11,
    const AccessCapAdditionsAfterRel11& par_accessCapAdditionsAfterRel11)
  :   field_accessCapAdditionsRel11(par_accessCapAdditionsRel11),
  field_accessCapAdditionsAfterRel11(par_accessCapAdditionsAfterRel11)
{
}

AccessCapAdditionsAfterRel10::AccessCapAdditionsAfterRel10(const AccessCapAdditionsAfterRel10& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
if (other_value.accessCapAdditionsRel11().is_bound()) field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11();
else field_accessCapAdditionsRel11.clean_up();
if (other_value.accessCapAdditionsAfterRel11().is_bound()) field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11();
else field_accessCapAdditionsAfterRel11.clean_up();
}

void AccessCapAdditionsAfterRel10::clean_up()
{
field_accessCapAdditionsRel11.clean_up();
field_accessCapAdditionsAfterRel11.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel10::get_descriptor() const { return &AccessCapAdditionsAfterRel10_descr_; }
AccessCapAdditionsAfterRel10& AccessCapAdditionsAfterRel10::operator=(const AccessCapAdditionsAfterRel10& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
  if (other_value.accessCapAdditionsRel11().is_bound()) field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11();
  else field_accessCapAdditionsRel11.clean_up();
  if (other_value.accessCapAdditionsAfterRel11().is_bound()) field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11();
  else field_accessCapAdditionsAfterRel11.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel10::operator==(const AccessCapAdditionsAfterRel10& other_value) const
{
return field_accessCapAdditionsRel11==other_value.field_accessCapAdditionsRel11
  && field_accessCapAdditionsAfterRel11==other_value.field_accessCapAdditionsAfterRel11;
}

boolean AccessCapAdditionsAfterRel10::is_bound() const
{
return (field_accessCapAdditionsRel11.is_bound())
  || (field_accessCapAdditionsAfterRel11.is_bound());
}
boolean AccessCapAdditionsAfterRel10::is_value() const
{
return field_accessCapAdditionsRel11.is_value()
  && field_accessCapAdditionsAfterRel11.is_value();
}
void AccessCapAdditionsAfterRel10::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel11 := ");
field_accessCapAdditionsRel11.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := ");
field_accessCapAdditionsAfterRel11.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel10::set_implicit_omit()
{
if (accessCapAdditionsRel11().is_bound()) accessCapAdditionsRel11().set_implicit_omit();
if (accessCapAdditionsAfterRel11().is_bound()) accessCapAdditionsAfterRel11().set_implicit_omit();
}

void AccessCapAdditionsAfterRel10::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 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) accessCapAdditionsRel11().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel11().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(), "accessCapAdditionsRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel11().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(), "accessCapAdditionsAfterRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel11().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10");
  }
}

void AccessCapAdditionsAfterRel10::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel11.encode_text(text_buf);
field_accessCapAdditionsAfterRel11.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel10::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel11.decode_text(text_buf);
field_accessCapAdditionsAfterRel11.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel10::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel10::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel10::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel10_accessCapAdditionsRel11_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel11.RAW_decode(AccessCapAdditionsAfterRel10_accessCapAdditionsRel11_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel10_accessCapAdditionsAfterRel11_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel11.RAW_decode(AccessCapAdditionsAfterRel10_accessCapAdditionsAfterRel11_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel10::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, AccessCapAdditionsAfterRel10_accessCapAdditionsRel11_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel10_accessCapAdditionsAfterRel11_descr_.raw);
  encoded_length += field_accessCapAdditionsRel11.RAW_encode(AccessCapAdditionsAfterRel10_accessCapAdditionsRel11_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapAdditionsAfterRel11.RAW_encode(AccessCapAdditionsAfterRel10_accessCapAdditionsAfterRel11_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel10_template::single_value_struct {
AccessCapAdditionsRel11_template field_accessCapAdditionsRel11;
AccessCapAdditionsAfterRel11_template field_accessCapAdditionsAfterRel11;
};

void AccessCapAdditionsAfterRel10_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_accessCapAdditionsRel11 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel11 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel10_template::copy_value(const AccessCapAdditionsAfterRel10& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel11().is_bound()) {
  single_value->field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11();
} else {
  single_value->field_accessCapAdditionsRel11.clean_up();
}
if (other_value.accessCapAdditionsAfterRel11().is_bound()) {
  single_value->field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11();
} else {
  single_value->field_accessCapAdditionsAfterRel11.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel10_template::copy_template(const AccessCapAdditionsAfterRel10_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel11().get_selection()) {
single_value->field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11();
} else {
single_value->field_accessCapAdditionsRel11.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel11().get_selection()) {
single_value->field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11();
} else {
single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10_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 AccessCapAdditionsAfterRel10_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel10_template::AccessCapAdditionsAfterRel10_template()
{
}

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

AccessCapAdditionsAfterRel10_template::AccessCapAdditionsAfterRel10_template(const AccessCapAdditionsAfterRel10& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel10_template::AccessCapAdditionsAfterRel10_template(const OPTIONAL<AccessCapAdditionsAfterRel10>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel10&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel10_template& AccessCapAdditionsAfterRel10_template::operator=(const AccessCapAdditionsAfterRel10& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel10_template& AccessCapAdditionsAfterRel10_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel10>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel10&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel10_template::match(const AccessCapAdditionsAfterRel10& 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.accessCapAdditionsRel11().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel11.match(other_value.accessCapAdditionsRel11(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel11().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsAfterRel11.match(other_value.accessCapAdditionsAfterRel11(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel10_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel11.is_bound()
 || single_value->field_accessCapAdditionsAfterRel11.is_bound();
}

boolean AccessCapAdditionsAfterRel10_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel11.is_value()
 && single_value->field_accessCapAdditionsAfterRel11.is_value();
}

void AccessCapAdditionsAfterRel10_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;
}

AccessCapAdditionsAfterRel10 AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
AccessCapAdditionsAfterRel10 ret_val;
if (single_value->field_accessCapAdditionsRel11.is_bound()) {
ret_val.accessCapAdditionsRel11() = single_value->field_accessCapAdditionsRel11.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel11.is_bound()) {
ret_val.accessCapAdditionsAfterRel11() = single_value->field_accessCapAdditionsAfterRel11.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel10_template[list_length];
}

AccessCapAdditionsAfterRel10_template& AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel11_template& AccessCapAdditionsAfterRel10_template::accessCapAdditionsRel11()
{
set_specific();
return single_value->field_accessCapAdditionsRel11;
}

const AccessCapAdditionsRel11_template& AccessCapAdditionsAfterRel10_template::accessCapAdditionsRel11() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel11 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
return single_value->field_accessCapAdditionsRel11;
}

AccessCapAdditionsAfterRel11_template& AccessCapAdditionsAfterRel10_template::accessCapAdditionsAfterRel11()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel11;
}

const AccessCapAdditionsAfterRel11_template& AccessCapAdditionsAfterRel10_template::accessCapAdditionsAfterRel11() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel11 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
return single_value->field_accessCapAdditionsAfterRel11;
}

int AccessCapAdditionsAfterRel10_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel10_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel11 := ");
single_value->field_accessCapAdditionsRel11.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := ");
single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10_template::log_match(const AccessCapAdditionsAfterRel10& 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_accessCapAdditionsRel11.match(match_value.accessCapAdditionsRel11(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel11");
single_value->field_accessCapAdditionsRel11.log_match(match_value.accessCapAdditionsRel11(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapAdditionsAfterRel11.match(match_value.accessCapAdditionsAfterRel11(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel11");
single_value->field_accessCapAdditionsAfterRel11.log_match(match_value.accessCapAdditionsAfterRel11(), 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("{ accessCapAdditionsRel11 := ");
single_value->field_accessCapAdditionsRel11.log_match(match_value.accessCapAdditionsRel11(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := ");
single_value->field_accessCapAdditionsAfterRel11.log_match(match_value.accessCapAdditionsAfterRel11(), 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 AccessCapAdditionsAfterRel10_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel11.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel11.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
}
}

void AccessCapAdditionsAfterRel10_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_accessCapAdditionsRel11.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10.");
}
}

void AccessCapAdditionsAfterRel10_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: {
    AccessCapAdditionsAfterRel10_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10 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) accessCapAdditionsRel11().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel11().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(), "accessCapAdditionsRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel11().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(), "accessCapAdditionsAfterRel11")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel11().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel10_template* precondition = new AccessCapAdditionsAfterRel10_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel10_template* implied_template = new AccessCapAdditionsAfterRel10_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel10_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel10_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_accessCapAdditionsRel11.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10");
single_value->field_accessCapAdditionsAfterRel11.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel10");
}

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

boolean AccessCapAdditionsAfterRel10_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;
}

AccessCapAdditionsAfterRel9::AccessCapAdditionsAfterRel9()
{
}

AccessCapAdditionsAfterRel9::AccessCapAdditionsAfterRel9(const AccessCapAdditionsRel10& par_accessCapAdditionsRel10,
    const AccessCapAdditionsAfterRel10& par_accessCapAdditionsAfterRel10)
  :   field_accessCapAdditionsRel10(par_accessCapAdditionsRel10),
  field_accessCapAdditionsAfterRel10(par_accessCapAdditionsAfterRel10)
{
}

AccessCapAdditionsAfterRel9::AccessCapAdditionsAfterRel9(const AccessCapAdditionsAfterRel9& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
if (other_value.accessCapAdditionsRel10().is_bound()) field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10();
else field_accessCapAdditionsRel10.clean_up();
if (other_value.accessCapAdditionsAfterRel10().is_bound()) field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10();
else field_accessCapAdditionsAfterRel10.clean_up();
}

void AccessCapAdditionsAfterRel9::clean_up()
{
field_accessCapAdditionsRel10.clean_up();
field_accessCapAdditionsAfterRel10.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel9::get_descriptor() const { return &AccessCapAdditionsAfterRel9_descr_; }
AccessCapAdditionsAfterRel9& AccessCapAdditionsAfterRel9::operator=(const AccessCapAdditionsAfterRel9& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
  if (other_value.accessCapAdditionsRel10().is_bound()) field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10();
  else field_accessCapAdditionsRel10.clean_up();
  if (other_value.accessCapAdditionsAfterRel10().is_bound()) field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10();
  else field_accessCapAdditionsAfterRel10.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel9::operator==(const AccessCapAdditionsAfterRel9& other_value) const
{
return field_accessCapAdditionsRel10==other_value.field_accessCapAdditionsRel10
  && field_accessCapAdditionsAfterRel10==other_value.field_accessCapAdditionsAfterRel10;
}

boolean AccessCapAdditionsAfterRel9::is_bound() const
{
return (field_accessCapAdditionsRel10.is_bound())
  || (field_accessCapAdditionsAfterRel10.is_bound());
}
boolean AccessCapAdditionsAfterRel9::is_value() const
{
return field_accessCapAdditionsRel10.is_value()
  && field_accessCapAdditionsAfterRel10.is_value();
}
void AccessCapAdditionsAfterRel9::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel10 := ");
field_accessCapAdditionsRel10.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := ");
field_accessCapAdditionsAfterRel10.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel9::set_implicit_omit()
{
if (accessCapAdditionsRel10().is_bound()) accessCapAdditionsRel10().set_implicit_omit();
if (accessCapAdditionsAfterRel10().is_bound()) accessCapAdditionsAfterRel10().set_implicit_omit();
}

void AccessCapAdditionsAfterRel9::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 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) accessCapAdditionsRel10().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel10().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(), "accessCapAdditionsRel10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel10().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(), "accessCapAdditionsAfterRel10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel10().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9");
  }
}

void AccessCapAdditionsAfterRel9::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel10.encode_text(text_buf);
field_accessCapAdditionsAfterRel10.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel9::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel10.decode_text(text_buf);
field_accessCapAdditionsAfterRel10.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel9::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel9::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel9::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel10_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel10.RAW_decode(AccessCapAdditionsRel10_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel10_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel10.RAW_decode(AccessCapAdditionsAfterRel10_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel9::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, AccessCapAdditionsRel10_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel10_descr_.raw);
  encoded_length += field_accessCapAdditionsRel10.RAW_encode(AccessCapAdditionsRel10_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapAdditionsAfterRel10.RAW_encode(AccessCapAdditionsAfterRel10_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel9_template::single_value_struct {
AccessCapAdditionsRel10_template field_accessCapAdditionsRel10;
AccessCapAdditionsAfterRel10_template field_accessCapAdditionsAfterRel10;
};

void AccessCapAdditionsAfterRel9_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_accessCapAdditionsRel10 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel10 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel9_template::copy_value(const AccessCapAdditionsAfterRel9& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel10().is_bound()) {
  single_value->field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10();
} else {
  single_value->field_accessCapAdditionsRel10.clean_up();
}
if (other_value.accessCapAdditionsAfterRel10().is_bound()) {
  single_value->field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10();
} else {
  single_value->field_accessCapAdditionsAfterRel10.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel9_template::copy_template(const AccessCapAdditionsAfterRel9_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel10().get_selection()) {
single_value->field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10();
} else {
single_value->field_accessCapAdditionsRel10.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel10().get_selection()) {
single_value->field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10();
} else {
single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9_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 AccessCapAdditionsAfterRel9_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel9_template::AccessCapAdditionsAfterRel9_template()
{
}

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

AccessCapAdditionsAfterRel9_template::AccessCapAdditionsAfterRel9_template(const AccessCapAdditionsAfterRel9& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel9_template::AccessCapAdditionsAfterRel9_template(const OPTIONAL<AccessCapAdditionsAfterRel9>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel9&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel9_template& AccessCapAdditionsAfterRel9_template::operator=(const AccessCapAdditionsAfterRel9& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel9_template& AccessCapAdditionsAfterRel9_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel9>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel9&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel9_template::match(const AccessCapAdditionsAfterRel9& 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.accessCapAdditionsRel10().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel10.match(other_value.accessCapAdditionsRel10(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel10().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsAfterRel10.match(other_value.accessCapAdditionsAfterRel10(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel9_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel10.is_bound()
 || single_value->field_accessCapAdditionsAfterRel10.is_bound();
}

boolean AccessCapAdditionsAfterRel9_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel10.is_value()
 && single_value->field_accessCapAdditionsAfterRel10.is_value();
}

void AccessCapAdditionsAfterRel9_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;
}

AccessCapAdditionsAfterRel9 AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
AccessCapAdditionsAfterRel9 ret_val;
if (single_value->field_accessCapAdditionsRel10.is_bound()) {
ret_val.accessCapAdditionsRel10() = single_value->field_accessCapAdditionsRel10.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel10.is_bound()) {
ret_val.accessCapAdditionsAfterRel10() = single_value->field_accessCapAdditionsAfterRel10.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel9_template[list_length];
}

AccessCapAdditionsAfterRel9_template& AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel10_template& AccessCapAdditionsAfterRel9_template::accessCapAdditionsRel10()
{
set_specific();
return single_value->field_accessCapAdditionsRel10;
}

const AccessCapAdditionsRel10_template& AccessCapAdditionsAfterRel9_template::accessCapAdditionsRel10() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel10 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
return single_value->field_accessCapAdditionsRel10;
}

AccessCapAdditionsAfterRel10_template& AccessCapAdditionsAfterRel9_template::accessCapAdditionsAfterRel10()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel10;
}

const AccessCapAdditionsAfterRel10_template& AccessCapAdditionsAfterRel9_template::accessCapAdditionsAfterRel10() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel10 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
return single_value->field_accessCapAdditionsAfterRel10;
}

int AccessCapAdditionsAfterRel9_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel9_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel10 := ");
single_value->field_accessCapAdditionsRel10.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := ");
single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9_template::log_match(const AccessCapAdditionsAfterRel9& 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_accessCapAdditionsRel10.match(match_value.accessCapAdditionsRel10(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel10");
single_value->field_accessCapAdditionsRel10.log_match(match_value.accessCapAdditionsRel10(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapAdditionsAfterRel10.match(match_value.accessCapAdditionsAfterRel10(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel10");
single_value->field_accessCapAdditionsAfterRel10.log_match(match_value.accessCapAdditionsAfterRel10(), 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("{ accessCapAdditionsRel10 := ");
single_value->field_accessCapAdditionsRel10.log_match(match_value.accessCapAdditionsRel10(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := ");
single_value->field_accessCapAdditionsAfterRel10.log_match(match_value.accessCapAdditionsAfterRel10(), 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 AccessCapAdditionsAfterRel9_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel10.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel10.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
}
}

void AccessCapAdditionsAfterRel9_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_accessCapAdditionsRel10.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9.");
}
}

void AccessCapAdditionsAfterRel9_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: {
    AccessCapAdditionsAfterRel9_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9 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) accessCapAdditionsRel10().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel10().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(), "accessCapAdditionsRel10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel10().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(), "accessCapAdditionsAfterRel10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel10().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel9_template* precondition = new AccessCapAdditionsAfterRel9_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel9_template* implied_template = new AccessCapAdditionsAfterRel9_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel9_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel9_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_accessCapAdditionsRel10.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9");
single_value->field_accessCapAdditionsAfterRel10.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel9");
}

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

boolean AccessCapAdditionsAfterRel9_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;
}

AccessCapAdditionsAfterRel8::AccessCapAdditionsAfterRel8()
{
}

AccessCapAdditionsAfterRel8::AccessCapAdditionsAfterRel8(const AccessCapAdditionsRel9& par_accessCapAdditionsRel9,
    const AccessCapAdditionsAfterRel9& par_accessCapAdditionsAfterRel9)
  :   field_accessCapAdditionsRel9(par_accessCapAdditionsRel9),
  field_accessCapAdditionsAfterRel9(par_accessCapAdditionsAfterRel9)
{
}

AccessCapAdditionsAfterRel8::AccessCapAdditionsAfterRel8(const AccessCapAdditionsAfterRel8& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
if (other_value.accessCapAdditionsRel9().is_bound()) field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9();
else field_accessCapAdditionsRel9.clean_up();
if (other_value.accessCapAdditionsAfterRel9().is_bound()) field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9();
else field_accessCapAdditionsAfterRel9.clean_up();
}

void AccessCapAdditionsAfterRel8::clean_up()
{
field_accessCapAdditionsRel9.clean_up();
field_accessCapAdditionsAfterRel9.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel8::get_descriptor() const { return &AccessCapAdditionsAfterRel8_descr_; }
AccessCapAdditionsAfterRel8& AccessCapAdditionsAfterRel8::operator=(const AccessCapAdditionsAfterRel8& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
  if (other_value.accessCapAdditionsRel9().is_bound()) field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9();
  else field_accessCapAdditionsRel9.clean_up();
  if (other_value.accessCapAdditionsAfterRel9().is_bound()) field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9();
  else field_accessCapAdditionsAfterRel9.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel8::operator==(const AccessCapAdditionsAfterRel8& other_value) const
{
return field_accessCapAdditionsRel9==other_value.field_accessCapAdditionsRel9
  && field_accessCapAdditionsAfterRel9==other_value.field_accessCapAdditionsAfterRel9;
}

boolean AccessCapAdditionsAfterRel8::is_bound() const
{
return (field_accessCapAdditionsRel9.is_bound())
  || (field_accessCapAdditionsAfterRel9.is_bound());
}
boolean AccessCapAdditionsAfterRel8::is_value() const
{
return field_accessCapAdditionsRel9.is_value()
  && field_accessCapAdditionsAfterRel9.is_value();
}
void AccessCapAdditionsAfterRel8::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel9 := ");
field_accessCapAdditionsRel9.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := ");
field_accessCapAdditionsAfterRel9.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel8::set_implicit_omit()
{
if (accessCapAdditionsRel9().is_bound()) accessCapAdditionsRel9().set_implicit_omit();
if (accessCapAdditionsAfterRel9().is_bound()) accessCapAdditionsAfterRel9().set_implicit_omit();
}

void AccessCapAdditionsAfterRel8::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 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) accessCapAdditionsRel9().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel9().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(), "accessCapAdditionsRel9")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel9().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(), "accessCapAdditionsAfterRel9")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel9().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8");
  }
}

void AccessCapAdditionsAfterRel8::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel9.encode_text(text_buf);
field_accessCapAdditionsAfterRel9.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel8::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel9.decode_text(text_buf);
field_accessCapAdditionsAfterRel9.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel8::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel8::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel8::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel9_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel9.RAW_decode(AccessCapAdditionsRel9_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel9_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel9.RAW_decode(AccessCapAdditionsAfterRel9_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel8::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, AccessCapAdditionsRel9_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel9_descr_.raw);
  encoded_length += field_accessCapAdditionsRel9.RAW_encode(AccessCapAdditionsRel9_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapAdditionsAfterRel9.RAW_encode(AccessCapAdditionsAfterRel9_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel8_template::single_value_struct {
AccessCapAdditionsRel9_template field_accessCapAdditionsRel9;
AccessCapAdditionsAfterRel9_template field_accessCapAdditionsAfterRel9;
};

void AccessCapAdditionsAfterRel8_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_accessCapAdditionsRel9 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel9 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel8_template::copy_value(const AccessCapAdditionsAfterRel8& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel9().is_bound()) {
  single_value->field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9();
} else {
  single_value->field_accessCapAdditionsRel9.clean_up();
}
if (other_value.accessCapAdditionsAfterRel9().is_bound()) {
  single_value->field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9();
} else {
  single_value->field_accessCapAdditionsAfterRel9.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel8_template::copy_template(const AccessCapAdditionsAfterRel8_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel9().get_selection()) {
single_value->field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9();
} else {
single_value->field_accessCapAdditionsRel9.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel9().get_selection()) {
single_value->field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9();
} else {
single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8_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 AccessCapAdditionsAfterRel8_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel8_template::AccessCapAdditionsAfterRel8_template()
{
}

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

AccessCapAdditionsAfterRel8_template::AccessCapAdditionsAfterRel8_template(const AccessCapAdditionsAfterRel8& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel8_template::AccessCapAdditionsAfterRel8_template(const OPTIONAL<AccessCapAdditionsAfterRel8>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel8&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel8_template& AccessCapAdditionsAfterRel8_template::operator=(const AccessCapAdditionsAfterRel8& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel8_template& AccessCapAdditionsAfterRel8_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel8>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel8&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel8_template::match(const AccessCapAdditionsAfterRel8& 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.accessCapAdditionsRel9().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel9.match(other_value.accessCapAdditionsRel9(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel9().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsAfterRel9.match(other_value.accessCapAdditionsAfterRel9(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel8_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel9.is_bound()
 || single_value->field_accessCapAdditionsAfterRel9.is_bound();
}

boolean AccessCapAdditionsAfterRel8_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel9.is_value()
 && single_value->field_accessCapAdditionsAfterRel9.is_value();
}

void AccessCapAdditionsAfterRel8_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;
}

AccessCapAdditionsAfterRel8 AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
AccessCapAdditionsAfterRel8 ret_val;
if (single_value->field_accessCapAdditionsRel9.is_bound()) {
ret_val.accessCapAdditionsRel9() = single_value->field_accessCapAdditionsRel9.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel9.is_bound()) {
ret_val.accessCapAdditionsAfterRel9() = single_value->field_accessCapAdditionsAfterRel9.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel8_template[list_length];
}

AccessCapAdditionsAfterRel8_template& AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel9_template& AccessCapAdditionsAfterRel8_template::accessCapAdditionsRel9()
{
set_specific();
return single_value->field_accessCapAdditionsRel9;
}

const AccessCapAdditionsRel9_template& AccessCapAdditionsAfterRel8_template::accessCapAdditionsRel9() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel9 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
return single_value->field_accessCapAdditionsRel9;
}

AccessCapAdditionsAfterRel9_template& AccessCapAdditionsAfterRel8_template::accessCapAdditionsAfterRel9()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel9;
}

const AccessCapAdditionsAfterRel9_template& AccessCapAdditionsAfterRel8_template::accessCapAdditionsAfterRel9() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel9 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
return single_value->field_accessCapAdditionsAfterRel9;
}

int AccessCapAdditionsAfterRel8_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel8_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel9 := ");
single_value->field_accessCapAdditionsRel9.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := ");
single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8_template::log_match(const AccessCapAdditionsAfterRel8& 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_accessCapAdditionsRel9.match(match_value.accessCapAdditionsRel9(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel9");
single_value->field_accessCapAdditionsRel9.log_match(match_value.accessCapAdditionsRel9(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapAdditionsAfterRel9.match(match_value.accessCapAdditionsAfterRel9(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel9");
single_value->field_accessCapAdditionsAfterRel9.log_match(match_value.accessCapAdditionsAfterRel9(), 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("{ accessCapAdditionsRel9 := ");
single_value->field_accessCapAdditionsRel9.log_match(match_value.accessCapAdditionsRel9(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := ");
single_value->field_accessCapAdditionsAfterRel9.log_match(match_value.accessCapAdditionsAfterRel9(), 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 AccessCapAdditionsAfterRel8_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel9.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel9.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
}
}

void AccessCapAdditionsAfterRel8_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_accessCapAdditionsRel9.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8.");
}
}

void AccessCapAdditionsAfterRel8_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: {
    AccessCapAdditionsAfterRel8_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8 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) accessCapAdditionsRel9().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel9().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(), "accessCapAdditionsRel9")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel9().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(), "accessCapAdditionsAfterRel9")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel9().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel8_template* precondition = new AccessCapAdditionsAfterRel8_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel8_template* implied_template = new AccessCapAdditionsAfterRel8_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel8_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel8_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_accessCapAdditionsRel9.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8");
single_value->field_accessCapAdditionsAfterRel9.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel8");
}

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

boolean AccessCapAdditionsAfterRel8_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;
}

AccessCapAdditionsAfterRel7::AccessCapAdditionsAfterRel7()
{
}

AccessCapAdditionsAfterRel7::AccessCapAdditionsAfterRel7(const AccessCapAdditionsRel8& par_accessCapAdditionsRel8,
    const AccessCapAdditionsAfterRel8& par_accessCapAdditionsAfterRel8)
  :   field_accessCapAdditionsRel8(par_accessCapAdditionsRel8),
  field_accessCapAdditionsAfterRel8(par_accessCapAdditionsAfterRel8)
{
}

AccessCapAdditionsAfterRel7::AccessCapAdditionsAfterRel7(const AccessCapAdditionsAfterRel7& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
if (other_value.accessCapAdditionsRel8().is_bound()) field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8();
else field_accessCapAdditionsRel8.clean_up();
if (other_value.accessCapAdditionsAfterRel8().is_bound()) field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8();
else field_accessCapAdditionsAfterRel8.clean_up();
}

void AccessCapAdditionsAfterRel7::clean_up()
{
field_accessCapAdditionsRel8.clean_up();
field_accessCapAdditionsAfterRel8.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel7::get_descriptor() const { return &AccessCapAdditionsAfterRel7_descr_; }
AccessCapAdditionsAfterRel7& AccessCapAdditionsAfterRel7::operator=(const AccessCapAdditionsAfterRel7& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
  if (other_value.accessCapAdditionsRel8().is_bound()) field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8();
  else field_accessCapAdditionsRel8.clean_up();
  if (other_value.accessCapAdditionsAfterRel8().is_bound()) field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8();
  else field_accessCapAdditionsAfterRel8.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel7::operator==(const AccessCapAdditionsAfterRel7& other_value) const
{
return field_accessCapAdditionsRel8==other_value.field_accessCapAdditionsRel8
  && field_accessCapAdditionsAfterRel8==other_value.field_accessCapAdditionsAfterRel8;
}

boolean AccessCapAdditionsAfterRel7::is_bound() const
{
return (field_accessCapAdditionsRel8.is_bound())
  || (field_accessCapAdditionsAfterRel8.is_bound());
}
boolean AccessCapAdditionsAfterRel7::is_value() const
{
return field_accessCapAdditionsRel8.is_value()
  && field_accessCapAdditionsAfterRel8.is_value();
}
void AccessCapAdditionsAfterRel7::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel8 := ");
field_accessCapAdditionsRel8.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := ");
field_accessCapAdditionsAfterRel8.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel7::set_implicit_omit()
{
if (accessCapAdditionsRel8().is_bound()) accessCapAdditionsRel8().set_implicit_omit();
if (accessCapAdditionsAfterRel8().is_bound()) accessCapAdditionsAfterRel8().set_implicit_omit();
}

void AccessCapAdditionsAfterRel7::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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 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) accessCapAdditionsRel8().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel8().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(), "accessCapAdditionsRel8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel8().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(), "accessCapAdditionsAfterRel8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel8().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7");
  }
}

void AccessCapAdditionsAfterRel7::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel8.encode_text(text_buf);
field_accessCapAdditionsAfterRel8.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel7::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel8.decode_text(text_buf);
field_accessCapAdditionsAfterRel8.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel7::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapAdditionsAfterRel7::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapAdditionsAfterRel7::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel8_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel8.RAW_decode(AccessCapAdditionsRel8_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel8_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel8.RAW_decode(AccessCapAdditionsAfterRel8_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel7::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, AccessCapAdditionsRel8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel8_descr_.raw);
  encoded_length += field_accessCapAdditionsRel8.RAW_encode(AccessCapAdditionsRel8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapAdditionsAfterRel8.RAW_encode(AccessCapAdditionsAfterRel8_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel7_template::single_value_struct {
AccessCapAdditionsRel8_template field_accessCapAdditionsRel8;
AccessCapAdditionsAfterRel8_template field_accessCapAdditionsAfterRel8;
};

void AccessCapAdditionsAfterRel7_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_accessCapAdditionsRel8 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel8 = ANY_VALUE;
}
}
}

void AccessCapAdditionsAfterRel7_template::copy_value(const AccessCapAdditionsAfterRel7& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel8().is_bound()) {
  single_value->field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8();
} else {
  single_value->field_accessCapAdditionsRel8.clean_up();
}
if (other_value.accessCapAdditionsAfterRel8().is_bound()) {
  single_value->field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8();
} else {
  single_value->field_accessCapAdditionsAfterRel8.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel7_template::copy_template(const AccessCapAdditionsAfterRel7_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel8().get_selection()) {
single_value->field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8();
} else {
single_value->field_accessCapAdditionsRel8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel8().get_selection()) {
single_value->field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8();
} else {
single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7_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 AccessCapAdditionsAfterRel7_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel7_template::AccessCapAdditionsAfterRel7_template()
{
}

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

AccessCapAdditionsAfterRel7_template::AccessCapAdditionsAfterRel7_template(const AccessCapAdditionsAfterRel7& other_value)
{
copy_value(other_value);
}

AccessCapAdditionsAfterRel7_template::AccessCapAdditionsAfterRel7_template(const OPTIONAL<AccessCapAdditionsAfterRel7>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel7&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel7_template::operator=(const AccessCapAdditionsAfterRel7& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel7_template::operator=(const OPTIONAL<AccessCapAdditionsAfterRel7>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapAdditionsAfterRel7&)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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
}
return *this;
}

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

boolean AccessCapAdditionsAfterRel7_template::match(const AccessCapAdditionsAfterRel7& 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.accessCapAdditionsRel8().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel8.match(other_value.accessCapAdditionsRel8(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel8().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsAfterRel8.match(other_value.accessCapAdditionsAfterRel8(), 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel7_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel8.is_bound()
 || single_value->field_accessCapAdditionsAfterRel8.is_bound();
}

boolean AccessCapAdditionsAfterRel7_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel8.is_value()
 && single_value->field_accessCapAdditionsAfterRel8.is_value();
}

void AccessCapAdditionsAfterRel7_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;
}

AccessCapAdditionsAfterRel7 AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
AccessCapAdditionsAfterRel7 ret_val;
if (single_value->field_accessCapAdditionsRel8.is_bound()) {
ret_val.accessCapAdditionsRel8() = single_value->field_accessCapAdditionsRel8.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel8.is_bound()) {
ret_val.accessCapAdditionsAfterRel8() = single_value->field_accessCapAdditionsAfterRel8.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel7_template[list_length];
}

AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel8_template& AccessCapAdditionsAfterRel7_template::accessCapAdditionsRel8()
{
set_specific();
return single_value->field_accessCapAdditionsRel8;
}

const AccessCapAdditionsRel8_template& AccessCapAdditionsAfterRel7_template::accessCapAdditionsRel8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel8 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
return single_value->field_accessCapAdditionsRel8;
}

AccessCapAdditionsAfterRel8_template& AccessCapAdditionsAfterRel7_template::accessCapAdditionsAfterRel8()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel8;
}

const AccessCapAdditionsAfterRel8_template& AccessCapAdditionsAfterRel7_template::accessCapAdditionsAfterRel8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel8 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
return single_value->field_accessCapAdditionsAfterRel8;
}

int AccessCapAdditionsAfterRel7_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
  }
  return 0;
}

void AccessCapAdditionsAfterRel7_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel8 := ");
single_value->field_accessCapAdditionsRel8.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := ");
single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7_template::log_match(const AccessCapAdditionsAfterRel7& 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_accessCapAdditionsRel8.match(match_value.accessCapAdditionsRel8(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel8");
single_value->field_accessCapAdditionsRel8.log_match(match_value.accessCapAdditionsRel8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapAdditionsAfterRel8.match(match_value.accessCapAdditionsAfterRel8(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel8");
single_value->field_accessCapAdditionsAfterRel8.log_match(match_value.accessCapAdditionsAfterRel8(), 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("{ accessCapAdditionsRel8 := ");
single_value->field_accessCapAdditionsRel8.log_match(match_value.accessCapAdditionsRel8(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := ");
single_value->field_accessCapAdditionsAfterRel8.log_match(match_value.accessCapAdditionsAfterRel8(), 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 AccessCapAdditionsAfterRel7_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel8.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel8.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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
}
}

void AccessCapAdditionsAfterRel7_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_accessCapAdditionsRel8.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7.");
}
}

void AccessCapAdditionsAfterRel7_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: {
    AccessCapAdditionsAfterRel7_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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7 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) accessCapAdditionsRel8().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel8().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(), "accessCapAdditionsRel8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsRel8().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(), "accessCapAdditionsAfterRel8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel8().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 @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsAfterRel7_template* precondition = new AccessCapAdditionsAfterRel7_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsAfterRel7_template* implied_template = new AccessCapAdditionsAfterRel7_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsAfterRel7_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsAfterRel7_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_accessCapAdditionsRel8.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7");
single_value->field_accessCapAdditionsAfterRel8.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7");
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 : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel7");
}

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

boolean AccessCapAdditionsAfterRel7_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;
}

AccessCapabilitiesStruct::AccessCapabilitiesStruct()
{
}

AccessCapabilitiesStruct::AccessCapabilitiesStruct(const INTEGER& par_lengthIndicator,
    const AccessCapabilities& par_accessCapabilities,
    const OPTIONAL< BITSTRING >& par_spare__bits)
  :   field_lengthIndicator(par_lengthIndicator),
  field_accessCapabilities(par_accessCapabilities),
  field_spare__bits(par_spare__bits)
{
}

AccessCapabilitiesStruct::AccessCapabilitiesStruct(const AccessCapabilitiesStruct& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities();
else field_accessCapabilities.clean_up();
if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits();
else field_spare__bits.clean_up();
}

void AccessCapabilitiesStruct::clean_up()
{
field_lengthIndicator.clean_up();
field_accessCapabilities.clean_up();
field_spare__bits.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapabilitiesStruct::get_descriptor() const { return &AccessCapabilitiesStruct_descr_; }
AccessCapabilitiesStruct& AccessCapabilitiesStruct::operator=(const AccessCapabilitiesStruct& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities();
  else field_accessCapabilities.clean_up();
  if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits();
  else field_spare__bits.clean_up();
}
return *this;
}

boolean AccessCapabilitiesStruct::operator==(const AccessCapabilitiesStruct& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_accessCapabilities==other_value.field_accessCapabilities
  && field_spare__bits==other_value.field_spare__bits;
}

boolean AccessCapabilitiesStruct::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_accessCapabilities.is_bound())
  || (OPTIONAL_OMIT == field_spare__bits.get_selection() || field_spare__bits.is_bound());
}
boolean AccessCapabilitiesStruct::is_value() const
{
return field_lengthIndicator.is_value()
  && field_accessCapabilities.is_value()
  && (OPTIONAL_OMIT == field_spare__bits.get_selection() || field_spare__bits.is_value());
}
int AccessCapabilitiesStruct::size_of() const
{
  int ret_val = 2;
  if (field_spare__bits.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapabilitiesStruct::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessCapabilities := ");
field_accessCapabilities.log();
TTCN_Logger::log_event_str(", spare_bits := ");
field_spare__bits.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapabilitiesStruct::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (accessCapabilities().is_bound()) accessCapabilities().set_implicit_omit();
if (!spare__bits().is_bound()) spare__bits() = OMIT_VALUE;
else spare__bits().set_implicit_omit();
}

void AccessCapabilitiesStruct::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct has 3 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().set_param(*param.get_elem(2));
    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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapabilities().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(), "spare_bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__bits().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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
  }
}

void AccessCapabilitiesStruct::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_accessCapabilities.encode_text(text_buf);
field_spare__bits.encode_text(text_buf);
}

void AccessCapabilitiesStruct::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_accessCapabilities.decode_text(text_buf);
field_spare__bits.decode_text(text_buf);
}

void AccessCapabilitiesStruct::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessCapabilitiesStruct::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessCapabilitiesStruct::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;
  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, AccessCapabilitiesStruct_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AccessCapabilitiesStruct_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(AccessCapabilitiesStruct_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapabilitiesStruct_accessCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_accessCapabilities.RAW_decode(AccessCapabilitiesStruct_accessCapabilities_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_spare__bits = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapabilitiesStruct_spare__bits_descr_.raw->forceomit);
  decoded_field_length = field_spare__bits().RAW_decode(AccessCapabilitiesStruct_spare__bits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_spare__bits = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  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;
  }
  }
  }
  else field_spare__bits=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapabilitiesStruct::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapabilitiesStruct_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapabilitiesStruct_accessCapabilities_descr_.raw);
  if (field_spare__bits.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapabilitiesStruct_spare__bits_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += 7;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &AccessCapabilitiesStruct_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[0]->length = 7;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  if (field_spare__bits.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = 0;
  }
  encoded_length += field_accessCapabilities.RAW_encode(AccessCapabilitiesStruct_accessCapabilities_descr_, *myleaf.body.node.nodes[1]);
  if (field_spare__bits.ispresent()) {
  encoded_length += field_spare__bits().RAW_encode(AccessCapabilitiesStruct_spare__bits_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapabilitiesStruct_template::single_value_struct {
INTEGER_template field_lengthIndicator;
AccessCapabilities_template field_accessCapabilities;
BITSTRING_template field_spare__bits;
};

void AccessCapabilitiesStruct_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_lengthIndicator = ANY_VALUE;
single_value->field_accessCapabilities = ANY_VALUE;
single_value->field_spare__bits = ANY_OR_OMIT;
}
}
}

void AccessCapabilitiesStruct_template::copy_value(const AccessCapabilitiesStruct& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.accessCapabilities().is_bound()) {
  single_value->field_accessCapabilities = other_value.accessCapabilities();
} else {
  single_value->field_accessCapabilities.clean_up();
}
if (other_value.spare__bits().is_bound()) {
  if (other_value.spare__bits().ispresent()) single_value->field_spare__bits = other_value.spare__bits()();
  else single_value->field_spare__bits = OMIT_VALUE;
} else {
  single_value->field_spare__bits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapabilitiesStruct_template::copy_template(const AccessCapabilitiesStruct_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapabilities().get_selection()) {
single_value->field_accessCapabilities = other_value.accessCapabilities();
} else {
single_value->field_accessCapabilities.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare__bits().get_selection()) {
single_value->field_spare__bits = other_value.spare__bits();
} else {
single_value->field_spare__bits.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 AccessCapabilitiesStruct_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 AccessCapabilitiesStruct_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapabilitiesStruct_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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
break;
}
set_selection(other_value);
}

AccessCapabilitiesStruct_template::AccessCapabilitiesStruct_template()
{
}

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

AccessCapabilitiesStruct_template::AccessCapabilitiesStruct_template(const AccessCapabilitiesStruct& other_value)
{
copy_value(other_value);
}

AccessCapabilitiesStruct_template::AccessCapabilitiesStruct_template(const OPTIONAL<AccessCapabilitiesStruct>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapabilitiesStruct&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct from an unbound optional field.");
}
}

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

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

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

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

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

AccessCapabilitiesStruct_template& AccessCapabilitiesStruct_template::operator=(const AccessCapabilitiesStruct& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessCapabilitiesStruct_template& AccessCapabilitiesStruct_template::operator=(const OPTIONAL<AccessCapabilitiesStruct>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessCapabilitiesStruct&)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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
}
return *this;
}

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

boolean AccessCapabilitiesStruct_template::match(const AccessCapabilitiesStruct& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.accessCapabilities().is_bound()) return FALSE;
if(!single_value->field_accessCapabilities.match(other_value.accessCapabilities(), legacy))return FALSE;
if(!other_value.spare__bits().is_bound()) return FALSE;
if((other_value.spare__bits().ispresent() ? !single_value->field_spare__bits.match((const BITSTRING&)other_value.spare__bits(), legacy) : !single_value->field_spare__bits.match_omit(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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
}
return FALSE;
}

boolean AccessCapabilitiesStruct_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_accessCapabilities.is_bound()
 || (single_value->field_spare__bits.is_omit() || single_value->field_spare__bits.is_bound());
}

boolean AccessCapabilitiesStruct_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_accessCapabilities.is_value()
 && (single_value->field_spare__bits.is_omit() || single_value->field_spare__bits.is_value());
}

void AccessCapabilitiesStruct_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;
}

AccessCapabilitiesStruct AccessCapabilitiesStruct_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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
AccessCapabilitiesStruct ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_accessCapabilities.is_bound()) {
ret_val.accessCapabilities() = single_value->field_accessCapabilities.valueof();
}
if (single_value->field_spare__bits.is_omit()) ret_val.spare__bits() = OMIT_VALUE;
else if (single_value->field_spare__bits.is_bound()) {
ret_val.spare__bits() = single_value->field_spare__bits.valueof();
}
return ret_val;
}

void AccessCapabilitiesStruct_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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapabilitiesStruct_template[list_length];
}

AccessCapabilitiesStruct_template& AccessCapabilitiesStruct_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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
return value_list.list_value[list_index];
}

INTEGER_template& AccessCapabilitiesStruct_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& AccessCapabilitiesStruct_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
return single_value->field_lengthIndicator;
}

AccessCapabilities_template& AccessCapabilitiesStruct_template::accessCapabilities()
{
set_specific();
return single_value->field_accessCapabilities;
}

const AccessCapabilities_template& AccessCapabilitiesStruct_template::accessCapabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapabilities of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
return single_value->field_accessCapabilities;
}

BITSTRING_template& AccessCapabilitiesStruct_template::spare__bits()
{
set_specific();
return single_value->field_spare__bits;
}

const BITSTRING_template& AccessCapabilitiesStruct_template::spare__bits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare_bits of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
return single_value->field_spare__bits;
}

int AccessCapabilitiesStruct_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_spare__bits.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct 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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
  }
  return 0;
}

void AccessCapabilitiesStruct_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessCapabilities := ");
single_value->field_accessCapabilities.log();
TTCN_Logger::log_event_str(", spare_bits := ");
single_value->field_spare__bits.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 AccessCapabilitiesStruct_template::log_match(const AccessCapabilitiesStruct& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapabilities.match(match_value.accessCapabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapabilities");
single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.spare__bits().ispresent()){
if(!single_value->field_spare__bits.match(match_value.spare__bits(), legacy)){
TTCN_Logger::log_logmatch_info(".spare_bits");
single_value->field_spare__bits.log_match(match_value.spare__bits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spare__bits.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spare_bits := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spare__bits.log();
TTCN_Logger::log_event_str(" unmatched");
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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", accessCapabilities := ");
single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), legacy);
TTCN_Logger::log_event_str(", spare_bits := ");
if (match_value.spare__bits().ispresent()) {
single_value->field_spare__bits.log_match(match_value.spare__bits(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spare__bits.log();
if (single_value->field_spare__bits.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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 AccessCapabilitiesStruct_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_accessCapabilities.encode_text(text_buf);
single_value->field_spare__bits.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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
}
}

void AccessCapabilitiesStruct_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_lengthIndicator.decode_text(text_buf);
single_value->field_accessCapabilities.decode_text(text_buf);
single_value->field_spare__bits.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 AccessCapabilitiesStruct_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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct.");
}
}

void AccessCapabilitiesStruct_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: {
    AccessCapabilitiesStruct_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct has 3 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().set_param(*param.get_elem(2));
    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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapabilities().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(), "spare_bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__bits().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 @MobileL3_GMM_SM_Types.AccessCapabilitiesStruct: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapabilitiesStruct_template* precondition = new AccessCapabilitiesStruct_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapabilitiesStruct_template* implied_template = new AccessCapabilitiesStruct_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapabilitiesStruct_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapabilitiesStruct_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
single_value->field_accessCapabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
single_value->field_spare__bits.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
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 : "@MobileL3_GMM_SM_Types.AccessCapabilitiesStruct");
}

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

boolean AccessCapabilitiesStruct_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;
}

MSRACapabilityValuesExclude1111::MSRACapabilityValuesExclude1111()
{
}

MSRACapabilityValuesExclude1111::MSRACapabilityValuesExclude1111(const BITSTRING& par_accessTechnType,
    const AccessCapabilitiesStruct& par_accessCapabilities)
  :   field_accessTechnType(par_accessTechnType),
  field_accessCapabilities(par_accessCapabilities)
{
}

MSRACapabilityValuesExclude1111::MSRACapabilityValuesExclude1111(const MSRACapabilityValuesExclude1111& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
else field_accessTechnType.clean_up();
if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities();
else field_accessCapabilities.clean_up();
}

void MSRACapabilityValuesExclude1111::clean_up()
{
field_accessTechnType.clean_up();
field_accessCapabilities.clean_up();
}

const TTCN_Typedescriptor_t* MSRACapabilityValuesExclude1111::get_descriptor() const { return &MSRACapabilityValuesExclude1111_descr_; }
MSRACapabilityValuesExclude1111& MSRACapabilityValuesExclude1111::operator=(const MSRACapabilityValuesExclude1111& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
  if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
  else field_accessTechnType.clean_up();
  if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities();
  else field_accessCapabilities.clean_up();
}
return *this;
}

boolean MSRACapabilityValuesExclude1111::operator==(const MSRACapabilityValuesExclude1111& other_value) const
{
return field_accessTechnType==other_value.field_accessTechnType
  && field_accessCapabilities==other_value.field_accessCapabilities;
}

boolean MSRACapabilityValuesExclude1111::is_bound() const
{
return (field_accessTechnType.is_bound())
  || (field_accessCapabilities.is_bound());
}
boolean MSRACapabilityValuesExclude1111::is_value() const
{
return field_accessTechnType.is_value()
  && field_accessCapabilities.is_value();
}
void MSRACapabilityValuesExclude1111::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessTechnType := ");
field_accessTechnType.log();
TTCN_Logger::log_event_str(", accessCapabilities := ");
field_accessCapabilities.log();
TTCN_Logger::log_event_str(" }");
}

void MSRACapabilityValuesExclude1111::set_implicit_omit()
{
if (accessTechnType().is_bound()) accessTechnType().set_implicit_omit();
if (accessCapabilities().is_bound()) accessCapabilities().set_implicit_omit();
}

void MSRACapabilityValuesExclude1111::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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "accessCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapabilities().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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111");
  }
}

void MSRACapabilityValuesExclude1111::encode_text(Text_Buf& text_buf) const
{
field_accessTechnType.encode_text(text_buf);
field_accessCapabilities.encode_text(text_buf);
}

void MSRACapabilityValuesExclude1111::decode_text(Text_Buf& text_buf)
{
field_accessTechnType.decode_text(text_buf);
field_accessCapabilities.decode_text(text_buf);
}

void MSRACapabilityValuesExclude1111::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MSRACapabilityValuesExclude1111::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MSRACapabilityValuesExclude1111::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesExclude1111_accessTechnType_descr_.raw->forceomit);
  decoded_field_length = field_accessTechnType.RAW_decode(MSRACapabilityValuesExclude1111_accessTechnType_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValuesExclude1111_accessCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_accessCapabilities.RAW_decode(MSRACapabilityValuesExclude1111_accessCapabilities_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_accessTechnType !=  bs_3 && field_accessTechnType !=  bs_4 && field_accessTechnType !=  bs_5 && field_accessTechnType !=  bs_6 && field_accessTechnType !=  bs_7 && field_accessTechnType !=  bs_8 && field_accessTechnType !=  bs_9 && field_accessTechnType !=  bs_0 && field_accessTechnType !=  bs_10 && field_accessTechnType !=  bs_1 && field_accessTechnType !=  bs_11 && field_accessTechnType !=  bs_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MSRACapabilityValuesExclude1111::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, MSRACapabilityValuesExclude1111_accessTechnType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValuesExclude1111_accessCapabilities_descr_.raw);
  encoded_length += field_accessTechnType.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_accessCapabilities.RAW_encode(MSRACapabilityValuesExclude1111_accessCapabilities_descr_, *myleaf.body.node.nodes[1]);
  if (field_accessTechnType !=  bs_3 && field_accessTechnType !=  bs_4 && field_accessTechnType !=  bs_5 && field_accessTechnType !=  bs_6 && field_accessTechnType !=  bs_7 && field_accessTechnType !=  bs_8 && field_accessTechnType !=  bs_9 && field_accessTechnType !=  bs_0 && field_accessTechnType !=  bs_10 && field_accessTechnType !=  bs_1 && field_accessTechnType !=  bs_11 && field_accessTechnType !=  bs_12) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_3.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+1;
  int new_pos1[]={0};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_4.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+1;
  int new_pos2[]={0};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_5.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos3;
  pr_pos3.level=myleaf.curr_pos.level+1;
  int new_pos3[]={0};
  pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos3);
  temp_leaf = myleaf.get_node(pr_pos3);
  if(temp_leaf != NULL){
   bs_6.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos4;
  pr_pos4.level=myleaf.curr_pos.level+1;
  int new_pos4[]={0};
  pr_pos4.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos4);
  temp_leaf = myleaf.get_node(pr_pos4);
  if(temp_leaf != NULL){
   bs_7.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos5;
  pr_pos5.level=myleaf.curr_pos.level+1;
  int new_pos5[]={0};
  pr_pos5.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos5);
  temp_leaf = myleaf.get_node(pr_pos5);
  if(temp_leaf != NULL){
   bs_8.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos6;
  pr_pos6.level=myleaf.curr_pos.level+1;
  int new_pos6[]={0};
  pr_pos6.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos6);
  temp_leaf = myleaf.get_node(pr_pos6);
  if(temp_leaf != NULL){
   bs_9.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos7;
  pr_pos7.level=myleaf.curr_pos.level+1;
  int new_pos7[]={0};
  pr_pos7.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos7);
  temp_leaf = myleaf.get_node(pr_pos7);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos8;
  pr_pos8.level=myleaf.curr_pos.level+1;
  int new_pos8[]={0};
  pr_pos8.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos8);
  temp_leaf = myleaf.get_node(pr_pos8);
  if(temp_leaf != NULL){
   bs_10.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos9;
  pr_pos9.level=myleaf.curr_pos.level+1;
  int new_pos9[]={0};
  pr_pos9.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos9);
  temp_leaf = myleaf.get_node(pr_pos9);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos10;
  pr_pos10.level=myleaf.curr_pos.level+1;
  int new_pos10[]={0};
  pr_pos10.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos10);
  temp_leaf = myleaf.get_node(pr_pos10);
  if(temp_leaf != NULL){
   bs_11.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos11;
  pr_pos11.level=myleaf.curr_pos.level+1;
  int new_pos11[]={0};
  pr_pos11.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos11);
  temp_leaf = myleaf.get_node(pr_pos11);
  if(temp_leaf != NULL){
   bs_12.RAW_encode(MSRACapabilityValuesExclude1111_accessTechnType_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos11.pos);
  }
  free_tree_pos(pr_pos10.pos);
  }
  free_tree_pos(pr_pos9.pos);
  }
  free_tree_pos(pr_pos8.pos);
  }
  free_tree_pos(pr_pos7.pos);
  }
  free_tree_pos(pr_pos6.pos);
  }
  free_tree_pos(pr_pos5.pos);
  }
  free_tree_pos(pr_pos4.pos);
  }
  free_tree_pos(pr_pos3.pos);
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MSRACapabilityValuesExclude1111_template::single_value_struct {
BITSTRING_template field_accessTechnType;
AccessCapabilitiesStruct_template field_accessCapabilities;
};

void MSRACapabilityValuesExclude1111_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_accessTechnType = ANY_VALUE;
single_value->field_accessCapabilities = ANY_VALUE;
}
}
}

void MSRACapabilityValuesExclude1111_template::copy_value(const MSRACapabilityValuesExclude1111& other_value)
{
single_value = new single_value_struct;
if (other_value.accessTechnType().is_bound()) {
  single_value->field_accessTechnType = other_value.accessTechnType();
} else {
  single_value->field_accessTechnType.clean_up();
}
if (other_value.accessCapabilities().is_bound()) {
  single_value->field_accessCapabilities = other_value.accessCapabilities();
} else {
  single_value->field_accessCapabilities.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MSRACapabilityValuesExclude1111_template::copy_template(const MSRACapabilityValuesExclude1111_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) {
single_value->field_accessTechnType = other_value.accessTechnType();
} else {
single_value->field_accessTechnType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapabilities().get_selection()) {
single_value->field_accessCapabilities = other_value.accessCapabilities();
} else {
single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111_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 MSRACapabilityValuesExclude1111_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
break;
}
set_selection(other_value);
}

MSRACapabilityValuesExclude1111_template::MSRACapabilityValuesExclude1111_template()
{
}

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

MSRACapabilityValuesExclude1111_template::MSRACapabilityValuesExclude1111_template(const MSRACapabilityValuesExclude1111& other_value)
{
copy_value(other_value);
}

MSRACapabilityValuesExclude1111_template::MSRACapabilityValuesExclude1111_template(const OPTIONAL<MSRACapabilityValuesExclude1111>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValuesExclude1111&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 from an unbound optional field.");
}
}

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

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

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

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

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

MSRACapabilityValuesExclude1111_template& MSRACapabilityValuesExclude1111_template::operator=(const MSRACapabilityValuesExclude1111& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MSRACapabilityValuesExclude1111_template& MSRACapabilityValuesExclude1111_template::operator=(const OPTIONAL<MSRACapabilityValuesExclude1111>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValuesExclude1111&)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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
}
return *this;
}

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

boolean MSRACapabilityValuesExclude1111_template::match(const MSRACapabilityValuesExclude1111& 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.accessTechnType().is_bound()) return FALSE;
if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE;
if(!other_value.accessCapabilities().is_bound()) return FALSE;
if(!single_value->field_accessCapabilities.match(other_value.accessCapabilities(), 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
}
return FALSE;
}

boolean MSRACapabilityValuesExclude1111_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessTechnType.is_bound()
 || single_value->field_accessCapabilities.is_bound();
}

boolean MSRACapabilityValuesExclude1111_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessTechnType.is_value()
 && single_value->field_accessCapabilities.is_value();
}

void MSRACapabilityValuesExclude1111_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;
}

MSRACapabilityValuesExclude1111 MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
MSRACapabilityValuesExclude1111 ret_val;
if (single_value->field_accessTechnType.is_bound()) {
ret_val.accessTechnType() = single_value->field_accessTechnType.valueof();
}
if (single_value->field_accessCapabilities.is_bound()) {
ret_val.accessCapabilities() = single_value->field_accessCapabilities.valueof();
}
return ret_val;
}

void MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSRACapabilityValuesExclude1111_template[list_length];
}

MSRACapabilityValuesExclude1111_template& MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
return value_list.list_value[list_index];
}

BITSTRING_template& MSRACapabilityValuesExclude1111_template::accessTechnType()
{
set_specific();
return single_value->field_accessTechnType;
}

const BITSTRING_template& MSRACapabilityValuesExclude1111_template::accessTechnType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessTechnType of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
return single_value->field_accessTechnType;
}

AccessCapabilitiesStruct_template& MSRACapabilityValuesExclude1111_template::accessCapabilities()
{
set_specific();
return single_value->field_accessCapabilities;
}

const AccessCapabilitiesStruct_template& MSRACapabilityValuesExclude1111_template::accessCapabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapabilities of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
return single_value->field_accessCapabilities;
}

int MSRACapabilityValuesExclude1111_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
  }
  return 0;
}

void MSRACapabilityValuesExclude1111_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessTechnType := ");
single_value->field_accessTechnType.log();
TTCN_Logger::log_event_str(", accessCapabilities := ");
single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111_template::log_match(const MSRACapabilityValuesExclude1111& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){
TTCN_Logger::log_logmatch_info(".accessTechnType");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessCapabilities.match(match_value.accessCapabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapabilities");
single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), 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("{ accessTechnType := ");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::log_event_str(", accessCapabilities := ");
single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), 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 MSRACapabilityValuesExclude1111_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessTechnType.encode_text(text_buf);
single_value->field_accessCapabilities.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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
}
}

void MSRACapabilityValuesExclude1111_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_accessTechnType.decode_text(text_buf);
single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111.");
}
}

void MSRACapabilityValuesExclude1111_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: {
    MSRACapabilityValuesExclude1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "accessCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapabilities().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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRACapabilityValuesExclude1111_template* precondition = new MSRACapabilityValuesExclude1111_template;
    precondition->set_param(*param.get_elem(0));
    MSRACapabilityValuesExclude1111_template* implied_template = new MSRACapabilityValuesExclude1111_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MSRACapabilityValuesExclude1111_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111");
  }
  is_ifpresent = param.get_ifpresent();
}

void MSRACapabilityValuesExclude1111_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111");
single_value->field_accessCapabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111");
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 : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesExclude1111");
}

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

boolean MSRACapabilityValuesExclude1111_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;
}

MSRACapabilityValues1111::MSRACapabilityValues1111()
{
}

MSRACapabilityValues1111::MSRACapabilityValues1111(const BITSTRING& par_accessTechnType,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_presenceIndicator__AdditionalAccessTechnologiesRepetition,
    const OPTIONAL< AdditionalAccessTechnologiesRepetition >& par_additionalAccessTechnologiesRepetition,
    const BITSTRING& par_spare__bits)
  :   field_accessTechnType(par_accessTechnType),
  field_lengthIndicator(par_lengthIndicator),
  field_presenceIndicator__AdditionalAccessTechnologiesRepetition(par_presenceIndicator__AdditionalAccessTechnologiesRepetition),
  field_additionalAccessTechnologiesRepetition(par_additionalAccessTechnologiesRepetition),
  field_spare__bits(par_spare__bits)
{
}

MSRACapabilityValues1111::MSRACapabilityValues1111(const MSRACapabilityValues1111& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
else field_accessTechnType.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition();
else field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up();
if (other_value.additionalAccessTechnologiesRepetition().is_bound()) field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition();
else field_additionalAccessTechnologiesRepetition.clean_up();
if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits();
else field_spare__bits.clean_up();
}

void MSRACapabilityValues1111::clean_up()
{
field_accessTechnType.clean_up();
field_lengthIndicator.clean_up();
field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up();
field_additionalAccessTechnologiesRepetition.clean_up();
field_spare__bits.clean_up();
}

const TTCN_Typedescriptor_t* MSRACapabilityValues1111::get_descriptor() const { return &MSRACapabilityValues1111_descr_; }
MSRACapabilityValues1111& MSRACapabilityValues1111::operator=(const MSRACapabilityValues1111& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
  if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
  else field_accessTechnType.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition();
  else field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up();
  if (other_value.additionalAccessTechnologiesRepetition().is_bound()) field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition();
  else field_additionalAccessTechnologiesRepetition.clean_up();
  if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits();
  else field_spare__bits.clean_up();
}
return *this;
}

boolean MSRACapabilityValues1111::operator==(const MSRACapabilityValues1111& other_value) const
{
return field_accessTechnType==other_value.field_accessTechnType
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_presenceIndicator__AdditionalAccessTechnologiesRepetition==other_value.field_presenceIndicator__AdditionalAccessTechnologiesRepetition
  && field_additionalAccessTechnologiesRepetition==other_value.field_additionalAccessTechnologiesRepetition
  && field_spare__bits==other_value.field_spare__bits;
}

boolean MSRACapabilityValues1111::is_bound() const
{
return (field_accessTechnType.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound())
  || (OPTIONAL_OMIT == field_additionalAccessTechnologiesRepetition.get_selection() || field_additionalAccessTechnologiesRepetition.is_bound())
  || (field_spare__bits.is_bound());
}
boolean MSRACapabilityValues1111::is_value() const
{
return field_accessTechnType.is_value()
  && field_lengthIndicator.is_value()
  && field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_value()
  && (OPTIONAL_OMIT == field_additionalAccessTechnologiesRepetition.get_selection() || field_additionalAccessTechnologiesRepetition.is_value())
  && field_spare__bits.is_value();
}
int MSRACapabilityValues1111::size_of() const
{
  int ret_val = 4;
  if (field_additionalAccessTechnologiesRepetition.ispresent()) ret_val++;
  return ret_val;
}

void MSRACapabilityValues1111::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessTechnType := ");
field_accessTechnType.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := ");
field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log();
TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := ");
field_additionalAccessTechnologiesRepetition.log();
TTCN_Logger::log_event_str(", spare_bits := ");
field_spare__bits.log();
TTCN_Logger::log_event_str(" }");
}

void MSRACapabilityValues1111::set_implicit_omit()
{
if (accessTechnType().is_bound()) accessTechnType().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_implicit_omit();
if (!additionalAccessTechnologiesRepetition().is_bound()) additionalAccessTechnologiesRepetition() = OMIT_VALUE;
else additionalAccessTechnologiesRepetition().set_implicit_omit();
if (spare__bits().is_bound()) spare__bits().set_implicit_omit();
}

void MSRACapabilityValues1111::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 (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 has 5 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) additionalAccessTechnologiesRepetition().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare__bits().set_param(*param.get_elem(4));
    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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "presenceIndicator_AdditionalAccessTechnologiesRepetition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceIndicator__AdditionalAccessTechnologiesRepetition().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(), "additionalAccessTechnologiesRepetition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalAccessTechnologiesRepetition().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(), "spare_bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__bits().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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
  }
}

void MSRACapabilityValues1111::encode_text(Text_Buf& text_buf) const
{
field_accessTechnType.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_presenceIndicator__AdditionalAccessTechnologiesRepetition.encode_text(text_buf);
field_additionalAccessTechnologiesRepetition.encode_text(text_buf);
field_spare__bits.encode_text(text_buf);
}

void MSRACapabilityValues1111::decode_text(Text_Buf& text_buf)
{
field_accessTechnType.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_presenceIndicator__AdditionalAccessTechnologiesRepetition.decode_text(text_buf);
field_additionalAccessTechnologiesRepetition.decode_text(text_buf);
field_spare__bits.decode_text(text_buf);
}

void MSRACapabilityValues1111::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MSRACapabilityValues1111::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MSRACapabilityValues1111::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValues1111_accessTechnType_descr_.raw->forceomit);
  decoded_field_length = field_accessTechnType.RAW_decode(MSRACapabilityValues1111_accessTechnType_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValues1111_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MSRACapabilityValues1111_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(MSRACapabilityValues1111_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MSRACapabilityValues1111_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_.raw->forceomit);
  decoded_field_length = field_presenceIndicator__AdditionalAccessTechnologiesRepetition.RAW_decode(MSRACapabilityValues1111_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (limit > 0 && value_of_length_field1 > 0 && field_presenceIndicator__AdditionalAccessTechnologiesRepetition ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_additionalAccessTechnologiesRepetition = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MSRACapabilityValues1111_additionalAccessTechnologiesRepetition_descr_.raw->forceomit);
  decoded_field_length = field_additionalAccessTechnologiesRepetition().RAW_decode(MSRACapabilityValues1111_additionalAccessTechnologiesRepetition_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_additionalAccessTechnologiesRepetition = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_additionalAccessTechnologiesRepetition=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, MSRACapabilityValues1111_spare__bits_descr_.raw->forceomit);
  decoded_field_length = field_spare__bits.RAW_decode(MSRACapabilityValues1111_spare__bits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_4_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_field1 -= decoded_field_length;
  if (field_accessTechnType !=  bs_13) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MSRACapabilityValues1111::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 = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MSRACapabilityValues1111_accessTechnType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValues1111_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MSRACapabilityValues1111_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_.raw);
  if (field_additionalAccessTechnologiesRepetition.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MSRACapabilityValues1111_additionalAccessTechnologiesRepetition_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MSRACapabilityValues1111_spare__bits_descr_.raw);
  encoded_length += field_accessTechnType.RAW_encode(MSRACapabilityValues1111_accessTechnType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 7;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &MSRACapabilityValues1111_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[1]->length = 7;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  if (field_additionalAccessTechnologiesRepetition.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = 0;
  }
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_presenceIndicator__AdditionalAccessTechnologiesRepetition.RAW_encode(MSRACapabilityValues1111_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_, *myleaf.body.node.nodes[2]);
  if (field_additionalAccessTechnologiesRepetition.ispresent()) {
  encoded_length += field_additionalAccessTechnologiesRepetition().RAW_encode(MSRACapabilityValues1111_additionalAccessTechnologiesRepetition_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_spare__bits.RAW_encode(MSRACapabilityValues1111_spare__bits_descr_, *myleaf.body.node.nodes[4]);
  if (field_additionalAccessTechnologiesRepetition.ispresent() && (field_presenceIndicator__AdditionalAccessTechnologiesRepetition !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(MSRACapabilityValues1111_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_accessTechnType !=  bs_13) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_13.RAW_encode(MSRACapabilityValues1111_accessTechnType_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MSRACapabilityValues1111_template::single_value_struct {
BITSTRING_template field_accessTechnType;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_presenceIndicator__AdditionalAccessTechnologiesRepetition;
AdditionalAccessTechnologiesRepetition_template field_additionalAccessTechnologiesRepetition;
BITSTRING_template field_spare__bits;
};

void MSRACapabilityValues1111_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_accessTechnType = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = ANY_VALUE;
single_value->field_additionalAccessTechnologiesRepetition = ANY_OR_OMIT;
single_value->field_spare__bits = ANY_VALUE;
}
}
}

void MSRACapabilityValues1111_template::copy_value(const MSRACapabilityValues1111& other_value)
{
single_value = new single_value_struct;
if (other_value.accessTechnType().is_bound()) {
  single_value->field_accessTechnType = other_value.accessTechnType();
} else {
  single_value->field_accessTechnType.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) {
  single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition();
} else {
  single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up();
}
if (other_value.additionalAccessTechnologiesRepetition().is_bound()) {
  if (other_value.additionalAccessTechnologiesRepetition().ispresent()) single_value->field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition()();
  else single_value->field_additionalAccessTechnologiesRepetition = OMIT_VALUE;
} else {
  single_value->field_additionalAccessTechnologiesRepetition.clean_up();
}
if (other_value.spare__bits().is_bound()) {
  single_value->field_spare__bits = other_value.spare__bits();
} else {
  single_value->field_spare__bits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MSRACapabilityValues1111_template::copy_template(const MSRACapabilityValues1111_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) {
single_value->field_accessTechnType = other_value.accessTechnType();
} else {
single_value->field_accessTechnType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().get_selection()) {
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition();
} else {
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalAccessTechnologiesRepetition().get_selection()) {
single_value->field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition();
} else {
single_value->field_additionalAccessTechnologiesRepetition.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare__bits().get_selection()) {
single_value->field_spare__bits = other_value.spare__bits();
} else {
single_value->field_spare__bits.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 MSRACapabilityValues1111_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 MSRACapabilityValues1111_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRACapabilityValues1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
break;
}
set_selection(other_value);
}

MSRACapabilityValues1111_template::MSRACapabilityValues1111_template()
{
}

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

MSRACapabilityValues1111_template::MSRACapabilityValues1111_template(const MSRACapabilityValues1111& other_value)
{
copy_value(other_value);
}

MSRACapabilityValues1111_template::MSRACapabilityValues1111_template(const OPTIONAL<MSRACapabilityValues1111>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValues1111&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 from an unbound optional field.");
}
}

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

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

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

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

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

MSRACapabilityValues1111_template& MSRACapabilityValues1111_template::operator=(const MSRACapabilityValues1111& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MSRACapabilityValues1111_template& MSRACapabilityValues1111_template::operator=(const OPTIONAL<MSRACapabilityValues1111>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValues1111&)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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
}
return *this;
}

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

boolean MSRACapabilityValues1111_template::match(const MSRACapabilityValues1111& 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.accessTechnType().is_bound()) return FALSE;
if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) return FALSE;
if(!single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.match(other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy))return FALSE;
if(!other_value.additionalAccessTechnologiesRepetition().is_bound()) return FALSE;
if((other_value.additionalAccessTechnologiesRepetition().ispresent() ? !single_value->field_additionalAccessTechnologiesRepetition.match((const AdditionalAccessTechnologiesRepetition&)other_value.additionalAccessTechnologiesRepetition(), legacy) : !single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)))return FALSE;
if(!other_value.spare__bits().is_bound()) return FALSE;
if(!single_value->field_spare__bits.match(other_value.spare__bits(), 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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
}
return FALSE;
}

boolean MSRACapabilityValues1111_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessTechnType.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound()
 || (single_value->field_additionalAccessTechnologiesRepetition.is_omit() || single_value->field_additionalAccessTechnologiesRepetition.is_bound())
 || single_value->field_spare__bits.is_bound();
}

boolean MSRACapabilityValues1111_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessTechnType.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_value()
 && (single_value->field_additionalAccessTechnologiesRepetition.is_omit() || single_value->field_additionalAccessTechnologiesRepetition.is_value())
 && single_value->field_spare__bits.is_value();
}

void MSRACapabilityValues1111_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;
}

MSRACapabilityValues1111 MSRACapabilityValues1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
MSRACapabilityValues1111 ret_val;
if (single_value->field_accessTechnType.is_bound()) {
ret_val.accessTechnType() = single_value->field_accessTechnType.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound()) {
ret_val.presenceIndicator__AdditionalAccessTechnologiesRepetition() = single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.valueof();
}
if (single_value->field_additionalAccessTechnologiesRepetition.is_omit()) ret_val.additionalAccessTechnologiesRepetition() = OMIT_VALUE;
else if (single_value->field_additionalAccessTechnologiesRepetition.is_bound()) {
ret_val.additionalAccessTechnologiesRepetition() = single_value->field_additionalAccessTechnologiesRepetition.valueof();
}
if (single_value->field_spare__bits.is_bound()) {
ret_val.spare__bits() = single_value->field_spare__bits.valueof();
}
return ret_val;
}

void MSRACapabilityValues1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSRACapabilityValues1111_template[list_length];
}

MSRACapabilityValues1111_template& MSRACapabilityValues1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return value_list.list_value[list_index];
}

BITSTRING_template& MSRACapabilityValues1111_template::accessTechnType()
{
set_specific();
return single_value->field_accessTechnType;
}

const BITSTRING_template& MSRACapabilityValues1111_template::accessTechnType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessTechnType of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return single_value->field_accessTechnType;
}

INTEGER_template& MSRACapabilityValues1111_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MSRACapabilityValues1111_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& MSRACapabilityValues1111_template::presenceIndicator__AdditionalAccessTechnologiesRepetition()
{
set_specific();
return single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition;
}

const BITSTRING_template& MSRACapabilityValues1111_template::presenceIndicator__AdditionalAccessTechnologiesRepetition() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceIndicator_AdditionalAccessTechnologiesRepetition of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition;
}

AdditionalAccessTechnologiesRepetition_template& MSRACapabilityValues1111_template::additionalAccessTechnologiesRepetition()
{
set_specific();
return single_value->field_additionalAccessTechnologiesRepetition;
}

const AdditionalAccessTechnologiesRepetition_template& MSRACapabilityValues1111_template::additionalAccessTechnologiesRepetition() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalAccessTechnologiesRepetition of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return single_value->field_additionalAccessTechnologiesRepetition;
}

BITSTRING_template& MSRACapabilityValues1111_template::spare__bits()
{
set_specific();
return single_value->field_spare__bits;
}

const BITSTRING_template& MSRACapabilityValues1111_template::spare__bits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare_bits of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
return single_value->field_spare__bits;
}

int MSRACapabilityValues1111_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_additionalAccessTechnologiesRepetition.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
  }
  return 0;
}

void MSRACapabilityValues1111_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessTechnType := ");
single_value->field_accessTechnType.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := ");
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log();
TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := ");
single_value->field_additionalAccessTechnologiesRepetition.log();
TTCN_Logger::log_event_str(", spare_bits := ");
single_value->field_spare__bits.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 MSRACapabilityValues1111_template::log_match(const MSRACapabilityValues1111& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){
TTCN_Logger::log_logmatch_info(".accessTechnType");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceIndicator_AdditionalAccessTechnologiesRepetition");
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log_match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.additionalAccessTechnologiesRepetition().ispresent()){
if(!single_value->field_additionalAccessTechnologiesRepetition.match(match_value.additionalAccessTechnologiesRepetition(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalAccessTechnologiesRepetition");
single_value->field_additionalAccessTechnologiesRepetition.log_match(match_value.additionalAccessTechnologiesRepetition(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalAccessTechnologiesRepetition := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalAccessTechnologiesRepetition.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_spare__bits.match(match_value.spare__bits(), legacy)){
TTCN_Logger::log_logmatch_info(".spare_bits");
single_value->field_spare__bits.log_match(match_value.spare__bits(), 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("{ accessTechnType := ");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := ");
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log_match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy);
TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := ");
if (match_value.additionalAccessTechnologiesRepetition().ispresent()) {
single_value->field_additionalAccessTechnologiesRepetition.log_match(match_value.additionalAccessTechnologiesRepetition(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalAccessTechnologiesRepetition.log();
if (single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", spare_bits := ");
single_value->field_spare__bits.log_match(match_value.spare__bits(), 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 MSRACapabilityValues1111_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessTechnType.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.encode_text(text_buf);
single_value->field_additionalAccessTechnologiesRepetition.encode_text(text_buf);
single_value->field_spare__bits.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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
}
}

void MSRACapabilityValues1111_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_accessTechnType.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.decode_text(text_buf);
single_value->field_additionalAccessTechnologiesRepetition.decode_text(text_buf);
single_value->field_spare__bits.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 MSRACapabilityValues1111_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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111.");
}
}

void MSRACapabilityValues1111_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: {
    MSRACapabilityValues1111_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 (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues1111 has 5 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) additionalAccessTechnologiesRepetition().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare__bits().set_param(*param.get_elem(4));
    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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "presenceIndicator_AdditionalAccessTechnologiesRepetition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceIndicator__AdditionalAccessTechnologiesRepetition().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(), "additionalAccessTechnologiesRepetition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalAccessTechnologiesRepetition().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(), "spare_bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__bits().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 @MobileL3_GMM_SM_Types.MSRACapabilityValues1111: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRACapabilityValues1111_template* precondition = new MSRACapabilityValues1111_template;
    precondition->set_param(*param.get_elem(0));
    MSRACapabilityValues1111_template* implied_template = new MSRACapabilityValues1111_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MSRACapabilityValues1111_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
  }
  is_ifpresent = param.get_ifpresent();
}

void MSRACapabilityValues1111_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
single_value->field_additionalAccessTechnologiesRepetition.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
single_value->field_spare__bits.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
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 : "@MobileL3_GMM_SM_Types.MSRACapabilityValues1111");
}

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

boolean MSRACapabilityValues1111_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;
}


const AdditionalAccessTechnologiesRecord AdditionalAccessTechnologiesRepetition::UNBOUND_ELEM;
AdditionalAccessTechnologiesRepetition::AdditionalAccessTechnologiesRepetition()
{
val_ptr = NULL;
}

AdditionalAccessTechnologiesRepetition::AdditionalAccessTechnologiesRepetition(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

AdditionalAccessTechnologiesRepetition::AdditionalAccessTechnologiesRepetition(const AdditionalAccessTechnologiesRepetition& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

AdditionalAccessTechnologiesRepetition::~AdditionalAccessTechnologiesRepetition()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void AdditionalAccessTechnologiesRepetition::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

AdditionalAccessTechnologiesRepetition& AdditionalAccessTechnologiesRepetition::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

AdditionalAccessTechnologiesRepetition& AdditionalAccessTechnologiesRepetition::operator=(const AdditionalAccessTechnologiesRepetition& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean AdditionalAccessTechnologiesRepetition::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return val_ptr->n_elements == 0 ;
}

boolean AdditionalAccessTechnologiesRepetition::operator==(const AdditionalAccessTechnologiesRepetition& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

AdditionalAccessTechnologiesRecord& AdditionalAccessTechnologiesRepetition::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (AdditionalAccessTechnologiesRecord**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new AdditionalAccessTechnologiesRecord(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new AdditionalAccessTechnologiesRecord;
}
return *val_ptr->value_elements[index_value];
}

AdditionalAccessTechnologiesRecord& AdditionalAccessTechnologiesRepetition::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return (*this)[(int)index_value];
}

const AdditionalAccessTechnologiesRecord& AdditionalAccessTechnologiesRepetition::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const AdditionalAccessTechnologiesRecord& AdditionalAccessTechnologiesRepetition::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return (*this)[(int)index_value];
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
AdditionalAccessTechnologiesRepetition ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new AdditionalAccessTechnologiesRecord(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::operator+(const AdditionalAccessTechnologiesRepetition& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
AdditionalAccessTechnologiesRepetition ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new AdditionalAccessTechnologiesRecord(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new AdditionalAccessTechnologiesRecord(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition","element");
AdditionalAccessTechnologiesRepetition ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new AdditionalAccessTechnologiesRecord(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::replace(int index, int len, const AdditionalAccessTechnologiesRepetition& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
check_replace_arguments(val_ptr->n_elements, index, len, "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition","element");
AdditionalAccessTechnologiesRepetition ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new AdditionalAccessTechnologiesRecord(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new AdditionalAccessTechnologiesRecord(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new AdditionalAccessTechnologiesRecord(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition::replace(int index, int len, const AdditionalAccessTechnologiesRepetition_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void AdditionalAccessTechnologiesRepetition::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (AdditionalAccessTechnologiesRecord**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new AdditionalAccessTechnologiesRecord(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (AdditionalAccessTechnologiesRecord**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (AdditionalAccessTechnologiesRecord**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean AdditionalAccessTechnologiesRepetition::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int AdditionalAccessTechnologiesRepetition::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return val_ptr->n_elements;
}

int AdditionalAccessTechnologiesRepetition::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void AdditionalAccessTechnologiesRepetition::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void AdditionalAccessTechnologiesRepetition::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void AdditionalAccessTechnologiesRepetition::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void AdditionalAccessTechnologiesRepetition::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void AdditionalAccessTechnologiesRepetition::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
val_ptr->value_elements = (AdditionalAccessTechnologiesRecord**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new AdditionalAccessTechnologiesRecord;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void AdditionalAccessTechnologiesRepetition::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AdditionalAccessTechnologiesRepetition::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AdditionalAccessTechnologiesRepetition::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int decoded_field_length=0;
  size_t start_of_field=0;
  if(first_call) {
    clean_up();
    val_ptr=new recordof_setof_struct;
    val_ptr->ref_count=1;
    val_ptr->n_elements=0;
    val_ptr->value_elements=NULL;
  }
  int start_field=val_ptr->n_elements;
  if(p_td.raw->fieldlength || sel_field!=-1){
    int a=0;
    if(sel_field==-1) sel_field=p_td.raw->fieldlength;
    start_of_field=p_buf.get_pos_bit();
    for(a=0;a<sel_field;a++){
      decoded_field_length=(*this)[a+start_field].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        while(a>=0){
          delete &(*this)[a+start_field];
          a--;
          val_ptr->n_elements--;
        }
        p_buf.set_pos_bit(start_of_field);
        return decoded_field_length;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
    }
    if(a==0) val_ptr->n_elements=0;
  } else {
    if(limit==0){
      if(!first_call) return -1;
      val_ptr->n_elements=0;
      return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
    int a=start_field;
    while(limit>0){
      start_of_field=p_buf.get_pos_bit();
      decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        delete &(*this)[a];
        val_ptr->n_elements--;
        p_buf.set_pos_bit(start_of_field);
        if(a>start_field){
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
        } else return -1;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
      a++;
      if (!p_buf.get_last_bit())
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
  }
 return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
}

int AdditionalAccessTechnologiesRepetition::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{
  int encoded_length=0;
  int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements;
  myleaf.isleaf=FALSE;
  myleaf.rec_of=TRUE;
  myleaf.body.node.num_of_nodes=encoded_num_of_records;
  myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records);
  for(int a=0;a<encoded_num_of_records;a++){
    myleaf.body.node.nodes[a]=new RAW_enc_tree(TRUE,&myleaf,&(myleaf.curr_pos),a,p_td.oftype_descr->raw);
    encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]);
  }
 return myleaf.length=encoded_length;
}

void AdditionalAccessTechnologiesRepetition_template::copy_value(const AdditionalAccessTechnologiesRepetition& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (AdditionalAccessTechnologiesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void AdditionalAccessTechnologiesRepetition_template::copy_template(const AdditionalAccessTechnologiesRepetition_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (AdditionalAccessTechnologiesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template;
}
}
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 AdditionalAccessTechnologiesRepetition_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 AdditionalAccessTechnologiesRepetition_template(*other_value.implication_.precondition);
implication_.implied_template = new AdditionalAccessTechnologiesRepetition_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
break;
}
set_selection(other_value);
}

boolean AdditionalAccessTechnologiesRepetition_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const AdditionalAccessTechnologiesRepetition_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const AdditionalAccessTechnologiesRepetition*)value_ptr)[value_index], legacy);
else return ((const AdditionalAccessTechnologiesRepetition_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template()
{
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(const AdditionalAccessTechnologiesRepetition& other_value)
{
copy_value(other_value);
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(const OPTIONAL<AdditionalAccessTechnologiesRepetition>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologiesRepetition&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition from an unbound optional field.");
}
}

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

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(Dynamic_Match_Interface<AdditionalAccessTechnologiesRepetition>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<AdditionalAccessTechnologiesRepetition>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

AdditionalAccessTechnologiesRepetition_template::AdditionalAccessTechnologiesRepetition_template(const AdditionalAccessTechnologiesRepetition_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

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

void AdditionalAccessTechnologiesRepetition_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
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;
}

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

AdditionalAccessTechnologiesRepetition_template& AdditionalAccessTechnologiesRepetition_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

AdditionalAccessTechnologiesRepetition_template& AdditionalAccessTechnologiesRepetition_template::operator=(const AdditionalAccessTechnologiesRepetition& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AdditionalAccessTechnologiesRepetition_template& AdditionalAccessTechnologiesRepetition_template::operator=(const OPTIONAL<AdditionalAccessTechnologiesRepetition>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologiesRepetition&)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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
}
return *this;
}

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

AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRepetition_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
    break;
}
return *single_value.value_elements[index_value];
}

AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRepetition_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return (*this)[(int)index_value];
}

const AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRepetition_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRepetition_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
return (*this)[(int)index_value];
}

void AdditionalAccessTechnologiesRepetition_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (AdditionalAccessTechnologiesRecord_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (AdditionalAccessTechnologiesRecord_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int AdditionalAccessTechnologiesRepetition_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int AdditionalAccessTechnologiesRepetition_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
}

boolean AdditionalAccessTechnologiesRepetition_template::match(const AdditionalAccessTechnologiesRepetition& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
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, 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 with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
}
return FALSE;
}

boolean AdditionalAccessTechnologiesRepetition_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
AdditionalAccessTechnologiesRepetition ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition_template::replace(int index, int len, const AdditionalAccessTechnologiesRepetition_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

AdditionalAccessTechnologiesRepetition AdditionalAccessTechnologiesRepetition_template::replace(int index, int len, const AdditionalAccessTechnologiesRepetition& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void AdditionalAccessTechnologiesRepetition_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:
value_list.n_values = list_length;
value_list.list_value = new AdditionalAccessTechnologiesRepetition_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
}
set_selection(template_type);
}

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

void AdditionalAccessTechnologiesRepetition_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else 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_restricted();
log_ifpresent();
}

void AdditionalAccessTechnologiesRepetition_template::log_match(const AdditionalAccessTechnologiesRepetition& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} 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 AdditionalAccessTechnologiesRepetition_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
}
}

void AdditionalAccessTechnologiesRepetition_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
single_value.value_elements = (AdditionalAccessTechnologiesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord_template;
single_value.value_elements[elem_count]->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 AdditionalAccessTechnologiesRepetition_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 for a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition.");
}
}

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

boolean AdditionalAccessTechnologiesRepetition_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 AdditionalAccessTechnologiesRepetition_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: {
    AdditionalAccessTechnologiesRepetition_template temp;
    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++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AdditionalAccessTechnologiesRepetition_template* precondition = new AdditionalAccessTechnologiesRepetition_template;
    precondition->set_param(*param.get_elem(0));
    AdditionalAccessTechnologiesRepetition_template* implied_template = new AdditionalAccessTechnologiesRepetition_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AdditionalAccessTechnologiesRepetition_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void AdditionalAccessTechnologiesRepetition_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;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
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 : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRepetition");
}

boolean AdditionalAccessTechnologiesRepetition_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
AdditionalAccessTechnologies::AdditionalAccessTechnologies()
{
}

AdditionalAccessTechnologies::AdditionalAccessTechnologies(const BITSTRING& par_accessTechnType,
    const BITSTRING& par_gMSKPowerClass,
    const BITSTRING& par_psk8PowerClass)
  :   field_accessTechnType(par_accessTechnType),
  field_gMSKPowerClass(par_gMSKPowerClass),
  field_psk8PowerClass(par_psk8PowerClass)
{
}

AdditionalAccessTechnologies::AdditionalAccessTechnologies(const AdditionalAccessTechnologies& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
else field_accessTechnType.clean_up();
if (other_value.gMSKPowerClass().is_bound()) field_gMSKPowerClass = other_value.gMSKPowerClass();
else field_gMSKPowerClass.clean_up();
if (other_value.psk8PowerClass().is_bound()) field_psk8PowerClass = other_value.psk8PowerClass();
else field_psk8PowerClass.clean_up();
}

void AdditionalAccessTechnologies::clean_up()
{
field_accessTechnType.clean_up();
field_gMSKPowerClass.clean_up();
field_psk8PowerClass.clean_up();
}

const TTCN_Typedescriptor_t* AdditionalAccessTechnologies::get_descriptor() const { return &AdditionalAccessTechnologies_descr_; }
AdditionalAccessTechnologies& AdditionalAccessTechnologies::operator=(const AdditionalAccessTechnologies& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
  if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType();
  else field_accessTechnType.clean_up();
  if (other_value.gMSKPowerClass().is_bound()) field_gMSKPowerClass = other_value.gMSKPowerClass();
  else field_gMSKPowerClass.clean_up();
  if (other_value.psk8PowerClass().is_bound()) field_psk8PowerClass = other_value.psk8PowerClass();
  else field_psk8PowerClass.clean_up();
}
return *this;
}

boolean AdditionalAccessTechnologies::operator==(const AdditionalAccessTechnologies& other_value) const
{
return field_accessTechnType==other_value.field_accessTechnType
  && field_gMSKPowerClass==other_value.field_gMSKPowerClass
  && field_psk8PowerClass==other_value.field_psk8PowerClass;
}

boolean AdditionalAccessTechnologies::is_bound() const
{
return (field_accessTechnType.is_bound())
  || (field_gMSKPowerClass.is_bound())
  || (field_psk8PowerClass.is_bound());
}
boolean AdditionalAccessTechnologies::is_value() const
{
return field_accessTechnType.is_value()
  && field_gMSKPowerClass.is_value()
  && field_psk8PowerClass.is_value();
}
void AdditionalAccessTechnologies::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessTechnType := ");
field_accessTechnType.log();
TTCN_Logger::log_event_str(", gMSKPowerClass := ");
field_gMSKPowerClass.log();
TTCN_Logger::log_event_str(", psk8PowerClass := ");
field_psk8PowerClass.log();
TTCN_Logger::log_event_str(" }");
}

void AdditionalAccessTechnologies::set_implicit_omit()
{
if (accessTechnType().is_bound()) accessTechnType().set_implicit_omit();
if (gMSKPowerClass().is_bound()) gMSKPowerClass().set_implicit_omit();
if (psk8PowerClass().is_bound()) psk8PowerClass().set_implicit_omit();
}

void AdditionalAccessTechnologies::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies has 3 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gMSKPowerClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) psk8PowerClass().set_param(*param.get_elem(2));
    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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "gMSKPowerClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gMSKPowerClass().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(), "psk8PowerClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          psk8PowerClass().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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
  }
}

void AdditionalAccessTechnologies::encode_text(Text_Buf& text_buf) const
{
field_accessTechnType.encode_text(text_buf);
field_gMSKPowerClass.encode_text(text_buf);
field_psk8PowerClass.encode_text(text_buf);
}

void AdditionalAccessTechnologies::decode_text(Text_Buf& text_buf)
{
field_accessTechnType.decode_text(text_buf);
field_gMSKPowerClass.decode_text(text_buf);
field_psk8PowerClass.decode_text(text_buf);
}

void AdditionalAccessTechnologies::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AdditionalAccessTechnologies::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AdditionalAccessTechnologies::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AdditionalAccessTechnologies_accessTechnType_descr_.raw->forceomit);
  decoded_field_length = field_accessTechnType.RAW_decode(AdditionalAccessTechnologies_accessTechnType_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AdditionalAccessTechnologies_gMSKPowerClass_descr_.raw->forceomit);
  decoded_field_length = field_gMSKPowerClass.RAW_decode(AdditionalAccessTechnologies_gMSKPowerClass_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, AdditionalAccessTechnologies_psk8PowerClass_descr_.raw->forceomit);
  decoded_field_length = field_psk8PowerClass.RAW_decode(AdditionalAccessTechnologies_psk8PowerClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AdditionalAccessTechnologies::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AdditionalAccessTechnologies_accessTechnType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AdditionalAccessTechnologies_gMSKPowerClass_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AdditionalAccessTechnologies_psk8PowerClass_descr_.raw);
  encoded_length += field_accessTechnType.RAW_encode(AdditionalAccessTechnologies_accessTechnType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gMSKPowerClass.RAW_encode(AdditionalAccessTechnologies_gMSKPowerClass_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_psk8PowerClass.RAW_encode(AdditionalAccessTechnologies_psk8PowerClass_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct AdditionalAccessTechnologies_template::single_value_struct {
BITSTRING_template field_accessTechnType;
BITSTRING_template field_gMSKPowerClass;
BITSTRING_template field_psk8PowerClass;
};

void AdditionalAccessTechnologies_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_accessTechnType = ANY_VALUE;
single_value->field_gMSKPowerClass = ANY_VALUE;
single_value->field_psk8PowerClass = ANY_VALUE;
}
}
}

void AdditionalAccessTechnologies_template::copy_value(const AdditionalAccessTechnologies& other_value)
{
single_value = new single_value_struct;
if (other_value.accessTechnType().is_bound()) {
  single_value->field_accessTechnType = other_value.accessTechnType();
} else {
  single_value->field_accessTechnType.clean_up();
}
if (other_value.gMSKPowerClass().is_bound()) {
  single_value->field_gMSKPowerClass = other_value.gMSKPowerClass();
} else {
  single_value->field_gMSKPowerClass.clean_up();
}
if (other_value.psk8PowerClass().is_bound()) {
  single_value->field_psk8PowerClass = other_value.psk8PowerClass();
} else {
  single_value->field_psk8PowerClass.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AdditionalAccessTechnologies_template::copy_template(const AdditionalAccessTechnologies_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) {
single_value->field_accessTechnType = other_value.accessTechnType();
} else {
single_value->field_accessTechnType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gMSKPowerClass().get_selection()) {
single_value->field_gMSKPowerClass = other_value.gMSKPowerClass();
} else {
single_value->field_gMSKPowerClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.psk8PowerClass().get_selection()) {
single_value->field_psk8PowerClass = other_value.psk8PowerClass();
} else {
single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies_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 AdditionalAccessTechnologies_template(*other_value.implication_.precondition);
implication_.implied_template = new AdditionalAccessTechnologies_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
break;
}
set_selection(other_value);
}

AdditionalAccessTechnologies_template::AdditionalAccessTechnologies_template()
{
}

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

AdditionalAccessTechnologies_template::AdditionalAccessTechnologies_template(const AdditionalAccessTechnologies& other_value)
{
copy_value(other_value);
}

AdditionalAccessTechnologies_template::AdditionalAccessTechnologies_template(const OPTIONAL<AdditionalAccessTechnologies>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologies&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies from an unbound optional field.");
}
}

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

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

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

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

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

AdditionalAccessTechnologies_template& AdditionalAccessTechnologies_template::operator=(const AdditionalAccessTechnologies& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AdditionalAccessTechnologies_template& AdditionalAccessTechnologies_template::operator=(const OPTIONAL<AdditionalAccessTechnologies>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologies&)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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
}
return *this;
}

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

boolean AdditionalAccessTechnologies_template::match(const AdditionalAccessTechnologies& 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.accessTechnType().is_bound()) return FALSE;
if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE;
if(!other_value.gMSKPowerClass().is_bound()) return FALSE;
if(!single_value->field_gMSKPowerClass.match(other_value.gMSKPowerClass(), legacy))return FALSE;
if(!other_value.psk8PowerClass().is_bound()) return FALSE;
if(!single_value->field_psk8PowerClass.match(other_value.psk8PowerClass(), 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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
}
return FALSE;
}

boolean AdditionalAccessTechnologies_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessTechnType.is_bound()
 || single_value->field_gMSKPowerClass.is_bound()
 || single_value->field_psk8PowerClass.is_bound();
}

boolean AdditionalAccessTechnologies_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessTechnType.is_value()
 && single_value->field_gMSKPowerClass.is_value()
 && single_value->field_psk8PowerClass.is_value();
}

void AdditionalAccessTechnologies_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;
}

AdditionalAccessTechnologies AdditionalAccessTechnologies_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
AdditionalAccessTechnologies ret_val;
if (single_value->field_accessTechnType.is_bound()) {
ret_val.accessTechnType() = single_value->field_accessTechnType.valueof();
}
if (single_value->field_gMSKPowerClass.is_bound()) {
ret_val.gMSKPowerClass() = single_value->field_gMSKPowerClass.valueof();
}
if (single_value->field_psk8PowerClass.is_bound()) {
ret_val.psk8PowerClass() = single_value->field_psk8PowerClass.valueof();
}
return ret_val;
}

void AdditionalAccessTechnologies_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AdditionalAccessTechnologies_template[list_length];
}

AdditionalAccessTechnologies_template& AdditionalAccessTechnologies_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
return value_list.list_value[list_index];
}

BITSTRING_template& AdditionalAccessTechnologies_template::accessTechnType()
{
set_specific();
return single_value->field_accessTechnType;
}

const BITSTRING_template& AdditionalAccessTechnologies_template::accessTechnType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessTechnType of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
return single_value->field_accessTechnType;
}

BITSTRING_template& AdditionalAccessTechnologies_template::gMSKPowerClass()
{
set_specific();
return single_value->field_gMSKPowerClass;
}

const BITSTRING_template& AdditionalAccessTechnologies_template::gMSKPowerClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gMSKPowerClass of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
return single_value->field_gMSKPowerClass;
}

BITSTRING_template& AdditionalAccessTechnologies_template::psk8PowerClass()
{
set_specific();
return single_value->field_psk8PowerClass;
}

const BITSTRING_template& AdditionalAccessTechnologies_template::psk8PowerClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field psk8PowerClass of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
return single_value->field_psk8PowerClass;
}

int AdditionalAccessTechnologies_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies 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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
  }
  return 0;
}

void AdditionalAccessTechnologies_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessTechnType := ");
single_value->field_accessTechnType.log();
TTCN_Logger::log_event_str(", gMSKPowerClass := ");
single_value->field_gMSKPowerClass.log();
TTCN_Logger::log_event_str(", psk8PowerClass := ");
single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies_template::log_match(const AdditionalAccessTechnologies& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){
TTCN_Logger::log_logmatch_info(".accessTechnType");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gMSKPowerClass.match(match_value.gMSKPowerClass(), legacy)){
TTCN_Logger::log_logmatch_info(".gMSKPowerClass");
single_value->field_gMSKPowerClass.log_match(match_value.gMSKPowerClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_psk8PowerClass.match(match_value.psk8PowerClass(), legacy)){
TTCN_Logger::log_logmatch_info(".psk8PowerClass");
single_value->field_psk8PowerClass.log_match(match_value.psk8PowerClass(), 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("{ accessTechnType := ");
single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy);
TTCN_Logger::log_event_str(", gMSKPowerClass := ");
single_value->field_gMSKPowerClass.log_match(match_value.gMSKPowerClass(), legacy);
TTCN_Logger::log_event_str(", psk8PowerClass := ");
single_value->field_psk8PowerClass.log_match(match_value.psk8PowerClass(), 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 AdditionalAccessTechnologies_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessTechnType.encode_text(text_buf);
single_value->field_gMSKPowerClass.encode_text(text_buf);
single_value->field_psk8PowerClass.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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
}
}

void AdditionalAccessTechnologies_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_accessTechnType.decode_text(text_buf);
single_value->field_gMSKPowerClass.decode_text(text_buf);
single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies.");
}
}

void AdditionalAccessTechnologies_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: {
    AdditionalAccessTechnologies_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies has 3 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) accessTechnType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gMSKPowerClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) psk8PowerClass().set_param(*param.get_elem(2));
    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(), "accessTechnType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessTechnType().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(), "gMSKPowerClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gMSKPowerClass().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(), "psk8PowerClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          psk8PowerClass().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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologies: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AdditionalAccessTechnologies_template* precondition = new AdditionalAccessTechnologies_template;
    precondition->set_param(*param.get_elem(0));
    AdditionalAccessTechnologies_template* implied_template = new AdditionalAccessTechnologies_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AdditionalAccessTechnologies_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
  }
  is_ifpresent = param.get_ifpresent();
}

void AdditionalAccessTechnologies_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
single_value->field_gMSKPowerClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
single_value->field_psk8PowerClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
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 : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologies");
}

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

boolean AdditionalAccessTechnologies_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;
}

AdditionalAccessTechnologiesRecord::AdditionalAccessTechnologiesRecord()
{
}

AdditionalAccessTechnologiesRecord::AdditionalAccessTechnologiesRecord(const AdditionalAccessTechnologies& par_additionalAccessTechnologies,
    const BITSTRING& par_extensionBit)
  :   field_additionalAccessTechnologies(par_additionalAccessTechnologies),
  field_extensionBit(par_extensionBit)
{
}

AdditionalAccessTechnologiesRecord::AdditionalAccessTechnologiesRecord(const AdditionalAccessTechnologiesRecord& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
if (other_value.additionalAccessTechnologies().is_bound()) field_additionalAccessTechnologies = other_value.additionalAccessTechnologies();
else field_additionalAccessTechnologies.clean_up();
if (other_value.extensionBit().is_bound()) field_extensionBit = other_value.extensionBit();
else field_extensionBit.clean_up();
}

void AdditionalAccessTechnologiesRecord::clean_up()
{
field_additionalAccessTechnologies.clean_up();
field_extensionBit.clean_up();
}

const TTCN_Typedescriptor_t* AdditionalAccessTechnologiesRecord::get_descriptor() const { return &AdditionalAccessTechnologiesRecord_descr_; }
AdditionalAccessTechnologiesRecord& AdditionalAccessTechnologiesRecord::operator=(const AdditionalAccessTechnologiesRecord& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
  if (other_value.additionalAccessTechnologies().is_bound()) field_additionalAccessTechnologies = other_value.additionalAccessTechnologies();
  else field_additionalAccessTechnologies.clean_up();
  if (other_value.extensionBit().is_bound()) field_extensionBit = other_value.extensionBit();
  else field_extensionBit.clean_up();
}
return *this;
}

boolean AdditionalAccessTechnologiesRecord::operator==(const AdditionalAccessTechnologiesRecord& other_value) const
{
return field_additionalAccessTechnologies==other_value.field_additionalAccessTechnologies
  && field_extensionBit==other_value.field_extensionBit;
}

boolean AdditionalAccessTechnologiesRecord::is_bound() const
{
return (field_additionalAccessTechnologies.is_bound())
  || (field_extensionBit.is_bound());
}
boolean AdditionalAccessTechnologiesRecord::is_value() const
{
return field_additionalAccessTechnologies.is_value()
  && field_extensionBit.is_value();
}
void AdditionalAccessTechnologiesRecord::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ additionalAccessTechnologies := ");
field_additionalAccessTechnologies.log();
TTCN_Logger::log_event_str(", extensionBit := ");
field_extensionBit.log();
TTCN_Logger::log_event_str(" }");
}

void AdditionalAccessTechnologiesRecord::set_implicit_omit()
{
if (additionalAccessTechnologies().is_bound()) additionalAccessTechnologies().set_implicit_omit();
if (extensionBit().is_bound()) extensionBit().set_implicit_omit();
}

void AdditionalAccessTechnologiesRecord::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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord 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) additionalAccessTechnologies().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) extensionBit().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(), "additionalAccessTechnologies")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalAccessTechnologies().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(), "extensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extensionBit().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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord");
  }
}

void AdditionalAccessTechnologiesRecord::encode_text(Text_Buf& text_buf) const
{
field_additionalAccessTechnologies.encode_text(text_buf);
field_extensionBit.encode_text(text_buf);
}

void AdditionalAccessTechnologiesRecord::decode_text(Text_Buf& text_buf)
{
field_additionalAccessTechnologies.decode_text(text_buf);
field_extensionBit.decode_text(text_buf);
}

void AdditionalAccessTechnologiesRecord::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AdditionalAccessTechnologiesRecord::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AdditionalAccessTechnologiesRecord::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, AdditionalAccessTechnologiesRecord_additionalAccessTechnologies_descr_.raw->forceomit);
  decoded_field_length = field_additionalAccessTechnologies.RAW_decode(AdditionalAccessTechnologiesRecord_additionalAccessTechnologies_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AdditionalAccessTechnologiesRecord_extensionBit_descr_.raw->forceomit);
  decoded_field_length = field_extensionBit.RAW_decode(AdditionalAccessTechnologiesRecord_extensionBit_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AdditionalAccessTechnologiesRecord::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, AdditionalAccessTechnologiesRecord_additionalAccessTechnologies_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AdditionalAccessTechnologiesRecord_extensionBit_descr_.raw);
  encoded_length += field_additionalAccessTechnologies.RAW_encode(AdditionalAccessTechnologiesRecord_additionalAccessTechnologies_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_extensionBit.RAW_encode(AdditionalAccessTechnologiesRecord_extensionBit_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AdditionalAccessTechnologiesRecord_template::single_value_struct {
AdditionalAccessTechnologies_template field_additionalAccessTechnologies;
BITSTRING_template field_extensionBit;
};

void AdditionalAccessTechnologiesRecord_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_additionalAccessTechnologies = ANY_VALUE;
single_value->field_extensionBit = ANY_VALUE;
}
}
}

void AdditionalAccessTechnologiesRecord_template::copy_value(const AdditionalAccessTechnologiesRecord& other_value)
{
single_value = new single_value_struct;
if (other_value.additionalAccessTechnologies().is_bound()) {
  single_value->field_additionalAccessTechnologies = other_value.additionalAccessTechnologies();
} else {
  single_value->field_additionalAccessTechnologies.clean_up();
}
if (other_value.extensionBit().is_bound()) {
  single_value->field_extensionBit = other_value.extensionBit();
} else {
  single_value->field_extensionBit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AdditionalAccessTechnologiesRecord_template::copy_template(const AdditionalAccessTechnologiesRecord_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.additionalAccessTechnologies().get_selection()) {
single_value->field_additionalAccessTechnologies = other_value.additionalAccessTechnologies();
} else {
single_value->field_additionalAccessTechnologies.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extensionBit().get_selection()) {
single_value->field_extensionBit = other_value.extensionBit();
} else {
single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord_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 AdditionalAccessTechnologiesRecord_template(*other_value.implication_.precondition);
implication_.implied_template = new AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
break;
}
set_selection(other_value);
}

AdditionalAccessTechnologiesRecord_template::AdditionalAccessTechnologiesRecord_template()
{
}

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

AdditionalAccessTechnologiesRecord_template::AdditionalAccessTechnologiesRecord_template(const AdditionalAccessTechnologiesRecord& other_value)
{
copy_value(other_value);
}

AdditionalAccessTechnologiesRecord_template::AdditionalAccessTechnologiesRecord_template(const OPTIONAL<AdditionalAccessTechnologiesRecord>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologiesRecord&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord from an unbound optional field.");
}
}

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

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

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

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

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

AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRecord_template::operator=(const AdditionalAccessTechnologiesRecord& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRecord_template::operator=(const OPTIONAL<AdditionalAccessTechnologiesRecord>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalAccessTechnologiesRecord&)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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
}
return *this;
}

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

boolean AdditionalAccessTechnologiesRecord_template::match(const AdditionalAccessTechnologiesRecord& 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.additionalAccessTechnologies().is_bound()) return FALSE;
if(!single_value->field_additionalAccessTechnologies.match(other_value.additionalAccessTechnologies(), legacy))return FALSE;
if(!other_value.extensionBit().is_bound()) return FALSE;
if(!single_value->field_extensionBit.match(other_value.extensionBit(), 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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
}
return FALSE;
}

boolean AdditionalAccessTechnologiesRecord_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_additionalAccessTechnologies.is_bound()
 || single_value->field_extensionBit.is_bound();
}

boolean AdditionalAccessTechnologiesRecord_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_additionalAccessTechnologies.is_value()
 && single_value->field_extensionBit.is_value();
}

void AdditionalAccessTechnologiesRecord_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;
}

AdditionalAccessTechnologiesRecord AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
AdditionalAccessTechnologiesRecord ret_val;
if (single_value->field_additionalAccessTechnologies.is_bound()) {
ret_val.additionalAccessTechnologies() = single_value->field_additionalAccessTechnologies.valueof();
}
if (single_value->field_extensionBit.is_bound()) {
ret_val.extensionBit() = single_value->field_extensionBit.valueof();
}
return ret_val;
}

void AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AdditionalAccessTechnologiesRecord_template[list_length];
}

AdditionalAccessTechnologiesRecord_template& AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
return value_list.list_value[list_index];
}

AdditionalAccessTechnologies_template& AdditionalAccessTechnologiesRecord_template::additionalAccessTechnologies()
{
set_specific();
return single_value->field_additionalAccessTechnologies;
}

const AdditionalAccessTechnologies_template& AdditionalAccessTechnologiesRecord_template::additionalAccessTechnologies() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalAccessTechnologies of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
return single_value->field_additionalAccessTechnologies;
}

BITSTRING_template& AdditionalAccessTechnologiesRecord_template::extensionBit()
{
set_specific();
return single_value->field_extensionBit;
}

const BITSTRING_template& AdditionalAccessTechnologiesRecord_template::extensionBit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extensionBit of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
return single_value->field_extensionBit;
}

int AdditionalAccessTechnologiesRecord_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord 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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord 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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
  }
  return 0;
}

void AdditionalAccessTechnologiesRecord_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ additionalAccessTechnologies := ");
single_value->field_additionalAccessTechnologies.log();
TTCN_Logger::log_event_str(", extensionBit := ");
single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord_template::log_match(const AdditionalAccessTechnologiesRecord& 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_additionalAccessTechnologies.match(match_value.additionalAccessTechnologies(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalAccessTechnologies");
single_value->field_additionalAccessTechnologies.log_match(match_value.additionalAccessTechnologies(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_extensionBit.match(match_value.extensionBit(), legacy)){
TTCN_Logger::log_logmatch_info(".extensionBit");
single_value->field_extensionBit.log_match(match_value.extensionBit(), 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("{ additionalAccessTechnologies := ");
single_value->field_additionalAccessTechnologies.log_match(match_value.additionalAccessTechnologies(), legacy);
TTCN_Logger::log_event_str(", extensionBit := ");
single_value->field_extensionBit.log_match(match_value.extensionBit(), 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 AdditionalAccessTechnologiesRecord_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_additionalAccessTechnologies.encode_text(text_buf);
single_value->field_extensionBit.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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
}
}

void AdditionalAccessTechnologiesRecord_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_additionalAccessTechnologies.decode_text(text_buf);
single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord.");
}
}

void AdditionalAccessTechnologiesRecord_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: {
    AdditionalAccessTechnologiesRecord_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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord 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) additionalAccessTechnologies().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) extensionBit().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(), "additionalAccessTechnologies")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalAccessTechnologies().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(), "extensionBit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extensionBit().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 @MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AdditionalAccessTechnologiesRecord_template* precondition = new AdditionalAccessTechnologiesRecord_template;
    precondition->set_param(*param.get_elem(0));
    AdditionalAccessTechnologiesRecord_template* implied_template = new AdditionalAccessTechnologiesRecord_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AdditionalAccessTechnologiesRecord_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord");
  }
  is_ifpresent = param.get_ifpresent();
}

void AdditionalAccessTechnologiesRecord_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_additionalAccessTechnologies.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord");
single_value->field_extensionBit.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord");
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 : "@MobileL3_GMM_SM_Types.AdditionalAccessTechnologiesRecord");
}

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

boolean AdditionalAccessTechnologiesRecord_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;
}

MSRACapabilityValuesRecord::MSRACapabilityValuesRecord()
{
}

MSRACapabilityValuesRecord::MSRACapabilityValuesRecord(const MSRACapabilityValues& par_mSRACapabilityValues,
    const BITSTRING& par_presenceBitMSRACap)
  :   field_mSRACapabilityValues(par_mSRACapabilityValues),
  field_presenceBitMSRACap(par_presenceBitMSRACap)
{
}

MSRACapabilityValuesRecord::MSRACapabilityValuesRecord(const MSRACapabilityValuesRecord& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
if (other_value.mSRACapabilityValues().is_bound()) field_mSRACapabilityValues = other_value.mSRACapabilityValues();
else field_mSRACapabilityValues.clean_up();
if (other_value.presenceBitMSRACap().is_bound()) field_presenceBitMSRACap = other_value.presenceBitMSRACap();
else field_presenceBitMSRACap.clean_up();
}

void MSRACapabilityValuesRecord::clean_up()
{
field_mSRACapabilityValues.clean_up();
field_presenceBitMSRACap.clean_up();
}

const TTCN_Typedescriptor_t* MSRACapabilityValuesRecord::get_descriptor() const { return &MSRACapabilityValuesRecord_descr_; }
MSRACapabilityValuesRecord& MSRACapabilityValuesRecord::operator=(const MSRACapabilityValuesRecord& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
  if (other_value.mSRACapabilityValues().is_bound()) field_mSRACapabilityValues = other_value.mSRACapabilityValues();
  else field_mSRACapabilityValues.clean_up();
  if (other_value.presenceBitMSRACap().is_bound()) field_presenceBitMSRACap = other_value.presenceBitMSRACap();
  else field_presenceBitMSRACap.clean_up();
}
return *this;
}

boolean MSRACapabilityValuesRecord::operator==(const MSRACapabilityValuesRecord& other_value) const
{
return field_mSRACapabilityValues==other_value.field_mSRACapabilityValues
  && field_presenceBitMSRACap==other_value.field_presenceBitMSRACap;
}

boolean MSRACapabilityValuesRecord::is_bound() const
{
return (field_mSRACapabilityValues.is_bound())
  || (field_presenceBitMSRACap.is_bound());
}
boolean MSRACapabilityValuesRecord::is_value() const
{
return field_mSRACapabilityValues.is_value()
  && field_presenceBitMSRACap.is_value();
}
void MSRACapabilityValuesRecord::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mSRACapabilityValues := ");
field_mSRACapabilityValues.log();
TTCN_Logger::log_event_str(", presenceBitMSRACap := ");
field_presenceBitMSRACap.log();
TTCN_Logger::log_event_str(" }");
}

void MSRACapabilityValuesRecord::set_implicit_omit()
{
if (mSRACapabilityValues().is_bound()) mSRACapabilityValues().set_implicit_omit();
if (presenceBitMSRACap().is_bound()) presenceBitMSRACap().set_implicit_omit();
}

void MSRACapabilityValuesRecord::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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord 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) mSRACapabilityValues().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitMSRACap().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(), "mSRACapabilityValues")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSRACapabilityValues().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(), "presenceBitMSRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitMSRACap().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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord");
  }
}

void MSRACapabilityValuesRecord::encode_text(Text_Buf& text_buf) const
{
field_mSRACapabilityValues.encode_text(text_buf);
field_presenceBitMSRACap.encode_text(text_buf);
}

void MSRACapabilityValuesRecord::decode_text(Text_Buf& text_buf)
{
field_mSRACapabilityValues.decode_text(text_buf);
field_presenceBitMSRACap.decode_text(text_buf);
}

void MSRACapabilityValuesRecord::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MSRACapabilityValuesRecord::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MSRACapabilityValuesRecord::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesRecord_mSRACapabilityValues_descr_.raw->forceomit);
  decoded_field_length = field_mSRACapabilityValues.RAW_decode(MSRACapabilityValuesRecord_mSRACapabilityValues_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValuesRecord_presenceBitMSRACap_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitMSRACap.RAW_decode(MSRACapabilityValuesRecord_presenceBitMSRACap_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MSRACapabilityValuesRecord::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, MSRACapabilityValuesRecord_mSRACapabilityValues_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValuesRecord_presenceBitMSRACap_descr_.raw);
  encoded_length += field_mSRACapabilityValues.RAW_encode(MSRACapabilityValuesRecord_mSRACapabilityValues_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitMSRACap.RAW_encode(MSRACapabilityValuesRecord_presenceBitMSRACap_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MSRACapabilityValuesRecord_template::single_value_struct {
MSRACapabilityValues_template field_mSRACapabilityValues;
BITSTRING_template field_presenceBitMSRACap;
};

void MSRACapabilityValuesRecord_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_mSRACapabilityValues = ANY_VALUE;
single_value->field_presenceBitMSRACap = ANY_VALUE;
}
}
}

void MSRACapabilityValuesRecord_template::copy_value(const MSRACapabilityValuesRecord& other_value)
{
single_value = new single_value_struct;
if (other_value.mSRACapabilityValues().is_bound()) {
  single_value->field_mSRACapabilityValues = other_value.mSRACapabilityValues();
} else {
  single_value->field_mSRACapabilityValues.clean_up();
}
if (other_value.presenceBitMSRACap().is_bound()) {
  single_value->field_presenceBitMSRACap = other_value.presenceBitMSRACap();
} else {
  single_value->field_presenceBitMSRACap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MSRACapabilityValuesRecord_template::copy_template(const MSRACapabilityValuesRecord_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mSRACapabilityValues().get_selection()) {
single_value->field_mSRACapabilityValues = other_value.mSRACapabilityValues();
} else {
single_value->field_mSRACapabilityValues.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitMSRACap().get_selection()) {
single_value->field_presenceBitMSRACap = other_value.presenceBitMSRACap();
} else {
single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord_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 MSRACapabilityValuesRecord_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
break;
}
set_selection(other_value);
}

MSRACapabilityValuesRecord_template::MSRACapabilityValuesRecord_template()
{
}

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

MSRACapabilityValuesRecord_template::MSRACapabilityValuesRecord_template(const MSRACapabilityValuesRecord& other_value)
{
copy_value(other_value);
}

MSRACapabilityValuesRecord_template::MSRACapabilityValuesRecord_template(const OPTIONAL<MSRACapabilityValuesRecord>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValuesRecord&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord from an unbound optional field.");
}
}

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

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

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

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

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

MSRACapabilityValuesRecord_template& MSRACapabilityValuesRecord_template::operator=(const MSRACapabilityValuesRecord& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MSRACapabilityValuesRecord_template& MSRACapabilityValuesRecord_template::operator=(const OPTIONAL<MSRACapabilityValuesRecord>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRACapabilityValuesRecord&)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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
}
return *this;
}

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

boolean MSRACapabilityValuesRecord_template::match(const MSRACapabilityValuesRecord& 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.mSRACapabilityValues().is_bound()) return FALSE;
if(!single_value->field_mSRACapabilityValues.match(other_value.mSRACapabilityValues(), legacy))return FALSE;
if(!other_value.presenceBitMSRACap().is_bound()) return FALSE;
if(!single_value->field_presenceBitMSRACap.match(other_value.presenceBitMSRACap(), 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
}
return FALSE;
}

boolean MSRACapabilityValuesRecord_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_mSRACapabilityValues.is_bound()
 || single_value->field_presenceBitMSRACap.is_bound();
}

boolean MSRACapabilityValuesRecord_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mSRACapabilityValues.is_value()
 && single_value->field_presenceBitMSRACap.is_value();
}

void MSRACapabilityValuesRecord_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;
}

MSRACapabilityValuesRecord MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
MSRACapabilityValuesRecord ret_val;
if (single_value->field_mSRACapabilityValues.is_bound()) {
ret_val.mSRACapabilityValues() = single_value->field_mSRACapabilityValues.valueof();
}
if (single_value->field_presenceBitMSRACap.is_bound()) {
ret_val.presenceBitMSRACap() = single_value->field_presenceBitMSRACap.valueof();
}
return ret_val;
}

void MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSRACapabilityValuesRecord_template[list_length];
}

MSRACapabilityValuesRecord_template& MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
return value_list.list_value[list_index];
}

MSRACapabilityValues_template& MSRACapabilityValuesRecord_template::mSRACapabilityValues()
{
set_specific();
return single_value->field_mSRACapabilityValues;
}

const MSRACapabilityValues_template& MSRACapabilityValuesRecord_template::mSRACapabilityValues() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mSRACapabilityValues of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
return single_value->field_mSRACapabilityValues;
}

BITSTRING_template& MSRACapabilityValuesRecord_template::presenceBitMSRACap()
{
set_specific();
return single_value->field_presenceBitMSRACap;
}

const BITSTRING_template& MSRACapabilityValuesRecord_template::presenceBitMSRACap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitMSRACap of a non-specific template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
return single_value->field_presenceBitMSRACap;
}

int MSRACapabilityValuesRecord_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord 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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
  }
  return 0;
}

void MSRACapabilityValuesRecord_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mSRACapabilityValues := ");
single_value->field_mSRACapabilityValues.log();
TTCN_Logger::log_event_str(", presenceBitMSRACap := ");
single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord_template::log_match(const MSRACapabilityValuesRecord& 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_mSRACapabilityValues.match(match_value.mSRACapabilityValues(), legacy)){
TTCN_Logger::log_logmatch_info(".mSRACapabilityValues");
single_value->field_mSRACapabilityValues.log_match(match_value.mSRACapabilityValues(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitMSRACap.match(match_value.presenceBitMSRACap(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitMSRACap");
single_value->field_presenceBitMSRACap.log_match(match_value.presenceBitMSRACap(), 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("{ mSRACapabilityValues := ");
single_value->field_mSRACapabilityValues.log_match(match_value.mSRACapabilityValues(), legacy);
TTCN_Logger::log_event_str(", presenceBitMSRACap := ");
single_value->field_presenceBitMSRACap.log_match(match_value.presenceBitMSRACap(), 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 MSRACapabilityValuesRecord_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mSRACapabilityValues.encode_text(text_buf);
single_value->field_presenceBitMSRACap.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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
}
}

void MSRACapabilityValuesRecord_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_mSRACapabilityValues.decode_text(text_buf);
single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord.");
}
}

void MSRACapabilityValuesRecord_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: {
    MSRACapabilityValuesRecord_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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord 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) mSRACapabilityValues().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitMSRACap().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(), "mSRACapabilityValues")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSRACapabilityValues().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(), "presenceBitMSRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitMSRACap().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 @MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRACapabilityValuesRecord_template* precondition = new MSRACapabilityValuesRecord_template;
    precondition->set_param(*param.get_elem(0));
    MSRACapabilityValuesRecord_template* implied_template = new MSRACapabilityValuesRecord_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MSRACapabilityValuesRecord_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord");
  }
  is_ifpresent = param.get_ifpresent();
}

void MSRACapabilityValuesRecord_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_mSRACapabilityValues.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord");
single_value->field_presenceBitMSRACap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord");
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 : "@MobileL3_GMM_SM_Types.MSRACapabilityValuesRecord");
}

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

boolean MSRACapabilityValuesRecord_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;
}

MSRadioAccessCapabilityLV::MSRadioAccessCapabilityLV()
{
}

MSRadioAccessCapabilityLV::MSRadioAccessCapabilityLV(const INTEGER& par_lengthIndicator,
    const MSRadioAccessCapabilityV& par_msRadioAccessCapabilityV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_msRadioAccessCapabilityV(par_msRadioAccessCapabilityV)
{
}

MSRadioAccessCapabilityLV::MSRadioAccessCapabilityLV(const MSRadioAccessCapabilityLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.msRadioAccessCapabilityV().is_bound()) field_msRadioAccessCapabilityV = other_value.msRadioAccessCapabilityV();
else field_msRadioAccessCapabilityV.clean_up();
}

void MSRadioAccessCapabilityLV::clean_up()
{
field_lengthIndicator.clean_up();
field_msRadioAccessCapabilityV.clean_up();
}

const TTCN_Typedescriptor_t* MSRadioAccessCapabilityLV::get_descriptor() const { return &MSRadioAccessCapabilityLV_descr_; }
MSRadioAccessCapabilityLV& MSRadioAccessCapabilityLV::operator=(const MSRadioAccessCapabilityLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.msRadioAccessCapabilityV().is_bound()) field_msRadioAccessCapabilityV = other_value.msRadioAccessCapabilityV();
  else field_msRadioAccessCapabilityV.clean_up();
}
return *this;
}

boolean MSRadioAccessCapabilityLV::operator==(const MSRadioAccessCapabilityLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_msRadioAccessCapabilityV==other_value.field_msRadioAccessCapabilityV;
}

boolean MSRadioAccessCapabilityLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_msRadioAccessCapabilityV.is_bound());
}
boolean MSRadioAccessCapabilityLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_msRadioAccessCapabilityV.is_value();
}
void MSRadioAccessCapabilityLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", msRadioAccessCapabilityV := ");
field_msRadioAccessCapabilityV.log();
TTCN_Logger::log_event_str(" }");
}

void MSRadioAccessCapabilityLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (msRadioAccessCapabilityV().is_bound()) msRadioAccessCapabilityV().set_implicit_omit();
}

void MSRadioAccessCapabilityLV::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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msRadioAccessCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "msRadioAccessCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRadioAccessCapabilityV().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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV");
  }
}

void MSRadioAccessCapabilityLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_msRadioAccessCapabilityV.encode_text(text_buf);
}

void MSRadioAccessCapabilityLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_msRadioAccessCapabilityV.decode_text(text_buf);
}

void MSRadioAccessCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MSRadioAccessCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MSRadioAccessCapabilityLV::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;
  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, MSRadioAccessCapabilityLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MSRadioAccessCapabilityLV_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(MSRadioAccessCapabilityLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, MSRadioAccessCapabilityLV_msRadioAccessCapabilityV_descr_.raw->forceomit);
  decoded_field_length = field_msRadioAccessCapabilityV.RAW_decode(MSRadioAccessCapabilityLV_msRadioAccessCapabilityV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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 MSRadioAccessCapabilityLV::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, MSRadioAccessCapabilityLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRadioAccessCapabilityLV_msRadioAccessCapabilityV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &MSRadioAccessCapabilityLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_msRadioAccessCapabilityV.RAW_encode(MSRadioAccessCapabilityLV_msRadioAccessCapabilityV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MSRadioAccessCapabilityLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
MSRadioAccessCapabilityV_template field_msRadioAccessCapabilityV;
};

void MSRadioAccessCapabilityLV_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_lengthIndicator = ANY_VALUE;
single_value->field_msRadioAccessCapabilityV = ANY_VALUE;
}
}
}

void MSRadioAccessCapabilityLV_template::copy_value(const MSRadioAccessCapabilityLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.msRadioAccessCapabilityV().is_bound()) {
  single_value->field_msRadioAccessCapabilityV = other_value.msRadioAccessCapabilityV();
} else {
  single_value->field_msRadioAccessCapabilityV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MSRadioAccessCapabilityLV_template::copy_template(const MSRadioAccessCapabilityLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msRadioAccessCapabilityV().get_selection()) {
single_value->field_msRadioAccessCapabilityV = other_value.msRadioAccessCapabilityV();
} else {
single_value->field_msRadioAccessCapabilityV.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 MSRadioAccessCapabilityLV_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 MSRadioAccessCapabilityLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
break;
}
set_selection(other_value);
}

MSRadioAccessCapabilityLV_template::MSRadioAccessCapabilityLV_template()
{
}

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

MSRadioAccessCapabilityLV_template::MSRadioAccessCapabilityLV_template(const MSRadioAccessCapabilityLV& other_value)
{
copy_value(other_value);
}

MSRadioAccessCapabilityLV_template::MSRadioAccessCapabilityLV_template(const OPTIONAL<MSRadioAccessCapabilityLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRadioAccessCapabilityLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV from an unbound optional field.");
}
}

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

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

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

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

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

MSRadioAccessCapabilityLV_template& MSRadioAccessCapabilityLV_template::operator=(const MSRadioAccessCapabilityLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MSRadioAccessCapabilityLV_template& MSRadioAccessCapabilityLV_template::operator=(const OPTIONAL<MSRadioAccessCapabilityLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MSRadioAccessCapabilityLV&)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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
}
return *this;
}

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

boolean MSRadioAccessCapabilityLV_template::match(const MSRadioAccessCapabilityLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.msRadioAccessCapabilityV().is_bound()) return FALSE;
if(!single_value->field_msRadioAccessCapabilityV.match(other_value.msRadioAccessCapabilityV(), 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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
}
return FALSE;
}

boolean MSRadioAccessCapabilityLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_msRadioAccessCapabilityV.is_bound();
}

boolean MSRadioAccessCapabilityLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_msRadioAccessCapabilityV.is_value();
}

void MSRadioAccessCapabilityLV_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;
}

MSRadioAccessCapabilityLV MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
MSRadioAccessCapabilityLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_msRadioAccessCapabilityV.is_bound()) {
ret_val.msRadioAccessCapabilityV() = single_value->field_msRadioAccessCapabilityV.valueof();
}
return ret_val;
}

void MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSRadioAccessCapabilityLV_template[list_length];
}

MSRadioAccessCapabilityLV_template& MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
return value_list.list_value[list_index];
}

INTEGER_template& MSRadioAccessCapabilityLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MSRadioAccessCapabilityLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
return single_value->field_lengthIndicator;
}

MSRadioAccessCapabilityV_template& MSRadioAccessCapabilityLV_template::msRadioAccessCapabilityV()
{
set_specific();
return single_value->field_msRadioAccessCapabilityV;
}

const MSRadioAccessCapabilityV_template& MSRadioAccessCapabilityLV_template::msRadioAccessCapabilityV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msRadioAccessCapabilityV of a non-specific template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
return single_value->field_msRadioAccessCapabilityV;
}

int MSRadioAccessCapabilityLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV 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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV 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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
  }
  return 0;
}

void MSRadioAccessCapabilityLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", msRadioAccessCapabilityV := ");
single_value->field_msRadioAccessCapabilityV.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 MSRadioAccessCapabilityLV_template::log_match(const MSRadioAccessCapabilityLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msRadioAccessCapabilityV.match(match_value.msRadioAccessCapabilityV(), legacy)){
TTCN_Logger::log_logmatch_info(".msRadioAccessCapabilityV");
single_value->field_msRadioAccessCapabilityV.log_match(match_value.msRadioAccessCapabilityV(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", msRadioAccessCapabilityV := ");
single_value->field_msRadioAccessCapabilityV.log_match(match_value.msRadioAccessCapabilityV(), 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 MSRadioAccessCapabilityLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_msRadioAccessCapabilityV.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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
}
}

void MSRadioAccessCapabilityLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_msRadioAccessCapabilityV.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 MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV.");
}
}

void MSRadioAccessCapabilityLV_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: {
    MSRadioAccessCapabilityLV_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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msRadioAccessCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "msRadioAccessCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRadioAccessCapabilityV().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 @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRadioAccessCapabilityLV_template* precondition = new MSRadioAccessCapabilityLV_template;
    precondition->set_param(*param.get_elem(0));
    MSRadioAccessCapabilityLV_template* implied_template = new MSRadioAccessCapabilityLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MSRadioAccessCapabilityLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MSRadioAccessCapabilityLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV");
single_value->field_msRadioAccessCapabilityV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV");
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 : "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityLV");
}

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

boolean MSRadioAccessCapabilityLV_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;
}

GMM__CauseV::GMM__CauseV()
{
}

GMM__CauseV::GMM__CauseV(const OCTETSTRING& par_causeValue)
  :   field_causeValue(par_causeValue)
{
}

GMM__CauseV::GMM__CauseV(const GMM__CauseV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GMM_CauseV.");
if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
}

void GMM__CauseV::clean_up()
{
field_causeValue.clean_up();
}

const TTCN_Typedescriptor_t* GMM__CauseV::get_descriptor() const { return &GMM__CauseV_descr_; }
GMM__CauseV& GMM__CauseV::operator=(const GMM__CauseV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GMM_CauseV.");
  if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
}
return *this;
}

boolean GMM__CauseV::operator==(const GMM__CauseV& other_value) const
{
return field_causeValue==other_value.field_causeValue;
}

boolean GMM__CauseV::is_bound() const
{
return (field_causeValue.is_bound());
}
boolean GMM__CauseV::is_value() const
{
return field_causeValue.is_value();
}
void GMM__CauseV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(" }");
}

void GMM__CauseV::set_implicit_omit()
{
if (causeValue().is_bound()) causeValue().set_implicit_omit();
}

void GMM__CauseV::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.GMM_CauseV has 1 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) causeValue().set_param(*param.get_elem(0));
    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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().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 @MobileL3_GMM_SM_Types.GMM_CauseV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GMM_CauseV");
  }
}

void GMM__CauseV::encode_text(Text_Buf& text_buf) const
{
field_causeValue.encode_text(text_buf);
}

void GMM__CauseV::decode_text(Text_Buf& text_buf)
{
field_causeValue.decode_text(text_buf);
}

void GMM__CauseV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void GMM__CauseV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int GMM__CauseV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_causeValue.RAW_decode(General__Types::OCT1_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GMM__CauseV::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  encoded_length += field_causeValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct GMM__CauseV_template::single_value_struct {
OCTETSTRING_template field_causeValue;
};

void GMM__CauseV_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_causeValue = ANY_VALUE;
}
}
}

void GMM__CauseV_template::copy_value(const GMM__CauseV& other_value)
{
single_value = new single_value_struct;
if (other_value.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GMM__CauseV_template::copy_template(const GMM__CauseV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.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 GMM__CauseV_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 GMM__CauseV_template(*other_value.implication_.precondition);
implication_.implied_template = new GMM__CauseV_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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
break;
}
set_selection(other_value);
}

GMM__CauseV_template::GMM__CauseV_template()
{
}

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

GMM__CauseV_template::GMM__CauseV_template(const GMM__CauseV& other_value)
{
copy_value(other_value);
}

GMM__CauseV_template::GMM__CauseV_template(const OPTIONAL<GMM__CauseV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GMM__CauseV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.GMM_CauseV from an unbound optional field.");
}
}

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

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

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

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

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

GMM__CauseV_template& GMM__CauseV_template::operator=(const GMM__CauseV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GMM__CauseV_template& GMM__CauseV_template::operator=(const OPTIONAL<GMM__CauseV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GMM__CauseV&)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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
}
return *this;
}

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

boolean GMM__CauseV_template::match(const GMM__CauseV& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), 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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
}
return FALSE;
}

boolean GMM__CauseV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_causeValue.is_bound();
}

boolean GMM__CauseV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_causeValue.is_value();
}

void GMM__CauseV_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;
}

GMM__CauseV GMM__CauseV_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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
GMM__CauseV ret_val;
if (single_value->field_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
return ret_val;
}

void GMM__CauseV_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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GMM__CauseV_template[list_length];
}

GMM__CauseV_template& GMM__CauseV_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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.GMM_CauseV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& GMM__CauseV_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const OCTETSTRING_template& GMM__CauseV_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @MobileL3_GMM_SM_Types.GMM_CauseV.");
return single_value->field_causeValue;
}

int GMM__CauseV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV 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 @MobileL3_GMM_SM_Types.GMM_CauseV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GMM_CauseV.");
  }
  return 0;
}

void GMM__CauseV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ causeValue := ");
single_value->field_causeValue.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 GMM__CauseV_template::log_match(const GMM__CauseV& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), 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("{ causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), 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 GMM__CauseV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_causeValue.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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
}
}

void GMM__CauseV_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_causeValue.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 GMM__CauseV_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 @MobileL3_GMM_SM_Types.GMM_CauseV.");
}
}

void GMM__CauseV_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: {
    GMM__CauseV_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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.GMM_CauseV has 1 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) causeValue().set_param(*param.get_elem(0));
    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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().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 @MobileL3_GMM_SM_Types.GMM_CauseV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GMM__CauseV_template* precondition = new GMM__CauseV_template;
    precondition->set_param(*param.get_elem(0));
    GMM__CauseV_template* implied_template = new GMM__CauseV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GMM__CauseV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GMM_CauseV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GMM__CauseV_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_causeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GMM_CauseV");
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 : "@MobileL3_GMM_SM_Types.GMM_CauseV");
}

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

boolean GMM__CauseV_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;
}

GMM__CauseTV::GMM__CauseTV()
{
}

GMM__CauseTV::GMM__CauseTV(const OCTETSTRING& par_elementIdentifier,
    const GMM__CauseV& par_causeValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_causeValue(par_causeValue)
{
}

GMM__CauseTV::GMM__CauseTV(const GMM__CauseTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
}

void GMM__CauseTV::clean_up()
{
field_elementIdentifier.clean_up();
field_causeValue.clean_up();
}

const TTCN_Typedescriptor_t* GMM__CauseTV::get_descriptor() const { return &GMM__CauseTV_descr_; }
GMM__CauseTV& GMM__CauseTV::operator=(const GMM__CauseTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
}
return *this;
}

boolean GMM__CauseTV::operator==(const GMM__CauseTV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_causeValue==other_value.field_causeValue;
}

boolean GMM__CauseTV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_causeValue.is_bound());
}
boolean GMM__CauseTV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_causeValue.is_value();
}
void GMM__CauseTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(" }");
}

void GMM__CauseTV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (causeValue().is_bound()) causeValue().set_implicit_omit();
}

void GMM__CauseTV::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 @MobileL3_GMM_SM_Types.GMM_CauseTV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) causeValue().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().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 @MobileL3_GMM_SM_Types.GMM_CauseTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GMM_CauseTV");
  }
}

void GMM__CauseTV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_causeValue.encode_text(text_buf);
}

void GMM__CauseTV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_causeValue.decode_text(text_buf);
}

void GMM__CauseTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void GMM__CauseTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int GMM__CauseTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_causeValue.RAW_decode(GMM__CauseV_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_elementIdentifier !=  os_4) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GMM__CauseTV::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_causeValue.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_4) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_4.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct GMM__CauseTV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
GMM__CauseV_template field_causeValue;
};

void GMM__CauseTV_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_elementIdentifier = ANY_VALUE;
single_value->field_causeValue = ANY_VALUE;
}
}
}

void GMM__CauseTV_template::copy_value(const GMM__CauseTV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GMM__CauseTV_template::copy_template(const GMM__CauseTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.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 GMM__CauseTV_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 GMM__CauseTV_template(*other_value.implication_.precondition);
implication_.implied_template = new GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
break;
}
set_selection(other_value);
}

GMM__CauseTV_template::GMM__CauseTV_template()
{
}

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

GMM__CauseTV_template::GMM__CauseTV_template(const GMM__CauseTV& other_value)
{
copy_value(other_value);
}

GMM__CauseTV_template::GMM__CauseTV_template(const OPTIONAL<GMM__CauseTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GMM__CauseTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV from an unbound optional field.");
}
}

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

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

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

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

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

GMM__CauseTV_template& GMM__CauseTV_template::operator=(const GMM__CauseTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

GMM__CauseTV_template& GMM__CauseTV_template::operator=(const OPTIONAL<GMM__CauseTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GMM__CauseTV&)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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
}
return *this;
}

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

boolean GMM__CauseTV_template::match(const GMM__CauseTV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), 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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
}
return FALSE;
}

boolean GMM__CauseTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_causeValue.is_bound();
}

boolean GMM__CauseTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_causeValue.is_value();
}

void GMM__CauseTV_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;
}

GMM__CauseTV GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
GMM__CauseTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
return ret_val;
}

void GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GMM__CauseTV_template[list_length];
}

GMM__CauseTV_template& GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& GMM__CauseTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& GMM__CauseTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
return single_value->field_elementIdentifier;
}

GMM__CauseV_template& GMM__CauseTV_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const GMM__CauseV_template& GMM__CauseTV_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
return single_value->field_causeValue;
}

int GMM__CauseTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV 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 @MobileL3_GMM_SM_Types.GMM_CauseTV 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 @MobileL3_GMM_SM_Types.GMM_CauseTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.GMM_CauseTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.GMM_CauseTV.");
  }
  return 0;
}

void GMM__CauseTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", causeValue := ");
single_value->field_causeValue.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 GMM__CauseTV_template::log_match(const GMM__CauseTV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), 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 GMM__CauseTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_causeValue.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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
}
}

void GMM__CauseTV_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_elementIdentifier.decode_text(text_buf);
single_value->field_causeValue.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 GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV.");
}
}

void GMM__CauseTV_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: {
    GMM__CauseTV_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 @MobileL3_GMM_SM_Types.GMM_CauseTV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) causeValue().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().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 @MobileL3_GMM_SM_Types.GMM_CauseTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GMM__CauseTV_template* precondition = new GMM__CauseTV_template;
    precondition->set_param(*param.get_elem(0));
    GMM__CauseTV_template* implied_template = new GMM__CauseTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GMM__CauseTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GMM_CauseTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GMM__CauseTV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GMM_CauseTV");
single_value->field_causeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GMM_CauseTV");
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 : "@MobileL3_GMM_SM_Types.GMM_CauseTV");
}

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

boolean GMM__CauseTV_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;
}

RoutingAreaIdentificationV::RoutingAreaIdentificationV()
{
}

RoutingAreaIdentificationV::RoutingAreaIdentificationV(const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2,
    const OCTETSTRING& par_lac,
    const OCTETSTRING& par_rac)
  :   field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2),
  field_lac(par_lac),
  field_rac(par_rac)
{
}

RoutingAreaIdentificationV::RoutingAreaIdentificationV(const RoutingAreaIdentificationV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
if (other_value.lac().is_bound()) field_lac = other_value.lac();
else field_lac.clean_up();
if (other_value.rac().is_bound()) field_rac = other_value.rac();
else field_rac.clean_up();
}

void RoutingAreaIdentificationV::clean_up()
{
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
field_lac.clean_up();
field_rac.clean_up();
}

const TTCN_Typedescriptor_t* RoutingAreaIdentificationV::get_descriptor() const { return &RoutingAreaIdentificationV_descr_; }
RoutingAreaIdentificationV& RoutingAreaIdentificationV::operator=(const RoutingAreaIdentificationV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
  if (other_value.lac().is_bound()) field_lac = other_value.lac();
  else field_lac.clean_up();
  if (other_value.rac().is_bound()) field_rac = other_value.rac();
  else field_rac.clean_up();
}
return *this;
}

boolean RoutingAreaIdentificationV::operator==(const RoutingAreaIdentificationV& other_value) const
{
return field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2
  && field_lac==other_value.field_lac
  && field_rac==other_value.field_rac;
}

boolean RoutingAreaIdentificationV::is_bound() const
{
return (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound())
  || (field_lac.is_bound())
  || (field_rac.is_bound());
}
boolean RoutingAreaIdentificationV::is_value() const
{
return field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value()
  && field_lac.is_value()
  && field_rac.is_value();
}
void RoutingAreaIdentificationV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
field_rac.log();
TTCN_Logger::log_event_str(" }");
}

void RoutingAreaIdentificationV::set_implicit_omit()
{
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
if (rac().is_bound()) rac().set_implicit_omit();
}

void RoutingAreaIdentificationV::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 (8<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV has 8 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) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(7));
    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(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().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(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().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(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().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(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().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(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().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(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().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(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().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(), "rac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rac().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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
  }
}

void RoutingAreaIdentificationV::encode_text(Text_Buf& text_buf) const
{
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
field_lac.encode_text(text_buf);
field_rac.encode_text(text_buf);
}

void RoutingAreaIdentificationV::decode_text(Text_Buf& text_buf)
{
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
field_lac.decode_text(text_buf);
field_rac.decode_text(text_buf);
}

void RoutingAreaIdentificationV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RoutingAreaIdentificationV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RoutingAreaIdentificationV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_lac.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_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());
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rac.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RoutingAreaIdentificationV::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 = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::OCT1_descr_.raw);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_rac.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct RoutingAreaIdentificationV_template::single_value_struct {
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
OCTETSTRING_template field_lac;
OCTETSTRING_template field_rac;
};

void RoutingAreaIdentificationV_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_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
single_value->field_lac = ANY_VALUE;
single_value->field_rac = ANY_VALUE;
}
}
}

void RoutingAreaIdentificationV_template::copy_value(const RoutingAreaIdentificationV& other_value)
{
single_value = new single_value_struct;
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
if (other_value.lac().is_bound()) {
  single_value->field_lac = other_value.lac();
} else {
  single_value->field_lac.clean_up();
}
if (other_value.rac().is_bound()) {
  single_value->field_rac = other_value.rac();
} else {
  single_value->field_rac.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RoutingAreaIdentificationV_template::copy_template(const RoutingAreaIdentificationV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lac().get_selection()) {
single_value->field_lac = other_value.lac();
} else {
single_value->field_lac.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rac().get_selection()) {
single_value->field_rac = other_value.rac();
} else {
single_value->field_rac.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 RoutingAreaIdentificationV_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 RoutingAreaIdentificationV_template(*other_value.implication_.precondition);
implication_.implied_template = new RoutingAreaIdentificationV_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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
break;
}
set_selection(other_value);
}

RoutingAreaIdentificationV_template::RoutingAreaIdentificationV_template()
{
}

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

RoutingAreaIdentificationV_template::RoutingAreaIdentificationV_template(const RoutingAreaIdentificationV& other_value)
{
copy_value(other_value);
}

RoutingAreaIdentificationV_template::RoutingAreaIdentificationV_template(const OPTIONAL<RoutingAreaIdentificationV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RoutingAreaIdentificationV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV from an unbound optional field.");
}
}

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

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

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

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

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

RoutingAreaIdentificationV_template& RoutingAreaIdentificationV_template::operator=(const RoutingAreaIdentificationV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RoutingAreaIdentificationV_template& RoutingAreaIdentificationV_template::operator=(const OPTIONAL<RoutingAreaIdentificationV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RoutingAreaIdentificationV&)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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
}
return *this;
}

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

boolean RoutingAreaIdentificationV_template::match(const RoutingAreaIdentificationV& 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.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
if(!other_value.lac().is_bound()) return FALSE;
if(!single_value->field_lac.match(other_value.lac(), legacy))return FALSE;
if(!other_value.rac().is_bound()) return FALSE;
if(!single_value->field_rac.match(other_value.rac(), 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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
}
return FALSE;
}

boolean RoutingAreaIdentificationV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound()
 || single_value->field_lac.is_bound()
 || single_value->field_rac.is_bound();
}

boolean RoutingAreaIdentificationV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value()
 && single_value->field_lac.is_value()
 && single_value->field_rac.is_value();
}

void RoutingAreaIdentificationV_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;
}

RoutingAreaIdentificationV RoutingAreaIdentificationV_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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
RoutingAreaIdentificationV ret_val;
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
if (single_value->field_lac.is_bound()) {
ret_val.lac() = single_value->field_lac.valueof();
}
if (single_value->field_rac.is_bound()) {
ret_val.rac() = single_value->field_rac.valueof();
}
return ret_val;
}

void RoutingAreaIdentificationV_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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RoutingAreaIdentificationV_template[list_length];
}

RoutingAreaIdentificationV_template& RoutingAreaIdentificationV_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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return value_list.list_value[list_index];
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& RoutingAreaIdentificationV_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& RoutingAreaIdentificationV_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& RoutingAreaIdentificationV_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_lac;
}

OCTETSTRING_template& RoutingAreaIdentificationV_template::rac()
{
set_specific();
return single_value->field_rac;
}

const OCTETSTRING_template& RoutingAreaIdentificationV_template::rac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rac of a non-specific template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
return single_value->field_rac;
}

int RoutingAreaIdentificationV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 8;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV 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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
  }
  return 0;
}

void RoutingAreaIdentificationV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log();
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
single_value->field_rac.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 RoutingAreaIdentificationV_template::log_match(const RoutingAreaIdentificationV& 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_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lac.match(match_value.lac(), legacy)){
TTCN_Logger::log_logmatch_info(".lac");
single_value->field_lac.log_match(match_value.lac(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rac.match(match_value.rac(), legacy)){
TTCN_Logger::log_logmatch_info(".rac");
single_value->field_rac.log_match(match_value.rac(), 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("{ mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log_match(match_value.lac(), legacy);
TTCN_Logger::log_event_str(", rac := ");
single_value->field_rac.log_match(match_value.rac(), 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 RoutingAreaIdentificationV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.encode_text(text_buf);
single_value->field_lac.encode_text(text_buf);
single_value->field_rac.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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
}
}

void RoutingAreaIdentificationV_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_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
single_value->field_lac.decode_text(text_buf);
single_value->field_rac.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 RoutingAreaIdentificationV_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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV.");
}
}

void RoutingAreaIdentificationV_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: {
    RoutingAreaIdentificationV_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 (8<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV has 8 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) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lac().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(7));
    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(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().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(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().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(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().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(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().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(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().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(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().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(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().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(), "rac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rac().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 @MobileL3_GMM_SM_Types.RoutingAreaIdentificationV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RoutingAreaIdentificationV_template* precondition = new RoutingAreaIdentificationV_template;
    precondition->set_param(*param.get_elem(0));
    RoutingAreaIdentificationV_template* implied_template = new RoutingAreaIdentificationV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RoutingAreaIdentificationV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RoutingAreaIdentificationV_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_mccDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
single_value->field_rac.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
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 : "@MobileL3_GMM_SM_Types.RoutingAreaIdentificationV");
}

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

boolean RoutingAreaIdentificationV_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;
}

UpdateResultV::UpdateResultV()
{
}

UpdateResultV::UpdateResultV(const BITSTRING& par_valueField,
    const BITSTRING& par_fOP__l3)
  :   field_valueField(par_valueField),
  field_fOP__l3(par_fOP__l3)
{
}

UpdateResultV::UpdateResultV(const UpdateResultV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UpdateResultV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.fOP__l3().is_bound()) field_fOP__l3 = other_value.fOP__l3();
else field_fOP__l3.clean_up();
}

void UpdateResultV::clean_up()
{
field_valueField.clean_up();
field_fOP__l3.clean_up();
}

const TTCN_Typedescriptor_t* UpdateResultV::get_descriptor() const { return &UpdateResultV_descr_; }
UpdateResultV& UpdateResultV::operator=(const UpdateResultV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UpdateResultV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.fOP__l3().is_bound()) field_fOP__l3 = other_value.fOP__l3();
  else field_fOP__l3.clean_up();
}
return *this;
}

boolean UpdateResultV::operator==(const UpdateResultV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_fOP__l3==other_value.field_fOP__l3;
}

boolean UpdateResultV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_fOP__l3.is_bound());
}
boolean UpdateResultV::is_value() const
{
return field_valueField.is_value()
  && field_fOP__l3.is_value();
}
void UpdateResultV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", fOP_l3 := ");
field_fOP__l3.log();
TTCN_Logger::log_event_str(" }");
}

void UpdateResultV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (fOP__l3().is_bound()) fOP__l3().set_implicit_omit();
}

void UpdateResultV::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 @MobileL3_GMM_SM_Types.UpdateResultV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fOP__l3().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "fOP_l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fOP__l3().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 @MobileL3_GMM_SM_Types.UpdateResultV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UpdateResultV");
  }
}

void UpdateResultV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_fOP__l3.encode_text(text_buf);
}

void UpdateResultV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_fOP__l3.decode_text(text_buf);
}

void UpdateResultV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UpdateResultV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UpdateResultV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::BIT3_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_fOP__l3.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UpdateResultV::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, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_valueField.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_fOP__l3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct UpdateResultV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_fOP__l3;
};

void UpdateResultV_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_valueField = ANY_VALUE;
single_value->field_fOP__l3 = ANY_VALUE;
}
}
}

void UpdateResultV_template::copy_value(const UpdateResultV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.fOP__l3().is_bound()) {
  single_value->field_fOP__l3 = other_value.fOP__l3();
} else {
  single_value->field_fOP__l3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UpdateResultV_template::copy_template(const UpdateResultV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fOP__l3().get_selection()) {
single_value->field_fOP__l3 = other_value.fOP__l3();
} else {
single_value->field_fOP__l3.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 UpdateResultV_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 UpdateResultV_template(*other_value.implication_.precondition);
implication_.implied_template = new UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV.");
break;
}
set_selection(other_value);
}

UpdateResultV_template::UpdateResultV_template()
{
}

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

UpdateResultV_template::UpdateResultV_template(const UpdateResultV& other_value)
{
copy_value(other_value);
}

UpdateResultV_template::UpdateResultV_template(const OPTIONAL<UpdateResultV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateResultV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UpdateResultV from an unbound optional field.");
}
}

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

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

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

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

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

UpdateResultV_template& UpdateResultV_template::operator=(const UpdateResultV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UpdateResultV_template& UpdateResultV_template::operator=(const OPTIONAL<UpdateResultV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateResultV&)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 @MobileL3_GMM_SM_Types.UpdateResultV.");
}
return *this;
}

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

boolean UpdateResultV_template::match(const UpdateResultV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.fOP__l3().is_bound()) return FALSE;
if(!single_value->field_fOP__l3.match(other_value.fOP__l3(), 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 @MobileL3_GMM_SM_Types.UpdateResultV.");
}
return FALSE;
}

boolean UpdateResultV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_fOP__l3.is_bound();
}

boolean UpdateResultV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_fOP__l3.is_value();
}

void UpdateResultV_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;
}

UpdateResultV UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV.");
UpdateResultV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_fOP__l3.is_bound()) {
ret_val.fOP__l3() = single_value->field_fOP__l3.valueof();
}
return ret_val;
}

void UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UpdateResultV_template[list_length];
}

UpdateResultV_template& UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UpdateResultV.");
return value_list.list_value[list_index];
}

BITSTRING_template& UpdateResultV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const BITSTRING_template& UpdateResultV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateResultV.");
return single_value->field_valueField;
}

BITSTRING_template& UpdateResultV_template::fOP__l3()
{
set_specific();
return single_value->field_fOP__l3;
}

const BITSTRING_template& UpdateResultV_template::fOP__l3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fOP_l3 of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateResultV.");
return single_value->field_fOP__l3;
}

int UpdateResultV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV 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 @MobileL3_GMM_SM_Types.UpdateResultV 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 @MobileL3_GMM_SM_Types.UpdateResultV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UpdateResultV.");
  }
  return 0;
}

void UpdateResultV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", fOP_l3 := ");
single_value->field_fOP__l3.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 UpdateResultV_template::log_match(const UpdateResultV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fOP__l3.match(match_value.fOP__l3(), legacy)){
TTCN_Logger::log_logmatch_info(".fOP_l3");
single_value->field_fOP__l3.log_match(match_value.fOP__l3(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", fOP_l3 := ");
single_value->field_fOP__l3.log_match(match_value.fOP__l3(), 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 UpdateResultV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_fOP__l3.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 @MobileL3_GMM_SM_Types.UpdateResultV.");
}
}

void UpdateResultV_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_valueField.decode_text(text_buf);
single_value->field_fOP__l3.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 UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV.");
}
}

void UpdateResultV_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: {
    UpdateResultV_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 @MobileL3_GMM_SM_Types.UpdateResultV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fOP__l3().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "fOP_l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fOP__l3().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 @MobileL3_GMM_SM_Types.UpdateResultV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UpdateResultV_template* precondition = new UpdateResultV_template;
    precondition->set_param(*param.get_elem(0));
    UpdateResultV_template* implied_template = new UpdateResultV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UpdateResultV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UpdateResultV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UpdateResultV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateResultV");
single_value->field_fOP__l3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateResultV");
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 : "@MobileL3_GMM_SM_Types.UpdateResultV");
}

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

boolean UpdateResultV_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;
}

UpdateResultTV::UpdateResultTV()
{
}

UpdateResultTV::UpdateResultTV(const UpdateResultV& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

UpdateResultTV::UpdateResultTV(const UpdateResultTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void UpdateResultTV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* UpdateResultTV::get_descriptor() const { return &UpdateResultTV_descr_; }
UpdateResultTV& UpdateResultTV::operator=(const UpdateResultTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean UpdateResultTV::operator==(const UpdateResultTV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean UpdateResultTV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean UpdateResultTV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void UpdateResultTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void UpdateResultTV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void UpdateResultTV::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 @MobileL3_GMM_SM_Types.UpdateResultTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.UpdateResultTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UpdateResultTV");
  }
}

void UpdateResultTV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void UpdateResultTV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void UpdateResultTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UpdateResultTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UpdateResultTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, UpdateResultV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(UpdateResultV_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UpdateResultTV::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, UpdateResultV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_valueField.RAW_encode(UpdateResultV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct UpdateResultTV_template::single_value_struct {
UpdateResultV_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void UpdateResultTV_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_valueField = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void UpdateResultTV_template::copy_value(const UpdateResultTV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UpdateResultTV_template::copy_template(const UpdateResultTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 UpdateResultTV_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 UpdateResultTV_template(*other_value.implication_.precondition);
implication_.implied_template = new UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
break;
}
set_selection(other_value);
}

UpdateResultTV_template::UpdateResultTV_template()
{
}

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

UpdateResultTV_template::UpdateResultTV_template(const UpdateResultTV& other_value)
{
copy_value(other_value);
}

UpdateResultTV_template::UpdateResultTV_template(const OPTIONAL<UpdateResultTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateResultTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UpdateResultTV from an unbound optional field.");
}
}

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

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

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

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

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

UpdateResultTV_template& UpdateResultTV_template::operator=(const UpdateResultTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UpdateResultTV_template& UpdateResultTV_template::operator=(const OPTIONAL<UpdateResultTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateResultTV&)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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
}
return *this;
}

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

boolean UpdateResultTV_template::match(const UpdateResultTV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
}
return FALSE;
}

boolean UpdateResultTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean UpdateResultTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void UpdateResultTV_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;
}

UpdateResultTV UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
UpdateResultTV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UpdateResultTV_template[list_length];
}

UpdateResultTV_template& UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
return value_list.list_value[list_index];
}

UpdateResultV_template& UpdateResultTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const UpdateResultV_template& UpdateResultTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
return single_value->field_valueField;
}

BITSTRING_template& UpdateResultTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& UpdateResultTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
return single_value->field_elementIdentifier;
}

int UpdateResultTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV 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 @MobileL3_GMM_SM_Types.UpdateResultTV 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 @MobileL3_GMM_SM_Types.UpdateResultTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateResultTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UpdateResultTV.");
  }
  return 0;
}

void UpdateResultTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 UpdateResultTV_template::log_match(const UpdateResultTV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 UpdateResultTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
}
}

void UpdateResultTV_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_valueField.decode_text(text_buf);
single_value->field_elementIdentifier.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 UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV.");
}
}

void UpdateResultTV_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: {
    UpdateResultTV_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 @MobileL3_GMM_SM_Types.UpdateResultTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.UpdateResultTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UpdateResultTV_template* precondition = new UpdateResultTV_template;
    precondition->set_param(*param.get_elem(0));
    UpdateResultTV_template* implied_template = new UpdateResultTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UpdateResultTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UpdateResultTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UpdateResultTV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateResultTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateResultTV");
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 : "@MobileL3_GMM_SM_Types.UpdateResultTV");
}

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

boolean UpdateResultTV_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;
}

UpdateTypeV::UpdateTypeV()
{
}

UpdateTypeV::UpdateTypeV(const BITSTRING& par_valueField,
    const BITSTRING& par_for__l3)
  :   field_valueField(par_valueField),
  field_for__l3(par_for__l3)
{
}

UpdateTypeV::UpdateTypeV(const UpdateTypeV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.for__l3().is_bound()) field_for__l3 = other_value.for__l3();
else field_for__l3.clean_up();
}

void UpdateTypeV::clean_up()
{
field_valueField.clean_up();
field_for__l3.clean_up();
}

const TTCN_Typedescriptor_t* UpdateTypeV::get_descriptor() const { return &UpdateTypeV_descr_; }
UpdateTypeV& UpdateTypeV::operator=(const UpdateTypeV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.for__l3().is_bound()) field_for__l3 = other_value.for__l3();
  else field_for__l3.clean_up();
}
return *this;
}

boolean UpdateTypeV::operator==(const UpdateTypeV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_for__l3==other_value.field_for__l3;
}

boolean UpdateTypeV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_for__l3.is_bound());
}
boolean UpdateTypeV::is_value() const
{
return field_valueField.is_value()
  && field_for__l3.is_value();
}
void UpdateTypeV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", for_l3 := ");
field_for__l3.log();
TTCN_Logger::log_event_str(" }");
}

void UpdateTypeV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (for__l3().is_bound()) for__l3().set_implicit_omit();
}

void UpdateTypeV::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 @MobileL3_GMM_SM_Types.UpdateTypeV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) for__l3().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "for_l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          for__l3().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 @MobileL3_GMM_SM_Types.UpdateTypeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UpdateTypeV");
  }
}

void UpdateTypeV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_for__l3.encode_text(text_buf);
}

void UpdateTypeV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_for__l3.decode_text(text_buf);
}

void UpdateTypeV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UpdateTypeV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UpdateTypeV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::BIT3_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_for__l3.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UpdateTypeV::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, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_valueField.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_for__l3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct UpdateTypeV_template::single_value_struct {
BITSTRING_template field_valueField;
BITSTRING_template field_for__l3;
};

void UpdateTypeV_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_valueField = ANY_VALUE;
single_value->field_for__l3 = ANY_VALUE;
}
}
}

void UpdateTypeV_template::copy_value(const UpdateTypeV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.for__l3().is_bound()) {
  single_value->field_for__l3 = other_value.for__l3();
} else {
  single_value->field_for__l3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UpdateTypeV_template::copy_template(const UpdateTypeV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.for__l3().get_selection()) {
single_value->field_for__l3 = other_value.for__l3();
} else {
single_value->field_for__l3.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 UpdateTypeV_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 UpdateTypeV_template(*other_value.implication_.precondition);
implication_.implied_template = new UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
break;
}
set_selection(other_value);
}

UpdateTypeV_template::UpdateTypeV_template()
{
}

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

UpdateTypeV_template::UpdateTypeV_template(const UpdateTypeV& other_value)
{
copy_value(other_value);
}

UpdateTypeV_template::UpdateTypeV_template(const OPTIONAL<UpdateTypeV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateTypeV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UpdateTypeV from an unbound optional field.");
}
}

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

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

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

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

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

UpdateTypeV_template& UpdateTypeV_template::operator=(const UpdateTypeV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UpdateTypeV_template& UpdateTypeV_template::operator=(const OPTIONAL<UpdateTypeV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateTypeV&)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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
}
return *this;
}

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

boolean UpdateTypeV_template::match(const UpdateTypeV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.for__l3().is_bound()) return FALSE;
if(!single_value->field_for__l3.match(other_value.for__l3(), 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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
}
return FALSE;
}

boolean UpdateTypeV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_for__l3.is_bound();
}

boolean UpdateTypeV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_for__l3.is_value();
}

void UpdateTypeV_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;
}

UpdateTypeV UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
UpdateTypeV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_for__l3.is_bound()) {
ret_val.for__l3() = single_value->field_for__l3.valueof();
}
return ret_val;
}

void UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UpdateTypeV_template[list_length];
}

UpdateTypeV_template& UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
return value_list.list_value[list_index];
}

BITSTRING_template& UpdateTypeV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const BITSTRING_template& UpdateTypeV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
return single_value->field_valueField;
}

BITSTRING_template& UpdateTypeV_template::for__l3()
{
set_specific();
return single_value->field_for__l3;
}

const BITSTRING_template& UpdateTypeV_template::for__l3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field for_l3 of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
return single_value->field_for__l3;
}

int UpdateTypeV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV 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 @MobileL3_GMM_SM_Types.UpdateTypeV 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 @MobileL3_GMM_SM_Types.UpdateTypeV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UpdateTypeV.");
  }
  return 0;
}

void UpdateTypeV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", for_l3 := ");
single_value->field_for__l3.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 UpdateTypeV_template::log_match(const UpdateTypeV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_for__l3.match(match_value.for__l3(), legacy)){
TTCN_Logger::log_logmatch_info(".for_l3");
single_value->field_for__l3.log_match(match_value.for__l3(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", for_l3 := ");
single_value->field_for__l3.log_match(match_value.for__l3(), 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 UpdateTypeV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_for__l3.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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
}
}

void UpdateTypeV_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_valueField.decode_text(text_buf);
single_value->field_for__l3.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 UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV.");
}
}

void UpdateTypeV_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: {
    UpdateTypeV_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 @MobileL3_GMM_SM_Types.UpdateTypeV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) for__l3().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "for_l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          for__l3().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 @MobileL3_GMM_SM_Types.UpdateTypeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UpdateTypeV_template* precondition = new UpdateTypeV_template;
    precondition->set_param(*param.get_elem(0));
    UpdateTypeV_template* implied_template = new UpdateTypeV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UpdateTypeV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UpdateTypeV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UpdateTypeV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateTypeV");
single_value->field_for__l3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateTypeV");
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 : "@MobileL3_GMM_SM_Types.UpdateTypeV");
}

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

boolean UpdateTypeV_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;
}

UpdateTypeTV::UpdateTypeTV()
{
}

UpdateTypeTV::UpdateTypeTV(const UpdateTypeV& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

UpdateTypeTV::UpdateTypeTV(const UpdateTypeTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void UpdateTypeTV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* UpdateTypeTV::get_descriptor() const { return &UpdateTypeTV_descr_; }
UpdateTypeTV& UpdateTypeTV::operator=(const UpdateTypeTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean UpdateTypeTV::operator==(const UpdateTypeTV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean UpdateTypeTV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean UpdateTypeTV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void UpdateTypeTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void UpdateTypeTV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void UpdateTypeTV::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 @MobileL3_GMM_SM_Types.UpdateTypeTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.UpdateTypeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UpdateTypeTV");
  }
}

void UpdateTypeTV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void UpdateTypeTV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void UpdateTypeTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UpdateTypeTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UpdateTypeTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, UpdateTypeV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(UpdateTypeV_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UpdateTypeTV::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, UpdateTypeV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_valueField.RAW_encode(UpdateTypeV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct UpdateTypeTV_template::single_value_struct {
UpdateTypeV_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void UpdateTypeTV_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_valueField = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void UpdateTypeTV_template::copy_value(const UpdateTypeTV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UpdateTypeTV_template::copy_template(const UpdateTypeTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 UpdateTypeTV_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 UpdateTypeTV_template(*other_value.implication_.precondition);
implication_.implied_template = new UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
break;
}
set_selection(other_value);
}

UpdateTypeTV_template::UpdateTypeTV_template()
{
}

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

UpdateTypeTV_template::UpdateTypeTV_template(const UpdateTypeTV& other_value)
{
copy_value(other_value);
}

UpdateTypeTV_template::UpdateTypeTV_template(const OPTIONAL<UpdateTypeTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateTypeTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV from an unbound optional field.");
}
}

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

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

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

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

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

UpdateTypeTV_template& UpdateTypeTV_template::operator=(const UpdateTypeTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UpdateTypeTV_template& UpdateTypeTV_template::operator=(const OPTIONAL<UpdateTypeTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UpdateTypeTV&)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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
}
return *this;
}

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

boolean UpdateTypeTV_template::match(const UpdateTypeTV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
}
return FALSE;
}

boolean UpdateTypeTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean UpdateTypeTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void UpdateTypeTV_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;
}

UpdateTypeTV UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
UpdateTypeTV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UpdateTypeTV_template[list_length];
}

UpdateTypeTV_template& UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
return value_list.list_value[list_index];
}

UpdateTypeV_template& UpdateTypeTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const UpdateTypeV_template& UpdateTypeTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
return single_value->field_valueField;
}

BITSTRING_template& UpdateTypeTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& UpdateTypeTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
return single_value->field_elementIdentifier;
}

int UpdateTypeTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV 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 @MobileL3_GMM_SM_Types.UpdateTypeTV 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 @MobileL3_GMM_SM_Types.UpdateTypeTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UpdateTypeTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UpdateTypeTV.");
  }
  return 0;
}

void UpdateTypeTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 UpdateTypeTV_template::log_match(const UpdateTypeTV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 UpdateTypeTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
}
}

void UpdateTypeTV_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_valueField.decode_text(text_buf);
single_value->field_elementIdentifier.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 UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV.");
}
}

void UpdateTypeTV_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: {
    UpdateTypeTV_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 @MobileL3_GMM_SM_Types.UpdateTypeTV 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) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.UpdateTypeTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UpdateTypeTV_template* precondition = new UpdateTypeTV_template;
    precondition->set_param(*param.get_elem(0));
    UpdateTypeTV_template* implied_template = new UpdateTypeTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UpdateTypeTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UpdateTypeTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UpdateTypeTV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateTypeTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UpdateTypeTV");
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 : "@MobileL3_GMM_SM_Types.UpdateTypeTV");
}

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

boolean UpdateTypeTV_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;
}

ACReferenceNumberV::ACReferenceNumberV()
{
}

ACReferenceNumberV::ACReferenceNumberV(const BITSTRING& par_valueField)
  :   field_valueField(par_valueField)
{
}

ACReferenceNumberV::ACReferenceNumberV(const ACReferenceNumberV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void ACReferenceNumberV::clean_up()
{
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* ACReferenceNumberV::get_descriptor() const { return &ACReferenceNumberV_descr_; }
ACReferenceNumberV& ACReferenceNumberV::operator=(const ACReferenceNumberV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean ACReferenceNumberV::operator==(const ACReferenceNumberV& other_value) const
{
return field_valueField==other_value.field_valueField;
}

boolean ACReferenceNumberV::is_bound() const
{
return (field_valueField.is_bound());
}
boolean ACReferenceNumberV::is_value() const
{
return field_valueField.is_value();
}
void ACReferenceNumberV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void ACReferenceNumberV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void ACReferenceNumberV::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.ACReferenceNumberV has 1 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) valueField().set_param(*param.get_elem(0));
    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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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 @MobileL3_GMM_SM_Types.ACReferenceNumberV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.ACReferenceNumberV");
  }
}

void ACReferenceNumberV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
}

void ACReferenceNumberV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
}

void ACReferenceNumberV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ACReferenceNumberV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ACReferenceNumberV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::BIT4_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ACReferenceNumberV::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  encoded_length += field_valueField.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct ACReferenceNumberV_template::single_value_struct {
BITSTRING_template field_valueField;
};

void ACReferenceNumberV_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_valueField = ANY_VALUE;
}
}
}

void ACReferenceNumberV_template::copy_value(const ACReferenceNumberV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ACReferenceNumberV_template::copy_template(const ACReferenceNumberV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.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 ACReferenceNumberV_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 ACReferenceNumberV_template(*other_value.implication_.precondition);
implication_.implied_template = new ACReferenceNumberV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
break;
}
set_selection(other_value);
}

ACReferenceNumberV_template::ACReferenceNumberV_template()
{
}

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

ACReferenceNumberV_template::ACReferenceNumberV_template(const ACReferenceNumberV& other_value)
{
copy_value(other_value);
}

ACReferenceNumberV_template::ACReferenceNumberV_template(const OPTIONAL<ACReferenceNumberV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ACReferenceNumberV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV from an unbound optional field.");
}
}

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

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

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

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

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

ACReferenceNumberV_template& ACReferenceNumberV_template::operator=(const ACReferenceNumberV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ACReferenceNumberV_template& ACReferenceNumberV_template::operator=(const OPTIONAL<ACReferenceNumberV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ACReferenceNumberV&)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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
}
return *this;
}

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

boolean ACReferenceNumberV_template::match(const ACReferenceNumberV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), 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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
}
return FALSE;
}

boolean ACReferenceNumberV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound();
}

boolean ACReferenceNumberV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value();
}

void ACReferenceNumberV_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;
}

ACReferenceNumberV ACReferenceNumberV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
ACReferenceNumberV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void ACReferenceNumberV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ACReferenceNumberV_template[list_length];
}

ACReferenceNumberV_template& ACReferenceNumberV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
return value_list.list_value[list_index];
}

BITSTRING_template& ACReferenceNumberV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const BITSTRING_template& ACReferenceNumberV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
return single_value->field_valueField;
}

int ACReferenceNumberV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV 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 @MobileL3_GMM_SM_Types.ACReferenceNumberV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
  }
  return 0;
}

void ACReferenceNumberV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.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 ACReferenceNumberV_template::log_match(const ACReferenceNumberV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 ACReferenceNumberV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
}
}

void ACReferenceNumberV_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_valueField.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 ACReferenceNumberV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberV.");
}
}

void ACReferenceNumberV_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: {
    ACReferenceNumberV_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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.ACReferenceNumberV has 1 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) valueField().set_param(*param.get_elem(0));
    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(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().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 @MobileL3_GMM_SM_Types.ACReferenceNumberV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ACReferenceNumberV_template* precondition = new ACReferenceNumberV_template;
    precondition->set_param(*param.get_elem(0));
    ACReferenceNumberV_template* implied_template = new ACReferenceNumberV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ACReferenceNumberV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ACReferenceNumberV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ACReferenceNumberV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ACReferenceNumberV");
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 : "@MobileL3_GMM_SM_Types.ACReferenceNumberV");
}

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

boolean ACReferenceNumberV_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;
}

ACReferenceNumberTV::ACReferenceNumberTV()
{
}

ACReferenceNumberTV::ACReferenceNumberTV(const ACReferenceNumberV& par_acReferenceNumber,
    const BITSTRING& par_acReferenceNumberIEI)
  :   field_acReferenceNumber(par_acReferenceNumber),
  field_acReferenceNumberIEI(par_acReferenceNumberIEI)
{
}

ACReferenceNumberTV::ACReferenceNumberTV(const ACReferenceNumberTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
else field_acReferenceNumber.clean_up();
if (other_value.acReferenceNumberIEI().is_bound()) field_acReferenceNumberIEI = other_value.acReferenceNumberIEI();
else field_acReferenceNumberIEI.clean_up();
}

void ACReferenceNumberTV::clean_up()
{
field_acReferenceNumber.clean_up();
field_acReferenceNumberIEI.clean_up();
}

const TTCN_Typedescriptor_t* ACReferenceNumberTV::get_descriptor() const { return &ACReferenceNumberTV_descr_; }
ACReferenceNumberTV& ACReferenceNumberTV::operator=(const ACReferenceNumberTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
  if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
  else field_acReferenceNumber.clean_up();
  if (other_value.acReferenceNumberIEI().is_bound()) field_acReferenceNumberIEI = other_value.acReferenceNumberIEI();
  else field_acReferenceNumberIEI.clean_up();
}
return *this;
}

boolean ACReferenceNumberTV::operator==(const ACReferenceNumberTV& other_value) const
{
return field_acReferenceNumber==other_value.field_acReferenceNumber
  && field_acReferenceNumberIEI==other_value.field_acReferenceNumberIEI;
}

boolean ACReferenceNumberTV::is_bound() const
{
return (field_acReferenceNumber.is_bound())
  || (field_acReferenceNumberIEI.is_bound());
}
boolean ACReferenceNumberTV::is_value() const
{
return field_acReferenceNumber.is_value()
  && field_acReferenceNumberIEI.is_value();
}
void ACReferenceNumberTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ acReferenceNumber := ");
field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", acReferenceNumberIEI := ");
field_acReferenceNumberIEI.log();
TTCN_Logger::log_event_str(" }");
}

void ACReferenceNumberTV::set_implicit_omit()
{
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (acReferenceNumberIEI().is_bound()) acReferenceNumberIEI().set_implicit_omit();
}

void ACReferenceNumberTV::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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV 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) acReferenceNumber().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumberIEI().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(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().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(), "acReferenceNumberIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumberIEI().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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.ACReferenceNumberTV");
  }
}

void ACReferenceNumberTV::encode_text(Text_Buf& text_buf) const
{
field_acReferenceNumber.encode_text(text_buf);
field_acReferenceNumberIEI.encode_text(text_buf);
}

void ACReferenceNumberTV::decode_text(Text_Buf& text_buf)
{
field_acReferenceNumber.decode_text(text_buf);
field_acReferenceNumberIEI.decode_text(text_buf);
}

void ACReferenceNumberTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ACReferenceNumberTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ACReferenceNumberTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, ACReferenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumber.RAW_decode(ACReferenceNumberV_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumberIEI.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ACReferenceNumberTV::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, ACReferenceNumberV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_acReferenceNumber.RAW_encode(ACReferenceNumberV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_acReferenceNumberIEI.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct ACReferenceNumberTV_template::single_value_struct {
ACReferenceNumberV_template field_acReferenceNumber;
BITSTRING_template field_acReferenceNumberIEI;
};

void ACReferenceNumberTV_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_acReferenceNumber = ANY_VALUE;
single_value->field_acReferenceNumberIEI = ANY_VALUE;
}
}
}

void ACReferenceNumberTV_template::copy_value(const ACReferenceNumberTV& other_value)
{
single_value = new single_value_struct;
if (other_value.acReferenceNumber().is_bound()) {
  single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
  single_value->field_acReferenceNumber.clean_up();
}
if (other_value.acReferenceNumberIEI().is_bound()) {
  single_value->field_acReferenceNumberIEI = other_value.acReferenceNumberIEI();
} else {
  single_value->field_acReferenceNumberIEI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ACReferenceNumberTV_template::copy_template(const ACReferenceNumberTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.acReferenceNumber().get_selection()) {
single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
single_value->field_acReferenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.acReferenceNumberIEI().get_selection()) {
single_value->field_acReferenceNumberIEI = other_value.acReferenceNumberIEI();
} else {
single_value->field_acReferenceNumberIEI.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 ACReferenceNumberTV_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 ACReferenceNumberTV_template(*other_value.implication_.precondition);
implication_.implied_template = new ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
break;
}
set_selection(other_value);
}

ACReferenceNumberTV_template::ACReferenceNumberTV_template()
{
}

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

ACReferenceNumberTV_template::ACReferenceNumberTV_template(const ACReferenceNumberTV& other_value)
{
copy_value(other_value);
}

ACReferenceNumberTV_template::ACReferenceNumberTV_template(const OPTIONAL<ACReferenceNumberTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ACReferenceNumberTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV from an unbound optional field.");
}
}

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

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

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

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

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

ACReferenceNumberTV_template& ACReferenceNumberTV_template::operator=(const ACReferenceNumberTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ACReferenceNumberTV_template& ACReferenceNumberTV_template::operator=(const OPTIONAL<ACReferenceNumberTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ACReferenceNumberTV&)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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
}
return *this;
}

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

boolean ACReferenceNumberTV_template::match(const ACReferenceNumberTV& 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.acReferenceNumber().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumber.match(other_value.acReferenceNumber(), legacy))return FALSE;
if(!other_value.acReferenceNumberIEI().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumberIEI.match(other_value.acReferenceNumberIEI(), 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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
}
return FALSE;
}

boolean ACReferenceNumberTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_acReferenceNumber.is_bound()
 || single_value->field_acReferenceNumberIEI.is_bound();
}

boolean ACReferenceNumberTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_acReferenceNumber.is_value()
 && single_value->field_acReferenceNumberIEI.is_value();
}

void ACReferenceNumberTV_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;
}

ACReferenceNumberTV ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
ACReferenceNumberTV ret_val;
if (single_value->field_acReferenceNumber.is_bound()) {
ret_val.acReferenceNumber() = single_value->field_acReferenceNumber.valueof();
}
if (single_value->field_acReferenceNumberIEI.is_bound()) {
ret_val.acReferenceNumberIEI() = single_value->field_acReferenceNumberIEI.valueof();
}
return ret_val;
}

void ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ACReferenceNumberTV_template[list_length];
}

ACReferenceNumberTV_template& ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
return value_list.list_value[list_index];
}

ACReferenceNumberV_template& ACReferenceNumberTV_template::acReferenceNumber()
{
set_specific();
return single_value->field_acReferenceNumber;
}

const ACReferenceNumberV_template& ACReferenceNumberTV_template::acReferenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
return single_value->field_acReferenceNumber;
}

BITSTRING_template& ACReferenceNumberTV_template::acReferenceNumberIEI()
{
set_specific();
return single_value->field_acReferenceNumberIEI;
}

const BITSTRING_template& ACReferenceNumberTV_template::acReferenceNumberIEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumberIEI of a non-specific template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
return single_value->field_acReferenceNumberIEI;
}

int ACReferenceNumberTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV 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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV 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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
  }
  return 0;
}

void ACReferenceNumberTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ acReferenceNumber := ");
single_value->field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", acReferenceNumberIEI := ");
single_value->field_acReferenceNumberIEI.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 ACReferenceNumberTV_template::log_match(const ACReferenceNumberTV& 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_acReferenceNumber.match(match_value.acReferenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".acReferenceNumber");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_acReferenceNumberIEI.match(match_value.acReferenceNumberIEI(), legacy)){
TTCN_Logger::log_logmatch_info(".acReferenceNumberIEI");
single_value->field_acReferenceNumberIEI.log_match(match_value.acReferenceNumberIEI(), 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("{ acReferenceNumber := ");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::log_event_str(", acReferenceNumberIEI := ");
single_value->field_acReferenceNumberIEI.log_match(match_value.acReferenceNumberIEI(), 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 ACReferenceNumberTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_acReferenceNumber.encode_text(text_buf);
single_value->field_acReferenceNumberIEI.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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
}
}

void ACReferenceNumberTV_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_acReferenceNumber.decode_text(text_buf);
single_value->field_acReferenceNumberIEI.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 ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV.");
}
}

void ACReferenceNumberTV_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: {
    ACReferenceNumberTV_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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV 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) acReferenceNumber().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumberIEI().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(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().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(), "acReferenceNumberIEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumberIEI().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 @MobileL3_GMM_SM_Types.ACReferenceNumberTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ACReferenceNumberTV_template* precondition = new ACReferenceNumberTV_template;
    precondition->set_param(*param.get_elem(0));
    ACReferenceNumberTV_template* implied_template = new ACReferenceNumberTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ACReferenceNumberTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ACReferenceNumberTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ACReferenceNumberTV_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_acReferenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ACReferenceNumberTV");
single_value->field_acReferenceNumberIEI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ACReferenceNumberTV");
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 : "@MobileL3_GMM_SM_Types.ACReferenceNumberTV");
}

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

boolean ACReferenceNumberTV_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;
}

ServiceTypeV::ServiceTypeV()
{
}

ServiceTypeV::ServiceTypeV(const BITSTRING& par_serviceType,
    const BITSTRING& par_spare)
  :   field_serviceType(par_serviceType),
  field_spare(par_spare)
{
}

ServiceTypeV::ServiceTypeV(const ServiceTypeV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
if (other_value.serviceType().is_bound()) field_serviceType = other_value.serviceType();
else field_serviceType.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void ServiceTypeV::clean_up()
{
field_serviceType.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* ServiceTypeV::get_descriptor() const { return &ServiceTypeV_descr_; }
ServiceTypeV& ServiceTypeV::operator=(const ServiceTypeV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
  if (other_value.serviceType().is_bound()) field_serviceType = other_value.serviceType();
  else field_serviceType.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean ServiceTypeV::operator==(const ServiceTypeV& other_value) const
{
return field_serviceType==other_value.field_serviceType
  && field_spare==other_value.field_spare;
}

boolean ServiceTypeV::is_bound() const
{
return (field_serviceType.is_bound())
  || (field_spare.is_bound());
}
boolean ServiceTypeV::is_value() const
{
return field_serviceType.is_value()
  && field_spare.is_value();
}
void ServiceTypeV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ serviceType := ");
field_serviceType.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void ServiceTypeV::set_implicit_omit()
{
if (serviceType().is_bound()) serviceType().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void ServiceTypeV::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 @MobileL3_GMM_SM_Types.ServiceTypeV 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) serviceType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "serviceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceType().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.ServiceTypeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.ServiceTypeV");
  }
}

void ServiceTypeV::encode_text(Text_Buf& text_buf) const
{
field_serviceType.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void ServiceTypeV::decode_text(Text_Buf& text_buf)
{
field_serviceType.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void ServiceTypeV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ServiceTypeV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ServiceTypeV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_serviceType.RAW_decode(General__Types::BIT3_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ServiceTypeV::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, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_serviceType.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct ServiceTypeV_template::single_value_struct {
BITSTRING_template field_serviceType;
BITSTRING_template field_spare;
};

void ServiceTypeV_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_serviceType = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void ServiceTypeV_template::copy_value(const ServiceTypeV& other_value)
{
single_value = new single_value_struct;
if (other_value.serviceType().is_bound()) {
  single_value->field_serviceType = other_value.serviceType();
} else {
  single_value->field_serviceType.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ServiceTypeV_template::copy_template(const ServiceTypeV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.serviceType().get_selection()) {
single_value->field_serviceType = other_value.serviceType();
} else {
single_value->field_serviceType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.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 ServiceTypeV_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 ServiceTypeV_template(*other_value.implication_.precondition);
implication_.implied_template = new ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
break;
}
set_selection(other_value);
}

ServiceTypeV_template::ServiceTypeV_template()
{
}

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

ServiceTypeV_template::ServiceTypeV_template(const ServiceTypeV& other_value)
{
copy_value(other_value);
}

ServiceTypeV_template::ServiceTypeV_template(const OPTIONAL<ServiceTypeV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ServiceTypeV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.ServiceTypeV from an unbound optional field.");
}
}

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

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

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

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

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

ServiceTypeV_template& ServiceTypeV_template::operator=(const ServiceTypeV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ServiceTypeV_template& ServiceTypeV_template::operator=(const OPTIONAL<ServiceTypeV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ServiceTypeV&)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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
}
return *this;
}

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

boolean ServiceTypeV_template::match(const ServiceTypeV& 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.serviceType().is_bound()) return FALSE;
if(!single_value->field_serviceType.match(other_value.serviceType(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), 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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
}
return FALSE;
}

boolean ServiceTypeV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_serviceType.is_bound()
 || single_value->field_spare.is_bound();
}

boolean ServiceTypeV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_serviceType.is_value()
 && single_value->field_spare.is_value();
}

void ServiceTypeV_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;
}

ServiceTypeV ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
ServiceTypeV ret_val;
if (single_value->field_serviceType.is_bound()) {
ret_val.serviceType() = single_value->field_serviceType.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ServiceTypeV_template[list_length];
}

ServiceTypeV_template& ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
return value_list.list_value[list_index];
}

BITSTRING_template& ServiceTypeV_template::serviceType()
{
set_specific();
return single_value->field_serviceType;
}

const BITSTRING_template& ServiceTypeV_template::serviceType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field serviceType of a non-specific template of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
return single_value->field_serviceType;
}

BITSTRING_template& ServiceTypeV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& ServiceTypeV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
return single_value->field_spare;
}

int ServiceTypeV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV 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 @MobileL3_GMM_SM_Types.ServiceTypeV 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 @MobileL3_GMM_SM_Types.ServiceTypeV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ServiceTypeV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ServiceTypeV.");
  }
  return 0;
}

void ServiceTypeV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ serviceType := ");
single_value->field_serviceType.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.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 ServiceTypeV_template::log_match(const ServiceTypeV& 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_serviceType.match(match_value.serviceType(), legacy)){
TTCN_Logger::log_logmatch_info(".serviceType");
single_value->field_serviceType.log_match(match_value.serviceType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), 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("{ serviceType := ");
single_value->field_serviceType.log_match(match_value.serviceType(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), 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 ServiceTypeV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_serviceType.encode_text(text_buf);
single_value->field_spare.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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
}
}

void ServiceTypeV_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_serviceType.decode_text(text_buf);
single_value->field_spare.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 ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV.");
}
}

void ServiceTypeV_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: {
    ServiceTypeV_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 @MobileL3_GMM_SM_Types.ServiceTypeV 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) serviceType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "serviceType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceType().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.ServiceTypeV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ServiceTypeV_template* precondition = new ServiceTypeV_template;
    precondition->set_param(*param.get_elem(0));
    ServiceTypeV_template* implied_template = new ServiceTypeV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ServiceTypeV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ServiceTypeV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ServiceTypeV_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_serviceType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ServiceTypeV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ServiceTypeV");
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 : "@MobileL3_GMM_SM_Types.ServiceTypeV");
}

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

boolean ServiceTypeV_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;
}

CellNotificationT::CellNotificationT()
{
}

CellNotificationT::CellNotificationT(const OCTETSTRING& par_elementIdentifier)
  :   field_elementIdentifier(par_elementIdentifier)
{
}

CellNotificationT::CellNotificationT(const CellNotificationT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.CellNotificationT.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void CellNotificationT::clean_up()
{
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* CellNotificationT::get_descriptor() const { return &CellNotificationT_descr_; }
CellNotificationT& CellNotificationT::operator=(const CellNotificationT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.CellNotificationT.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean CellNotificationT::operator==(const CellNotificationT& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean CellNotificationT::is_bound() const
{
return (field_elementIdentifier.is_bound());
}
boolean CellNotificationT::is_value() const
{
return field_elementIdentifier.is_value();
}
void CellNotificationT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void CellNotificationT::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void CellNotificationT::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.CellNotificationT has 1 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) elementIdentifier().set_param(*param.get_elem(0));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.CellNotificationT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.CellNotificationT");
  }
}

void CellNotificationT::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
}

void CellNotificationT::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
}

void CellNotificationT::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CellNotificationT::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CellNotificationT::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  if (field_elementIdentifier !=  os_5) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CellNotificationT::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  if (field_elementIdentifier !=  os_5) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct CellNotificationT_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
};

void CellNotificationT_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_elementIdentifier = ANY_VALUE;
}
}
}

void CellNotificationT_template::copy_value(const CellNotificationT& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellNotificationT_template::copy_template(const CellNotificationT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 CellNotificationT_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 CellNotificationT_template(*other_value.implication_.precondition);
implication_.implied_template = new CellNotificationT_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 @MobileL3_GMM_SM_Types.CellNotificationT.");
break;
}
set_selection(other_value);
}

CellNotificationT_template::CellNotificationT_template()
{
}

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

CellNotificationT_template::CellNotificationT_template(const CellNotificationT& other_value)
{
copy_value(other_value);
}

CellNotificationT_template::CellNotificationT_template(const OPTIONAL<CellNotificationT>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CellNotificationT&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.CellNotificationT from an unbound optional field.");
}
}

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

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

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

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

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

CellNotificationT_template& CellNotificationT_template::operator=(const CellNotificationT& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

CellNotificationT_template& CellNotificationT_template::operator=(const OPTIONAL<CellNotificationT>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CellNotificationT&)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 @MobileL3_GMM_SM_Types.CellNotificationT.");
}
return *this;
}

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

boolean CellNotificationT_template::match(const CellNotificationT& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.CellNotificationT.");
}
return FALSE;
}

boolean CellNotificationT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound();
}

boolean CellNotificationT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value();
}

void CellNotificationT_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;
}

CellNotificationT CellNotificationT_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 @MobileL3_GMM_SM_Types.CellNotificationT.");
CellNotificationT ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void CellNotificationT_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 @MobileL3_GMM_SM_Types.CellNotificationT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CellNotificationT_template[list_length];
}

CellNotificationT_template& CellNotificationT_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 @MobileL3_GMM_SM_Types.CellNotificationT.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.CellNotificationT.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& CellNotificationT_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& CellNotificationT_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.CellNotificationT.");
return single_value->field_elementIdentifier;
}

int CellNotificationT_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT 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 @MobileL3_GMM_SM_Types.CellNotificationT containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.CellNotificationT containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.CellNotificationT.");
  }
  return 0;
}

void CellNotificationT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.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 CellNotificationT_template::log_match(const CellNotificationT& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 CellNotificationT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.CellNotificationT.");
}
}

void CellNotificationT_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_elementIdentifier.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 CellNotificationT_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 @MobileL3_GMM_SM_Types.CellNotificationT.");
}
}

void CellNotificationT_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: {
    CellNotificationT_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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.CellNotificationT has 1 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) elementIdentifier().set_param(*param.get_elem(0));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.CellNotificationT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CellNotificationT_template* precondition = new CellNotificationT_template;
    precondition->set_param(*param.get_elem(0));
    CellNotificationT_template* implied_template = new CellNotificationT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CellNotificationT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.CellNotificationT");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellNotificationT_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.CellNotificationT");
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 : "@MobileL3_GMM_SM_Types.CellNotificationT");
}

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

boolean CellNotificationT_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;
}

PC__LCSCapabilityV::PC__LCSCapabilityV()
{
}

PC__LCSCapabilityV::PC__LCSCapabilityV(const BITSTRING& par_gPS__C,
    const BITSTRING& par_gPS__B,
    const BITSTRING& par_gPS__A,
    const BITSTRING& par_oTD__B,
    const BITSTRING& par_oTD__A,
    const BITSTRING& par_aPC,
    const BITSTRING& par_spare)
  :   field_gPS__C(par_gPS__C),
  field_gPS__B(par_gPS__B),
  field_gPS__A(par_gPS__A),
  field_oTD__B(par_oTD__B),
  field_oTD__A(par_oTD__A),
  field_aPC(par_aPC),
  field_spare(par_spare)
{
}

PC__LCSCapabilityV::PC__LCSCapabilityV(const PC__LCSCapabilityV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
if (other_value.gPS__C().is_bound()) field_gPS__C = other_value.gPS__C();
else field_gPS__C.clean_up();
if (other_value.gPS__B().is_bound()) field_gPS__B = other_value.gPS__B();
else field_gPS__B.clean_up();
if (other_value.gPS__A().is_bound()) field_gPS__A = other_value.gPS__A();
else field_gPS__A.clean_up();
if (other_value.oTD__B().is_bound()) field_oTD__B = other_value.oTD__B();
else field_oTD__B.clean_up();
if (other_value.oTD__A().is_bound()) field_oTD__A = other_value.oTD__A();
else field_oTD__A.clean_up();
if (other_value.aPC().is_bound()) field_aPC = other_value.aPC();
else field_aPC.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PC__LCSCapabilityV::clean_up()
{
field_gPS__C.clean_up();
field_gPS__B.clean_up();
field_gPS__A.clean_up();
field_oTD__B.clean_up();
field_oTD__A.clean_up();
field_aPC.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PC__LCSCapabilityV::get_descriptor() const { return &PC__LCSCapabilityV_descr_; }
PC__LCSCapabilityV& PC__LCSCapabilityV::operator=(const PC__LCSCapabilityV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
  if (other_value.gPS__C().is_bound()) field_gPS__C = other_value.gPS__C();
  else field_gPS__C.clean_up();
  if (other_value.gPS__B().is_bound()) field_gPS__B = other_value.gPS__B();
  else field_gPS__B.clean_up();
  if (other_value.gPS__A().is_bound()) field_gPS__A = other_value.gPS__A();
  else field_gPS__A.clean_up();
  if (other_value.oTD__B().is_bound()) field_oTD__B = other_value.oTD__B();
  else field_oTD__B.clean_up();
  if (other_value.oTD__A().is_bound()) field_oTD__A = other_value.oTD__A();
  else field_oTD__A.clean_up();
  if (other_value.aPC().is_bound()) field_aPC = other_value.aPC();
  else field_aPC.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean PC__LCSCapabilityV::operator==(const PC__LCSCapabilityV& other_value) const
{
return field_gPS__C==other_value.field_gPS__C
  && field_gPS__B==other_value.field_gPS__B
  && field_gPS__A==other_value.field_gPS__A
  && field_oTD__B==other_value.field_oTD__B
  && field_oTD__A==other_value.field_oTD__A
  && field_aPC==other_value.field_aPC
  && field_spare==other_value.field_spare;
}

boolean PC__LCSCapabilityV::is_bound() const
{
return (field_gPS__C.is_bound())
  || (field_gPS__B.is_bound())
  || (field_gPS__A.is_bound())
  || (field_oTD__B.is_bound())
  || (field_oTD__A.is_bound())
  || (field_aPC.is_bound())
  || (field_spare.is_bound());
}
boolean PC__LCSCapabilityV::is_value() const
{
return field_gPS__C.is_value()
  && field_gPS__B.is_value()
  && field_gPS__A.is_value()
  && field_oTD__B.is_value()
  && field_oTD__A.is_value()
  && field_aPC.is_value()
  && field_spare.is_value();
}
void PC__LCSCapabilityV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ gPS_C := ");
field_gPS__C.log();
TTCN_Logger::log_event_str(", gPS_B := ");
field_gPS__B.log();
TTCN_Logger::log_event_str(", gPS_A := ");
field_gPS__A.log();
TTCN_Logger::log_event_str(", oTD_B := ");
field_oTD__B.log();
TTCN_Logger::log_event_str(", oTD_A := ");
field_oTD__A.log();
TTCN_Logger::log_event_str(", aPC := ");
field_aPC.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PC__LCSCapabilityV::set_implicit_omit()
{
if (gPS__C().is_bound()) gPS__C().set_implicit_omit();
if (gPS__B().is_bound()) gPS__B().set_implicit_omit();
if (gPS__A().is_bound()) gPS__A().set_implicit_omit();
if (oTD__B().is_bound()) oTD__B().set_implicit_omit();
if (oTD__A().is_bound()) oTD__A().set_implicit_omit();
if (aPC().is_bound()) aPC().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void PC__LCSCapabilityV::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 (7<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV has 7 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) gPS__C().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gPS__B().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gPS__A().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oTD__B().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) oTD__A().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aPC().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    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(), "gPS_C")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__C().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(), "gPS_B")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__B().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(), "gPS_A")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__A().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(), "oTD_B")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oTD__B().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(), "oTD_A")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oTD__A().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(), "aPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPC().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
  }
}

void PC__LCSCapabilityV::encode_text(Text_Buf& text_buf) const
{
field_gPS__C.encode_text(text_buf);
field_gPS__B.encode_text(text_buf);
field_gPS__A.encode_text(text_buf);
field_oTD__B.encode_text(text_buf);
field_oTD__A.encode_text(text_buf);
field_aPC.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PC__LCSCapabilityV::decode_text(Text_Buf& text_buf)
{
field_gPS__C.decode_text(text_buf);
field_gPS__B.decode_text(text_buf);
field_gPS__A.decode_text(text_buf);
field_oTD__B.decode_text(text_buf);
field_oTD__A.decode_text(text_buf);
field_aPC.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void PC__LCSCapabilityV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PC__LCSCapabilityV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PC__LCSCapabilityV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_gPS__C.RAW_decode(General__Types::BIT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_gPS__B.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_gPS__A.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oTD__B.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oTD__A.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_aPC.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PC__LCSCapabilityV::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 = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT2_descr_.raw);
  encoded_length += field_gPS__C.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gPS__B.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gPS__A.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_oTD__B.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_oTD__A.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_aPC.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct PC__LCSCapabilityV_template::single_value_struct {
BITSTRING_template field_gPS__C;
BITSTRING_template field_gPS__B;
BITSTRING_template field_gPS__A;
BITSTRING_template field_oTD__B;
BITSTRING_template field_oTD__A;
BITSTRING_template field_aPC;
BITSTRING_template field_spare;
};

void PC__LCSCapabilityV_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_gPS__C = ANY_VALUE;
single_value->field_gPS__B = ANY_VALUE;
single_value->field_gPS__A = ANY_VALUE;
single_value->field_oTD__B = ANY_VALUE;
single_value->field_oTD__A = ANY_VALUE;
single_value->field_aPC = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PC__LCSCapabilityV_template::copy_value(const PC__LCSCapabilityV& other_value)
{
single_value = new single_value_struct;
if (other_value.gPS__C().is_bound()) {
  single_value->field_gPS__C = other_value.gPS__C();
} else {
  single_value->field_gPS__C.clean_up();
}
if (other_value.gPS__B().is_bound()) {
  single_value->field_gPS__B = other_value.gPS__B();
} else {
  single_value->field_gPS__B.clean_up();
}
if (other_value.gPS__A().is_bound()) {
  single_value->field_gPS__A = other_value.gPS__A();
} else {
  single_value->field_gPS__A.clean_up();
}
if (other_value.oTD__B().is_bound()) {
  single_value->field_oTD__B = other_value.oTD__B();
} else {
  single_value->field_oTD__B.clean_up();
}
if (other_value.oTD__A().is_bound()) {
  single_value->field_oTD__A = other_value.oTD__A();
} else {
  single_value->field_oTD__A.clean_up();
}
if (other_value.aPC().is_bound()) {
  single_value->field_aPC = other_value.aPC();
} else {
  single_value->field_aPC.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PC__LCSCapabilityV_template::copy_template(const PC__LCSCapabilityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.gPS__C().get_selection()) {
single_value->field_gPS__C = other_value.gPS__C();
} else {
single_value->field_gPS__C.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gPS__B().get_selection()) {
single_value->field_gPS__B = other_value.gPS__B();
} else {
single_value->field_gPS__B.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gPS__A().get_selection()) {
single_value->field_gPS__A = other_value.gPS__A();
} else {
single_value->field_gPS__A.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oTD__B().get_selection()) {
single_value->field_oTD__B = other_value.oTD__B();
} else {
single_value->field_oTD__B.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oTD__A().get_selection()) {
single_value->field_oTD__A = other_value.oTD__A();
} else {
single_value->field_oTD__A.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aPC().get_selection()) {
single_value->field_aPC = other_value.aPC();
} else {
single_value->field_aPC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.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 PC__LCSCapabilityV_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 PC__LCSCapabilityV_template(*other_value.implication_.precondition);
implication_.implied_template = new PC__LCSCapabilityV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
break;
}
set_selection(other_value);
}

PC__LCSCapabilityV_template::PC__LCSCapabilityV_template()
{
}

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

PC__LCSCapabilityV_template::PC__LCSCapabilityV_template(const PC__LCSCapabilityV& other_value)
{
copy_value(other_value);
}

PC__LCSCapabilityV_template::PC__LCSCapabilityV_template(const OPTIONAL<PC__LCSCapabilityV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapabilityV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV from an unbound optional field.");
}
}

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

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

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

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

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

PC__LCSCapabilityV_template& PC__LCSCapabilityV_template::operator=(const PC__LCSCapabilityV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PC__LCSCapabilityV_template& PC__LCSCapabilityV_template::operator=(const OPTIONAL<PC__LCSCapabilityV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapabilityV&)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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
}
return *this;
}

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

boolean PC__LCSCapabilityV_template::match(const PC__LCSCapabilityV& 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.gPS__C().is_bound()) return FALSE;
if(!single_value->field_gPS__C.match(other_value.gPS__C(), legacy))return FALSE;
if(!other_value.gPS__B().is_bound()) return FALSE;
if(!single_value->field_gPS__B.match(other_value.gPS__B(), legacy))return FALSE;
if(!other_value.gPS__A().is_bound()) return FALSE;
if(!single_value->field_gPS__A.match(other_value.gPS__A(), legacy))return FALSE;
if(!other_value.oTD__B().is_bound()) return FALSE;
if(!single_value->field_oTD__B.match(other_value.oTD__B(), legacy))return FALSE;
if(!other_value.oTD__A().is_bound()) return FALSE;
if(!single_value->field_oTD__A.match(other_value.oTD__A(), legacy))return FALSE;
if(!other_value.aPC().is_bound()) return FALSE;
if(!single_value->field_aPC.match(other_value.aPC(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), 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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
}
return FALSE;
}

boolean PC__LCSCapabilityV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_gPS__C.is_bound()
 || single_value->field_gPS__B.is_bound()
 || single_value->field_gPS__A.is_bound()
 || single_value->field_oTD__B.is_bound()
 || single_value->field_oTD__A.is_bound()
 || single_value->field_aPC.is_bound()
 || single_value->field_spare.is_bound();
}

boolean PC__LCSCapabilityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_gPS__C.is_value()
 && single_value->field_gPS__B.is_value()
 && single_value->field_gPS__A.is_value()
 && single_value->field_oTD__B.is_value()
 && single_value->field_oTD__A.is_value()
 && single_value->field_aPC.is_value()
 && single_value->field_spare.is_value();
}

void PC__LCSCapabilityV_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;
}

PC__LCSCapabilityV PC__LCSCapabilityV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
PC__LCSCapabilityV ret_val;
if (single_value->field_gPS__C.is_bound()) {
ret_val.gPS__C() = single_value->field_gPS__C.valueof();
}
if (single_value->field_gPS__B.is_bound()) {
ret_val.gPS__B() = single_value->field_gPS__B.valueof();
}
if (single_value->field_gPS__A.is_bound()) {
ret_val.gPS__A() = single_value->field_gPS__A.valueof();
}
if (single_value->field_oTD__B.is_bound()) {
ret_val.oTD__B() = single_value->field_oTD__B.valueof();
}
if (single_value->field_oTD__A.is_bound()) {
ret_val.oTD__A() = single_value->field_oTD__A.valueof();
}
if (single_value->field_aPC.is_bound()) {
ret_val.aPC() = single_value->field_aPC.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void PC__LCSCapabilityV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PC__LCSCapabilityV_template[list_length];
}

PC__LCSCapabilityV_template& PC__LCSCapabilityV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return value_list.list_value[list_index];
}

BITSTRING_template& PC__LCSCapabilityV_template::gPS__C()
{
set_specific();
return single_value->field_gPS__C;
}

const BITSTRING_template& PC__LCSCapabilityV_template::gPS__C() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPS_C of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_gPS__C;
}

BITSTRING_template& PC__LCSCapabilityV_template::gPS__B()
{
set_specific();
return single_value->field_gPS__B;
}

const BITSTRING_template& PC__LCSCapabilityV_template::gPS__B() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPS_B of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_gPS__B;
}

BITSTRING_template& PC__LCSCapabilityV_template::gPS__A()
{
set_specific();
return single_value->field_gPS__A;
}

const BITSTRING_template& PC__LCSCapabilityV_template::gPS__A() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPS_A of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_gPS__A;
}

BITSTRING_template& PC__LCSCapabilityV_template::oTD__B()
{
set_specific();
return single_value->field_oTD__B;
}

const BITSTRING_template& PC__LCSCapabilityV_template::oTD__B() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oTD_B of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_oTD__B;
}

BITSTRING_template& PC__LCSCapabilityV_template::oTD__A()
{
set_specific();
return single_value->field_oTD__A;
}

const BITSTRING_template& PC__LCSCapabilityV_template::oTD__A() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oTD_A of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_oTD__A;
}

BITSTRING_template& PC__LCSCapabilityV_template::aPC()
{
set_specific();
return single_value->field_aPC;
}

const BITSTRING_template& PC__LCSCapabilityV_template::aPC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aPC of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_aPC;
}

BITSTRING_template& PC__LCSCapabilityV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PC__LCSCapabilityV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
return single_value->field_spare;
}

int PC__LCSCapabilityV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 7;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV 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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
  }
  return 0;
}

void PC__LCSCapabilityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ gPS_C := ");
single_value->field_gPS__C.log();
TTCN_Logger::log_event_str(", gPS_B := ");
single_value->field_gPS__B.log();
TTCN_Logger::log_event_str(", gPS_A := ");
single_value->field_gPS__A.log();
TTCN_Logger::log_event_str(", oTD_B := ");
single_value->field_oTD__B.log();
TTCN_Logger::log_event_str(", oTD_A := ");
single_value->field_oTD__A.log();
TTCN_Logger::log_event_str(", aPC := ");
single_value->field_aPC.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.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 PC__LCSCapabilityV_template::log_match(const PC__LCSCapabilityV& 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_gPS__C.match(match_value.gPS__C(), legacy)){
TTCN_Logger::log_logmatch_info(".gPS_C");
single_value->field_gPS__C.log_match(match_value.gPS__C(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gPS__B.match(match_value.gPS__B(), legacy)){
TTCN_Logger::log_logmatch_info(".gPS_B");
single_value->field_gPS__B.log_match(match_value.gPS__B(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gPS__A.match(match_value.gPS__A(), legacy)){
TTCN_Logger::log_logmatch_info(".gPS_A");
single_value->field_gPS__A.log_match(match_value.gPS__A(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oTD__B.match(match_value.oTD__B(), legacy)){
TTCN_Logger::log_logmatch_info(".oTD_B");
single_value->field_oTD__B.log_match(match_value.oTD__B(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oTD__A.match(match_value.oTD__A(), legacy)){
TTCN_Logger::log_logmatch_info(".oTD_A");
single_value->field_oTD__A.log_match(match_value.oTD__A(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aPC.match(match_value.aPC(), legacy)){
TTCN_Logger::log_logmatch_info(".aPC");
single_value->field_aPC.log_match(match_value.aPC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), 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("{ gPS_C := ");
single_value->field_gPS__C.log_match(match_value.gPS__C(), legacy);
TTCN_Logger::log_event_str(", gPS_B := ");
single_value->field_gPS__B.log_match(match_value.gPS__B(), legacy);
TTCN_Logger::log_event_str(", gPS_A := ");
single_value->field_gPS__A.log_match(match_value.gPS__A(), legacy);
TTCN_Logger::log_event_str(", oTD_B := ");
single_value->field_oTD__B.log_match(match_value.oTD__B(), legacy);
TTCN_Logger::log_event_str(", oTD_A := ");
single_value->field_oTD__A.log_match(match_value.oTD__A(), legacy);
TTCN_Logger::log_event_str(", aPC := ");
single_value->field_aPC.log_match(match_value.aPC(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), 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 PC__LCSCapabilityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_gPS__C.encode_text(text_buf);
single_value->field_gPS__B.encode_text(text_buf);
single_value->field_gPS__A.encode_text(text_buf);
single_value->field_oTD__B.encode_text(text_buf);
single_value->field_oTD__A.encode_text(text_buf);
single_value->field_aPC.encode_text(text_buf);
single_value->field_spare.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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
}
}

void PC__LCSCapabilityV_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_gPS__C.decode_text(text_buf);
single_value->field_gPS__B.decode_text(text_buf);
single_value->field_gPS__A.decode_text(text_buf);
single_value->field_oTD__B.decode_text(text_buf);
single_value->field_oTD__A.decode_text(text_buf);
single_value->field_aPC.decode_text(text_buf);
single_value->field_spare.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 PC__LCSCapabilityV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV.");
}
}

void PC__LCSCapabilityV_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: {
    PC__LCSCapabilityV_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 (7<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityV has 7 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) gPS__C().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gPS__B().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gPS__A().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oTD__B().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) oTD__A().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aPC().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    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(), "gPS_C")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__C().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(), "gPS_B")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__B().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(), "gPS_A")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPS__A().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(), "oTD_B")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oTD__B().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(), "oTD_A")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oTD__A().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(), "aPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPC().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PC__LCSCapabilityV_template* precondition = new PC__LCSCapabilityV_template;
    precondition->set_param(*param.get_elem(0));
    PC__LCSCapabilityV_template* implied_template = new PC__LCSCapabilityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PC__LCSCapabilityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PC__LCSCapabilityV_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_gPS__C.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_gPS__B.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_gPS__A.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_oTD__B.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_oTD__A.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_aPC.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
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 : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityV");
}

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

boolean PC__LCSCapabilityV_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;
}

PC__LCSCapabilityLV::PC__LCSCapabilityLV()
{
}

PC__LCSCapabilityLV::PC__LCSCapabilityLV(const INTEGER& par_lengthIndicator,
    const PC__LCSCapabilityV& par_pC__LCSCapabilityV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_pC__LCSCapabilityV(par_pC__LCSCapabilityV)
{
}

PC__LCSCapabilityLV::PC__LCSCapabilityLV(const PC__LCSCapabilityLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.pC__LCSCapabilityV().is_bound()) field_pC__LCSCapabilityV = other_value.pC__LCSCapabilityV();
else field_pC__LCSCapabilityV.clean_up();
}

void PC__LCSCapabilityLV::clean_up()
{
field_lengthIndicator.clean_up();
field_pC__LCSCapabilityV.clean_up();
}

const TTCN_Typedescriptor_t* PC__LCSCapabilityLV::get_descriptor() const { return &PC__LCSCapabilityLV_descr_; }
PC__LCSCapabilityLV& PC__LCSCapabilityLV::operator=(const PC__LCSCapabilityLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.pC__LCSCapabilityV().is_bound()) field_pC__LCSCapabilityV = other_value.pC__LCSCapabilityV();
  else field_pC__LCSCapabilityV.clean_up();
}
return *this;
}

boolean PC__LCSCapabilityLV::operator==(const PC__LCSCapabilityLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_pC__LCSCapabilityV==other_value.field_pC__LCSCapabilityV;
}

boolean PC__LCSCapabilityLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_pC__LCSCapabilityV.is_bound());
}
boolean PC__LCSCapabilityLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_pC__LCSCapabilityV.is_value();
}
void PC__LCSCapabilityLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", pC_LCSCapabilityV := ");
field_pC__LCSCapabilityV.log();
TTCN_Logger::log_event_str(" }");
}

void PC__LCSCapabilityLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (pC__LCSCapabilityV().is_bound()) pC__LCSCapabilityV().set_implicit_omit();
}

void PC__LCSCapabilityLV::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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "pC_LCSCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapabilityV().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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PC_LCSCapabilityLV");
  }
}

void PC__LCSCapabilityLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_pC__LCSCapabilityV.encode_text(text_buf);
}

void PC__LCSCapabilityLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_pC__LCSCapabilityV.decode_text(text_buf);
}

void PC__LCSCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PC__LCSCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PC__LCSCapabilityLV::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;
  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, PC__LCSCapabilityLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PC__LCSCapabilityLV_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(PC__LCSCapabilityLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PC__LCSCapabilityV_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapabilityV.RAW_decode(PC__LCSCapabilityV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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 PC__LCSCapabilityLV::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, PC__LCSCapabilityLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PC__LCSCapabilityV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &PC__LCSCapabilityLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_pC__LCSCapabilityV.RAW_encode(PC__LCSCapabilityV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PC__LCSCapabilityLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
PC__LCSCapabilityV_template field_pC__LCSCapabilityV;
};

void PC__LCSCapabilityLV_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_lengthIndicator = ANY_VALUE;
single_value->field_pC__LCSCapabilityV = ANY_VALUE;
}
}
}

void PC__LCSCapabilityLV_template::copy_value(const PC__LCSCapabilityLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.pC__LCSCapabilityV().is_bound()) {
  single_value->field_pC__LCSCapabilityV = other_value.pC__LCSCapabilityV();
} else {
  single_value->field_pC__LCSCapabilityV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PC__LCSCapabilityLV_template::copy_template(const PC__LCSCapabilityLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapabilityV().get_selection()) {
single_value->field_pC__LCSCapabilityV = other_value.pC__LCSCapabilityV();
} else {
single_value->field_pC__LCSCapabilityV.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 PC__LCSCapabilityLV_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 PC__LCSCapabilityLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
break;
}
set_selection(other_value);
}

PC__LCSCapabilityLV_template::PC__LCSCapabilityLV_template()
{
}

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

PC__LCSCapabilityLV_template::PC__LCSCapabilityLV_template(const PC__LCSCapabilityLV& other_value)
{
copy_value(other_value);
}

PC__LCSCapabilityLV_template::PC__LCSCapabilityLV_template(const OPTIONAL<PC__LCSCapabilityLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapabilityLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV from an unbound optional field.");
}
}

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

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

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

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

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

PC__LCSCapabilityLV_template& PC__LCSCapabilityLV_template::operator=(const PC__LCSCapabilityLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PC__LCSCapabilityLV_template& PC__LCSCapabilityLV_template::operator=(const OPTIONAL<PC__LCSCapabilityLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapabilityLV&)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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
}
return *this;
}

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

boolean PC__LCSCapabilityLV_template::match(const PC__LCSCapabilityLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.pC__LCSCapabilityV().is_bound()) return FALSE;
if(!single_value->field_pC__LCSCapabilityV.match(other_value.pC__LCSCapabilityV(), 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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
}
return FALSE;
}

boolean PC__LCSCapabilityLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_pC__LCSCapabilityV.is_bound();
}

boolean PC__LCSCapabilityLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_pC__LCSCapabilityV.is_value();
}

void PC__LCSCapabilityLV_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;
}

PC__LCSCapabilityLV PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
PC__LCSCapabilityLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_pC__LCSCapabilityV.is_bound()) {
ret_val.pC__LCSCapabilityV() = single_value->field_pC__LCSCapabilityV.valueof();
}
return ret_val;
}

void PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PC__LCSCapabilityLV_template[list_length];
}

PC__LCSCapabilityLV_template& PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
return value_list.list_value[list_index];
}

INTEGER_template& PC__LCSCapabilityLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& PC__LCSCapabilityLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
return single_value->field_lengthIndicator;
}

PC__LCSCapabilityV_template& PC__LCSCapabilityLV_template::pC__LCSCapabilityV()
{
set_specific();
return single_value->field_pC__LCSCapabilityV;
}

const PC__LCSCapabilityV_template& PC__LCSCapabilityLV_template::pC__LCSCapabilityV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapabilityV of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
return single_value->field_pC__LCSCapabilityV;
}

int PC__LCSCapabilityLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV 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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV 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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
  }
  return 0;
}

void PC__LCSCapabilityLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", pC_LCSCapabilityV := ");
single_value->field_pC__LCSCapabilityV.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 PC__LCSCapabilityLV_template::log_match(const PC__LCSCapabilityLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pC__LCSCapabilityV.match(match_value.pC__LCSCapabilityV(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapabilityV");
single_value->field_pC__LCSCapabilityV.log_match(match_value.pC__LCSCapabilityV(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", pC_LCSCapabilityV := ");
single_value->field_pC__LCSCapabilityV.log_match(match_value.pC__LCSCapabilityV(), 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 PC__LCSCapabilityLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_pC__LCSCapabilityV.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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
}
}

void PC__LCSCapabilityLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_pC__LCSCapabilityV.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 PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV.");
}
}

void PC__LCSCapabilityLV_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: {
    PC__LCSCapabilityLV_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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "pC_LCSCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapabilityV().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 @MobileL3_GMM_SM_Types.PC_LCSCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PC__LCSCapabilityLV_template* precondition = new PC__LCSCapabilityLV_template;
    precondition->set_param(*param.get_elem(0));
    PC__LCSCapabilityLV_template* implied_template = new PC__LCSCapabilityLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PC__LCSCapabilityLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PC_LCSCapabilityLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PC__LCSCapabilityLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityLV");
single_value->field_pC__LCSCapabilityV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityLV");
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 : "@MobileL3_GMM_SM_Types.PC_LCSCapabilityLV");
}

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

boolean PC__LCSCapabilityLV_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;
}

PC__LCSCapability::PC__LCSCapability()
{
}

PC__LCSCapability::PC__LCSCapability(const OCTETSTRING& par_elementIdentifier,
    const PC__LCSCapabilityLV& par_pC__LCSCapabilityLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_pC__LCSCapabilityLV(par_pC__LCSCapabilityLV)
{
}

PC__LCSCapability::PC__LCSCapability(const PC__LCSCapability& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.pC__LCSCapabilityLV().is_bound()) field_pC__LCSCapabilityLV = other_value.pC__LCSCapabilityLV();
else field_pC__LCSCapabilityLV.clean_up();
}

void PC__LCSCapability::clean_up()
{
field_elementIdentifier.clean_up();
field_pC__LCSCapabilityLV.clean_up();
}

const TTCN_Typedescriptor_t* PC__LCSCapability::get_descriptor() const { return &PC__LCSCapability_descr_; }
PC__LCSCapability& PC__LCSCapability::operator=(const PC__LCSCapability& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.pC__LCSCapabilityLV().is_bound()) field_pC__LCSCapabilityLV = other_value.pC__LCSCapabilityLV();
  else field_pC__LCSCapabilityLV.clean_up();
}
return *this;
}

boolean PC__LCSCapability::operator==(const PC__LCSCapability& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_pC__LCSCapabilityLV==other_value.field_pC__LCSCapabilityLV;
}

boolean PC__LCSCapability::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_pC__LCSCapabilityLV.is_bound());
}
boolean PC__LCSCapability::is_value() const
{
return field_elementIdentifier.is_value()
  && field_pC__LCSCapabilityLV.is_value();
}
void PC__LCSCapability::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", pC_LCSCapabilityLV := ");
field_pC__LCSCapabilityLV.log();
TTCN_Logger::log_event_str(" }");
}

void PC__LCSCapability::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (pC__LCSCapabilityLV().is_bound()) pC__LCSCapabilityLV().set_implicit_omit();
}

void PC__LCSCapability::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 @MobileL3_GMM_SM_Types.PC_LCSCapability 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapabilityLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "pC_LCSCapabilityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapabilityLV().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 @MobileL3_GMM_SM_Types.PC_LCSCapability: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PC_LCSCapability");
  }
}

void PC__LCSCapability::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_pC__LCSCapabilityLV.encode_text(text_buf);
}

void PC__LCSCapability::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_pC__LCSCapabilityLV.decode_text(text_buf);
}

void PC__LCSCapability::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PC__LCSCapability::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PC__LCSCapability::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PC__LCSCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapabilityLV.RAW_decode(PC__LCSCapabilityLV_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_elementIdentifier !=  os_6) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PC__LCSCapability::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PC__LCSCapabilityLV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pC__LCSCapabilityLV.RAW_encode(PC__LCSCapabilityLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_6) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PC__LCSCapability_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
PC__LCSCapabilityLV_template field_pC__LCSCapabilityLV;
};

void PC__LCSCapability_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_elementIdentifier = ANY_VALUE;
single_value->field_pC__LCSCapabilityLV = ANY_VALUE;
}
}
}

void PC__LCSCapability_template::copy_value(const PC__LCSCapability& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.pC__LCSCapabilityLV().is_bound()) {
  single_value->field_pC__LCSCapabilityLV = other_value.pC__LCSCapabilityLV();
} else {
  single_value->field_pC__LCSCapabilityLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PC__LCSCapability_template::copy_template(const PC__LCSCapability_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapabilityLV().get_selection()) {
single_value->field_pC__LCSCapabilityLV = other_value.pC__LCSCapabilityLV();
} else {
single_value->field_pC__LCSCapabilityLV.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 PC__LCSCapability_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 PC__LCSCapability_template(*other_value.implication_.precondition);
implication_.implied_template = new PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
break;
}
set_selection(other_value);
}

PC__LCSCapability_template::PC__LCSCapability_template()
{
}

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

PC__LCSCapability_template::PC__LCSCapability_template(const PC__LCSCapability& other_value)
{
copy_value(other_value);
}

PC__LCSCapability_template::PC__LCSCapability_template(const OPTIONAL<PC__LCSCapability>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapability&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability from an unbound optional field.");
}
}

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

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

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

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

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

PC__LCSCapability_template& PC__LCSCapability_template::operator=(const PC__LCSCapability& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PC__LCSCapability_template& PC__LCSCapability_template::operator=(const OPTIONAL<PC__LCSCapability>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PC__LCSCapability&)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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
}
return *this;
}

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

boolean PC__LCSCapability_template::match(const PC__LCSCapability& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.pC__LCSCapabilityLV().is_bound()) return FALSE;
if(!single_value->field_pC__LCSCapabilityLV.match(other_value.pC__LCSCapabilityLV(), 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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
}
return FALSE;
}

boolean PC__LCSCapability_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_pC__LCSCapabilityLV.is_bound();
}

boolean PC__LCSCapability_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_pC__LCSCapabilityLV.is_value();
}

void PC__LCSCapability_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;
}

PC__LCSCapability PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
PC__LCSCapability ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_pC__LCSCapabilityLV.is_bound()) {
ret_val.pC__LCSCapabilityLV() = single_value->field_pC__LCSCapabilityLV.valueof();
}
return ret_val;
}

void PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PC__LCSCapability_template[list_length];
}

PC__LCSCapability_template& PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PC__LCSCapability_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& PC__LCSCapability_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
return single_value->field_elementIdentifier;
}

PC__LCSCapabilityLV_template& PC__LCSCapability_template::pC__LCSCapabilityLV()
{
set_specific();
return single_value->field_pC__LCSCapabilityLV;
}

const PC__LCSCapabilityLV_template& PC__LCSCapability_template::pC__LCSCapabilityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapabilityLV of a non-specific template of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
return single_value->field_pC__LCSCapabilityLV;
}

int PC__LCSCapability_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability 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 @MobileL3_GMM_SM_Types.PC_LCSCapability 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 @MobileL3_GMM_SM_Types.PC_LCSCapability containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PC_LCSCapability containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PC_LCSCapability.");
  }
  return 0;
}

void PC__LCSCapability_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", pC_LCSCapabilityLV := ");
single_value->field_pC__LCSCapabilityLV.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 PC__LCSCapability_template::log_match(const PC__LCSCapability& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pC__LCSCapabilityLV.match(match_value.pC__LCSCapabilityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapabilityLV");
single_value->field_pC__LCSCapabilityLV.log_match(match_value.pC__LCSCapabilityLV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", pC_LCSCapabilityLV := ");
single_value->field_pC__LCSCapabilityLV.log_match(match_value.pC__LCSCapabilityLV(), 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 PC__LCSCapability_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_pC__LCSCapabilityLV.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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
}
}

void PC__LCSCapability_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_elementIdentifier.decode_text(text_buf);
single_value->field_pC__LCSCapabilityLV.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 PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability.");
}
}

void PC__LCSCapability_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: {
    PC__LCSCapability_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 @MobileL3_GMM_SM_Types.PC_LCSCapability 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapabilityLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "pC_LCSCapabilityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapabilityLV().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 @MobileL3_GMM_SM_Types.PC_LCSCapability: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PC__LCSCapability_template* precondition = new PC__LCSCapability_template;
    precondition->set_param(*param.get_elem(0));
    PC__LCSCapability_template* implied_template = new PC__LCSCapability_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PC__LCSCapability_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PC_LCSCapability");
  }
  is_ifpresent = param.get_ifpresent();
}

void PC__LCSCapability_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapability");
single_value->field_pC__LCSCapabilityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PC_LCSCapability");
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 : "@MobileL3_GMM_SM_Types.PC_LCSCapability");
}

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

boolean PC__LCSCapability_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;
}

NetworkFeatureSupportV::NetworkFeatureSupportV()
{
}

NetworkFeatureSupportV::NetworkFeatureSupportV(const BITSTRING& par_eMCBS,
    const BITSTRING& par_iMSVoPS,
    const BITSTRING& par_mBMS,
    const BITSTRING& par_lCS__MOLR)
  :   field_eMCBS(par_eMCBS),
  field_iMSVoPS(par_iMSVoPS),
  field_mBMS(par_mBMS),
  field_lCS__MOLR(par_lCS__MOLR)
{
}

NetworkFeatureSupportV::NetworkFeatureSupportV(const NetworkFeatureSupportV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
if (other_value.eMCBS().is_bound()) field_eMCBS = other_value.eMCBS();
else field_eMCBS.clean_up();
if (other_value.iMSVoPS().is_bound()) field_iMSVoPS = other_value.iMSVoPS();
else field_iMSVoPS.clean_up();
if (other_value.mBMS().is_bound()) field_mBMS = other_value.mBMS();
else field_mBMS.clean_up();
if (other_value.lCS__MOLR().is_bound()) field_lCS__MOLR = other_value.lCS__MOLR();
else field_lCS__MOLR.clean_up();
}

void NetworkFeatureSupportV::clean_up()
{
field_eMCBS.clean_up();
field_iMSVoPS.clean_up();
field_mBMS.clean_up();
field_lCS__MOLR.clean_up();
}

const TTCN_Typedescriptor_t* NetworkFeatureSupportV::get_descriptor() const { return &NetworkFeatureSupportV_descr_; }
NetworkFeatureSupportV& NetworkFeatureSupportV::operator=(const NetworkFeatureSupportV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
  if (other_value.eMCBS().is_bound()) field_eMCBS = other_value.eMCBS();
  else field_eMCBS.clean_up();
  if (other_value.iMSVoPS().is_bound()) field_iMSVoPS = other_value.iMSVoPS();
  else field_iMSVoPS.clean_up();
  if (other_value.mBMS().is_bound()) field_mBMS = other_value.mBMS();
  else field_mBMS.clean_up();
  if (other_value.lCS__MOLR().is_bound()) field_lCS__MOLR = other_value.lCS__MOLR();
  else field_lCS__MOLR.clean_up();
}
return *this;
}

boolean NetworkFeatureSupportV::operator==(const NetworkFeatureSupportV& other_value) const
{
return field_eMCBS==other_value.field_eMCBS
  && field_iMSVoPS==other_value.field_iMSVoPS
  && field_mBMS==other_value.field_mBMS
  && field_lCS__MOLR==other_value.field_lCS__MOLR;
}

boolean NetworkFeatureSupportV::is_bound() const
{
return (field_eMCBS.is_bound())
  || (field_iMSVoPS.is_bound())
  || (field_mBMS.is_bound())
  || (field_lCS__MOLR.is_bound());
}
boolean NetworkFeatureSupportV::is_value() const
{
return field_eMCBS.is_value()
  && field_iMSVoPS.is_value()
  && field_mBMS.is_value()
  && field_lCS__MOLR.is_value();
}
void NetworkFeatureSupportV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ eMCBS := ");
field_eMCBS.log();
TTCN_Logger::log_event_str(", iMSVoPS := ");
field_iMSVoPS.log();
TTCN_Logger::log_event_str(", mBMS := ");
field_mBMS.log();
TTCN_Logger::log_event_str(", lCS_MOLR := ");
field_lCS__MOLR.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkFeatureSupportV::set_implicit_omit()
{
if (eMCBS().is_bound()) eMCBS().set_implicit_omit();
if (iMSVoPS().is_bound()) iMSVoPS().set_implicit_omit();
if (mBMS().is_bound()) mBMS().set_implicit_omit();
if (lCS__MOLR().is_bound()) lCS__MOLR().set_implicit_omit();
}

void NetworkFeatureSupportV::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV has 4 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) eMCBS().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSVoPS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lCS__MOLR().set_param(*param.get_elem(3));
    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(), "eMCBS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMCBS().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(), "iMSVoPS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSVoPS().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(), "mBMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS().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(), "lCS_MOLR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__MOLR().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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
  }
}

void NetworkFeatureSupportV::encode_text(Text_Buf& text_buf) const
{
field_eMCBS.encode_text(text_buf);
field_iMSVoPS.encode_text(text_buf);
field_mBMS.encode_text(text_buf);
field_lCS__MOLR.encode_text(text_buf);
}

void NetworkFeatureSupportV::decode_text(Text_Buf& text_buf)
{
field_eMCBS.decode_text(text_buf);
field_iMSVoPS.decode_text(text_buf);
field_mBMS.decode_text(text_buf);
field_lCS__MOLR.decode_text(text_buf);
}

void NetworkFeatureSupportV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void NetworkFeatureSupportV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int NetworkFeatureSupportV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_eMCBS.RAW_decode(General__Types::BIT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_iMSVoPS.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mBMS.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lCS__MOLR.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkFeatureSupportV::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  encoded_length += field_eMCBS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSVoPS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mBMS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_lCS__MOLR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct NetworkFeatureSupportV_template::single_value_struct {
BITSTRING_template field_eMCBS;
BITSTRING_template field_iMSVoPS;
BITSTRING_template field_mBMS;
BITSTRING_template field_lCS__MOLR;
};

void NetworkFeatureSupportV_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_eMCBS = ANY_VALUE;
single_value->field_iMSVoPS = ANY_VALUE;
single_value->field_mBMS = ANY_VALUE;
single_value->field_lCS__MOLR = ANY_VALUE;
}
}
}

void NetworkFeatureSupportV_template::copy_value(const NetworkFeatureSupportV& other_value)
{
single_value = new single_value_struct;
if (other_value.eMCBS().is_bound()) {
  single_value->field_eMCBS = other_value.eMCBS();
} else {
  single_value->field_eMCBS.clean_up();
}
if (other_value.iMSVoPS().is_bound()) {
  single_value->field_iMSVoPS = other_value.iMSVoPS();
} else {
  single_value->field_iMSVoPS.clean_up();
}
if (other_value.mBMS().is_bound()) {
  single_value->field_mBMS = other_value.mBMS();
} else {
  single_value->field_mBMS.clean_up();
}
if (other_value.lCS__MOLR().is_bound()) {
  single_value->field_lCS__MOLR = other_value.lCS__MOLR();
} else {
  single_value->field_lCS__MOLR.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkFeatureSupportV_template::copy_template(const NetworkFeatureSupportV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.eMCBS().get_selection()) {
single_value->field_eMCBS = other_value.eMCBS();
} else {
single_value->field_eMCBS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSVoPS().get_selection()) {
single_value->field_iMSVoPS = other_value.iMSVoPS();
} else {
single_value->field_iMSVoPS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS().get_selection()) {
single_value->field_mBMS = other_value.mBMS();
} else {
single_value->field_mBMS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS__MOLR().get_selection()) {
single_value->field_lCS__MOLR = other_value.lCS__MOLR();
} else {
single_value->field_lCS__MOLR.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 NetworkFeatureSupportV_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 NetworkFeatureSupportV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
break;
}
set_selection(other_value);
}

NetworkFeatureSupportV_template::NetworkFeatureSupportV_template()
{
}

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

NetworkFeatureSupportV_template::NetworkFeatureSupportV_template(const NetworkFeatureSupportV& other_value)
{
copy_value(other_value);
}

NetworkFeatureSupportV_template::NetworkFeatureSupportV_template(const OPTIONAL<NetworkFeatureSupportV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkFeatureSupportV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV from an unbound optional field.");
}
}

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

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

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

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

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

NetworkFeatureSupportV_template& NetworkFeatureSupportV_template::operator=(const NetworkFeatureSupportV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NetworkFeatureSupportV_template& NetworkFeatureSupportV_template::operator=(const OPTIONAL<NetworkFeatureSupportV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkFeatureSupportV&)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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
}
return *this;
}

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

boolean NetworkFeatureSupportV_template::match(const NetworkFeatureSupportV& 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.eMCBS().is_bound()) return FALSE;
if(!single_value->field_eMCBS.match(other_value.eMCBS(), legacy))return FALSE;
if(!other_value.iMSVoPS().is_bound()) return FALSE;
if(!single_value->field_iMSVoPS.match(other_value.iMSVoPS(), legacy))return FALSE;
if(!other_value.mBMS().is_bound()) return FALSE;
if(!single_value->field_mBMS.match(other_value.mBMS(), legacy))return FALSE;
if(!other_value.lCS__MOLR().is_bound()) return FALSE;
if(!single_value->field_lCS__MOLR.match(other_value.lCS__MOLR(), 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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
}
return FALSE;
}

boolean NetworkFeatureSupportV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_eMCBS.is_bound()
 || single_value->field_iMSVoPS.is_bound()
 || single_value->field_mBMS.is_bound()
 || single_value->field_lCS__MOLR.is_bound();
}

boolean NetworkFeatureSupportV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_eMCBS.is_value()
 && single_value->field_iMSVoPS.is_value()
 && single_value->field_mBMS.is_value()
 && single_value->field_lCS__MOLR.is_value();
}

void NetworkFeatureSupportV_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;
}

NetworkFeatureSupportV NetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
NetworkFeatureSupportV ret_val;
if (single_value->field_eMCBS.is_bound()) {
ret_val.eMCBS() = single_value->field_eMCBS.valueof();
}
if (single_value->field_iMSVoPS.is_bound()) {
ret_val.iMSVoPS() = single_value->field_iMSVoPS.valueof();
}
if (single_value->field_mBMS.is_bound()) {
ret_val.mBMS() = single_value->field_mBMS.valueof();
}
if (single_value->field_lCS__MOLR.is_bound()) {
ret_val.lCS__MOLR() = single_value->field_lCS__MOLR.valueof();
}
return ret_val;
}

void NetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkFeatureSupportV_template[list_length];
}

NetworkFeatureSupportV_template& NetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
return value_list.list_value[list_index];
}

BITSTRING_template& NetworkFeatureSupportV_template::eMCBS()
{
set_specific();
return single_value->field_eMCBS;
}

const BITSTRING_template& NetworkFeatureSupportV_template::eMCBS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMCBS of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
return single_value->field_eMCBS;
}

BITSTRING_template& NetworkFeatureSupportV_template::iMSVoPS()
{
set_specific();
return single_value->field_iMSVoPS;
}

const BITSTRING_template& NetworkFeatureSupportV_template::iMSVoPS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSVoPS of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
return single_value->field_iMSVoPS;
}

BITSTRING_template& NetworkFeatureSupportV_template::mBMS()
{
set_specific();
return single_value->field_mBMS;
}

const BITSTRING_template& NetworkFeatureSupportV_template::mBMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
return single_value->field_mBMS;
}

BITSTRING_template& NetworkFeatureSupportV_template::lCS__MOLR()
{
set_specific();
return single_value->field_lCS__MOLR;
}

const BITSTRING_template& NetworkFeatureSupportV_template::lCS__MOLR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS_MOLR of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
return single_value->field_lCS__MOLR;
}

int NetworkFeatureSupportV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV 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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
  }
  return 0;
}

void NetworkFeatureSupportV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ eMCBS := ");
single_value->field_eMCBS.log();
TTCN_Logger::log_event_str(", iMSVoPS := ");
single_value->field_iMSVoPS.log();
TTCN_Logger::log_event_str(", mBMS := ");
single_value->field_mBMS.log();
TTCN_Logger::log_event_str(", lCS_MOLR := ");
single_value->field_lCS__MOLR.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 NetworkFeatureSupportV_template::log_match(const NetworkFeatureSupportV& 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_eMCBS.match(match_value.eMCBS(), legacy)){
TTCN_Logger::log_logmatch_info(".eMCBS");
single_value->field_eMCBS.log_match(match_value.eMCBS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSVoPS.match(match_value.iMSVoPS(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSVoPS");
single_value->field_iMSVoPS.log_match(match_value.iMSVoPS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS.match(match_value.mBMS(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS");
single_value->field_mBMS.log_match(match_value.mBMS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lCS__MOLR.match(match_value.lCS__MOLR(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS_MOLR");
single_value->field_lCS__MOLR.log_match(match_value.lCS__MOLR(), 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("{ eMCBS := ");
single_value->field_eMCBS.log_match(match_value.eMCBS(), legacy);
TTCN_Logger::log_event_str(", iMSVoPS := ");
single_value->field_iMSVoPS.log_match(match_value.iMSVoPS(), legacy);
TTCN_Logger::log_event_str(", mBMS := ");
single_value->field_mBMS.log_match(match_value.mBMS(), legacy);
TTCN_Logger::log_event_str(", lCS_MOLR := ");
single_value->field_lCS__MOLR.log_match(match_value.lCS__MOLR(), 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 NetworkFeatureSupportV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_eMCBS.encode_text(text_buf);
single_value->field_iMSVoPS.encode_text(text_buf);
single_value->field_mBMS.encode_text(text_buf);
single_value->field_lCS__MOLR.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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
}
}

void NetworkFeatureSupportV_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_eMCBS.decode_text(text_buf);
single_value->field_iMSVoPS.decode_text(text_buf);
single_value->field_mBMS.decode_text(text_buf);
single_value->field_lCS__MOLR.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 NetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV.");
}
}

void NetworkFeatureSupportV_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: {
    NetworkFeatureSupportV_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportV has 4 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) eMCBS().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSVoPS().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lCS__MOLR().set_param(*param.get_elem(3));
    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(), "eMCBS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMCBS().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(), "iMSVoPS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSVoPS().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(), "mBMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS().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(), "lCS_MOLR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS__MOLR().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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkFeatureSupportV_template* precondition = new NetworkFeatureSupportV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkFeatureSupportV_template* implied_template = new NetworkFeatureSupportV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkFeatureSupportV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkFeatureSupportV_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_eMCBS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
single_value->field_iMSVoPS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
single_value->field_mBMS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
single_value->field_lCS__MOLR.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
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 : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportV");
}

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

boolean NetworkFeatureSupportV_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;
}

NetworkFeatureSupportTV::NetworkFeatureSupportTV()
{
}

NetworkFeatureSupportTV::NetworkFeatureSupportTV(const NetworkFeatureSupportV& par_networkFeatureSupportV,
    const BITSTRING& par_elementIdentifier)
  :   field_networkFeatureSupportV(par_networkFeatureSupportV),
  field_elementIdentifier(par_elementIdentifier)
{
}

NetworkFeatureSupportTV::NetworkFeatureSupportTV(const NetworkFeatureSupportTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
if (other_value.networkFeatureSupportV().is_bound()) field_networkFeatureSupportV = other_value.networkFeatureSupportV();
else field_networkFeatureSupportV.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void NetworkFeatureSupportTV::clean_up()
{
field_networkFeatureSupportV.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* NetworkFeatureSupportTV::get_descriptor() const { return &NetworkFeatureSupportTV_descr_; }
NetworkFeatureSupportTV& NetworkFeatureSupportTV::operator=(const NetworkFeatureSupportTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
  if (other_value.networkFeatureSupportV().is_bound()) field_networkFeatureSupportV = other_value.networkFeatureSupportV();
  else field_networkFeatureSupportV.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean NetworkFeatureSupportTV::operator==(const NetworkFeatureSupportTV& other_value) const
{
return field_networkFeatureSupportV==other_value.field_networkFeatureSupportV
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean NetworkFeatureSupportTV::is_bound() const
{
return (field_networkFeatureSupportV.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean NetworkFeatureSupportTV::is_value() const
{
return field_networkFeatureSupportV.is_value()
  && field_elementIdentifier.is_value();
}
void NetworkFeatureSupportTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ networkFeatureSupportV := ");
field_networkFeatureSupportV.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkFeatureSupportTV::set_implicit_omit()
{
if (networkFeatureSupportV().is_bound()) networkFeatureSupportV().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void NetworkFeatureSupportTV::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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV 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) networkFeatureSupportV().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "networkFeatureSupportV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupportV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NetworkFeatureSupportTV");
  }
}

void NetworkFeatureSupportTV::encode_text(Text_Buf& text_buf) const
{
field_networkFeatureSupportV.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void NetworkFeatureSupportTV::decode_text(Text_Buf& text_buf)
{
field_networkFeatureSupportV.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void NetworkFeatureSupportTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void NetworkFeatureSupportTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int NetworkFeatureSupportTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, NetworkFeatureSupportV_descr_.raw->forceomit);
  decoded_field_length = field_networkFeatureSupportV.RAW_decode(NetworkFeatureSupportV_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_elementIdentifier !=  bs_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkFeatureSupportTV::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, NetworkFeatureSupportV_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_networkFeatureSupportV.RAW_encode(NetworkFeatureSupportV_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  bs_12) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct NetworkFeatureSupportTV_template::single_value_struct {
NetworkFeatureSupportV_template field_networkFeatureSupportV;
BITSTRING_template field_elementIdentifier;
};

void NetworkFeatureSupportTV_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_networkFeatureSupportV = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void NetworkFeatureSupportTV_template::copy_value(const NetworkFeatureSupportTV& other_value)
{
single_value = new single_value_struct;
if (other_value.networkFeatureSupportV().is_bound()) {
  single_value->field_networkFeatureSupportV = other_value.networkFeatureSupportV();
} else {
  single_value->field_networkFeatureSupportV.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkFeatureSupportTV_template::copy_template(const NetworkFeatureSupportTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.networkFeatureSupportV().get_selection()) {
single_value->field_networkFeatureSupportV = other_value.networkFeatureSupportV();
} else {
single_value->field_networkFeatureSupportV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 NetworkFeatureSupportTV_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 NetworkFeatureSupportTV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
break;
}
set_selection(other_value);
}

NetworkFeatureSupportTV_template::NetworkFeatureSupportTV_template()
{
}

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

NetworkFeatureSupportTV_template::NetworkFeatureSupportTV_template(const NetworkFeatureSupportTV& other_value)
{
copy_value(other_value);
}

NetworkFeatureSupportTV_template::NetworkFeatureSupportTV_template(const OPTIONAL<NetworkFeatureSupportTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkFeatureSupportTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV from an unbound optional field.");
}
}

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

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

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

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

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

NetworkFeatureSupportTV_template& NetworkFeatureSupportTV_template::operator=(const NetworkFeatureSupportTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NetworkFeatureSupportTV_template& NetworkFeatureSupportTV_template::operator=(const OPTIONAL<NetworkFeatureSupportTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkFeatureSupportTV&)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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
}
return *this;
}

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

boolean NetworkFeatureSupportTV_template::match(const NetworkFeatureSupportTV& 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.networkFeatureSupportV().is_bound()) return FALSE;
if(!single_value->field_networkFeatureSupportV.match(other_value.networkFeatureSupportV(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
}
return FALSE;
}

boolean NetworkFeatureSupportTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_networkFeatureSupportV.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean NetworkFeatureSupportTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_networkFeatureSupportV.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void NetworkFeatureSupportTV_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;
}

NetworkFeatureSupportTV NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
NetworkFeatureSupportTV ret_val;
if (single_value->field_networkFeatureSupportV.is_bound()) {
ret_val.networkFeatureSupportV() = single_value->field_networkFeatureSupportV.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkFeatureSupportTV_template[list_length];
}

NetworkFeatureSupportTV_template& NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
return value_list.list_value[list_index];
}

NetworkFeatureSupportV_template& NetworkFeatureSupportTV_template::networkFeatureSupportV()
{
set_specific();
return single_value->field_networkFeatureSupportV;
}

const NetworkFeatureSupportV_template& NetworkFeatureSupportTV_template::networkFeatureSupportV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkFeatureSupportV of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
return single_value->field_networkFeatureSupportV;
}

BITSTRING_template& NetworkFeatureSupportTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& NetworkFeatureSupportTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
return single_value->field_elementIdentifier;
}

int NetworkFeatureSupportTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV 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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV 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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
  }
  return 0;
}

void NetworkFeatureSupportTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ networkFeatureSupportV := ");
single_value->field_networkFeatureSupportV.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 NetworkFeatureSupportTV_template::log_match(const NetworkFeatureSupportTV& 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_networkFeatureSupportV.match(match_value.networkFeatureSupportV(), legacy)){
TTCN_Logger::log_logmatch_info(".networkFeatureSupportV");
single_value->field_networkFeatureSupportV.log_match(match_value.networkFeatureSupportV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ networkFeatureSupportV := ");
single_value->field_networkFeatureSupportV.log_match(match_value.networkFeatureSupportV(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 NetworkFeatureSupportTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_networkFeatureSupportV.encode_text(text_buf);
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
}
}

void NetworkFeatureSupportTV_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_networkFeatureSupportV.decode_text(text_buf);
single_value->field_elementIdentifier.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 NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV.");
}
}

void NetworkFeatureSupportTV_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: {
    NetworkFeatureSupportTV_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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV 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) networkFeatureSupportV().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "networkFeatureSupportV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupportV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.NetworkFeatureSupportTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkFeatureSupportTV_template* precondition = new NetworkFeatureSupportTV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkFeatureSupportTV_template* implied_template = new NetworkFeatureSupportTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkFeatureSupportTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NetworkFeatureSupportTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkFeatureSupportTV_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_networkFeatureSupportV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportTV");
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 : "@MobileL3_GMM_SM_Types.NetworkFeatureSupportTV");
}

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

boolean NetworkFeatureSupportTV_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;
}

AdditionalNetworkFeatureSupportV::AdditionalNetworkFeatureSupportV()
{
}

AdditionalNetworkFeatureSupportV::AdditionalNetworkFeatureSupportV(const BITSTRING& par_gPRS__SMS,
    const BITSTRING& par_spare)
  :   field_gPRS__SMS(par_gPRS__SMS),
  field_spare(par_spare)
{
}

AdditionalNetworkFeatureSupportV::AdditionalNetworkFeatureSupportV(const AdditionalNetworkFeatureSupportV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
if (other_value.gPRS__SMS().is_bound()) field_gPRS__SMS = other_value.gPRS__SMS();
else field_gPRS__SMS.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void AdditionalNetworkFeatureSupportV::clean_up()
{
field_gPRS__SMS.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* AdditionalNetworkFeatureSupportV::get_descriptor() const { return &AdditionalNetworkFeatureSupportV_descr_; }
AdditionalNetworkFeatureSupportV& AdditionalNetworkFeatureSupportV::operator=(const AdditionalNetworkFeatureSupportV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
  if (other_value.gPRS__SMS().is_bound()) field_gPRS__SMS = other_value.gPRS__SMS();
  else field_gPRS__SMS.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean AdditionalNetworkFeatureSupportV::operator==(const AdditionalNetworkFeatureSupportV& other_value) const
{
return field_gPRS__SMS==other_value.field_gPRS__SMS
  && field_spare==other_value.field_spare;
}

boolean AdditionalNetworkFeatureSupportV::is_bound() const
{
return (field_gPRS__SMS.is_bound())
  || (field_spare.is_bound());
}
boolean AdditionalNetworkFeatureSupportV::is_value() const
{
return field_gPRS__SMS.is_value()
  && field_spare.is_value();
}
void AdditionalNetworkFeatureSupportV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ gPRS_SMS := ");
field_gPRS__SMS.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void AdditionalNetworkFeatureSupportV::set_implicit_omit()
{
if (gPRS__SMS().is_bound()) gPRS__SMS().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void AdditionalNetworkFeatureSupportV::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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV 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) gPRS__SMS().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "gPRS_SMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__SMS().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV");
  }
}

void AdditionalNetworkFeatureSupportV::encode_text(Text_Buf& text_buf) const
{
field_gPRS__SMS.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void AdditionalNetworkFeatureSupportV::decode_text(Text_Buf& text_buf)
{
field_gPRS__SMS.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void AdditionalNetworkFeatureSupportV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AdditionalNetworkFeatureSupportV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AdditionalNetworkFeatureSupportV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_gPRS__SMS.RAW_decode(General__Types::BIT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AdditionalNetworkFeatureSupportV::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, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT7_descr_.raw);
  encoded_length += field_gPRS__SMS.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AdditionalNetworkFeatureSupportV_template::single_value_struct {
BITSTRING_template field_gPRS__SMS;
BITSTRING_template field_spare;
};

void AdditionalNetworkFeatureSupportV_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_gPRS__SMS = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void AdditionalNetworkFeatureSupportV_template::copy_value(const AdditionalNetworkFeatureSupportV& other_value)
{
single_value = new single_value_struct;
if (other_value.gPRS__SMS().is_bound()) {
  single_value->field_gPRS__SMS = other_value.gPRS__SMS();
} else {
  single_value->field_gPRS__SMS.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AdditionalNetworkFeatureSupportV_template::copy_template(const AdditionalNetworkFeatureSupportV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.gPRS__SMS().get_selection()) {
single_value->field_gPRS__SMS = other_value.gPRS__SMS();
} else {
single_value->field_gPRS__SMS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.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 AdditionalNetworkFeatureSupportV_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 AdditionalNetworkFeatureSupportV_template(*other_value.implication_.precondition);
implication_.implied_template = new AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
break;
}
set_selection(other_value);
}

AdditionalNetworkFeatureSupportV_template::AdditionalNetworkFeatureSupportV_template()
{
}

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

AdditionalNetworkFeatureSupportV_template::AdditionalNetworkFeatureSupportV_template(const AdditionalNetworkFeatureSupportV& other_value)
{
copy_value(other_value);
}

AdditionalNetworkFeatureSupportV_template::AdditionalNetworkFeatureSupportV_template(const OPTIONAL<AdditionalNetworkFeatureSupportV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalNetworkFeatureSupportV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV from an unbound optional field.");
}
}

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

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

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

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

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

AdditionalNetworkFeatureSupportV_template& AdditionalNetworkFeatureSupportV_template::operator=(const AdditionalNetworkFeatureSupportV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AdditionalNetworkFeatureSupportV_template& AdditionalNetworkFeatureSupportV_template::operator=(const OPTIONAL<AdditionalNetworkFeatureSupportV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalNetworkFeatureSupportV&)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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
}
return *this;
}

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

boolean AdditionalNetworkFeatureSupportV_template::match(const AdditionalNetworkFeatureSupportV& 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.gPRS__SMS().is_bound()) return FALSE;
if(!single_value->field_gPRS__SMS.match(other_value.gPRS__SMS(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), 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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
}
return FALSE;
}

boolean AdditionalNetworkFeatureSupportV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_gPRS__SMS.is_bound()
 || single_value->field_spare.is_bound();
}

boolean AdditionalNetworkFeatureSupportV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_gPRS__SMS.is_value()
 && single_value->field_spare.is_value();
}

void AdditionalNetworkFeatureSupportV_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;
}

AdditionalNetworkFeatureSupportV AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
AdditionalNetworkFeatureSupportV ret_val;
if (single_value->field_gPRS__SMS.is_bound()) {
ret_val.gPRS__SMS() = single_value->field_gPRS__SMS.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AdditionalNetworkFeatureSupportV_template[list_length];
}

AdditionalNetworkFeatureSupportV_template& AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
return value_list.list_value[list_index];
}

BITSTRING_template& AdditionalNetworkFeatureSupportV_template::gPRS__SMS()
{
set_specific();
return single_value->field_gPRS__SMS;
}

const BITSTRING_template& AdditionalNetworkFeatureSupportV_template::gPRS__SMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPRS_SMS of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
return single_value->field_gPRS__SMS;
}

BITSTRING_template& AdditionalNetworkFeatureSupportV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& AdditionalNetworkFeatureSupportV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
return single_value->field_spare;
}

int AdditionalNetworkFeatureSupportV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV 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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV 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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
  }
  return 0;
}

void AdditionalNetworkFeatureSupportV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ gPRS_SMS := ");
single_value->field_gPRS__SMS.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.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 AdditionalNetworkFeatureSupportV_template::log_match(const AdditionalNetworkFeatureSupportV& 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_gPRS__SMS.match(match_value.gPRS__SMS(), legacy)){
TTCN_Logger::log_logmatch_info(".gPRS_SMS");
single_value->field_gPRS__SMS.log_match(match_value.gPRS__SMS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), 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("{ gPRS_SMS := ");
single_value->field_gPRS__SMS.log_match(match_value.gPRS__SMS(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), 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 AdditionalNetworkFeatureSupportV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_gPRS__SMS.encode_text(text_buf);
single_value->field_spare.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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
}
}

void AdditionalNetworkFeatureSupportV_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_gPRS__SMS.decode_text(text_buf);
single_value->field_spare.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 AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV.");
}
}

void AdditionalNetworkFeatureSupportV_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: {
    AdditionalNetworkFeatureSupportV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV 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) gPRS__SMS().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "gPRS_SMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__SMS().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AdditionalNetworkFeatureSupportV_template* precondition = new AdditionalNetworkFeatureSupportV_template;
    precondition->set_param(*param.get_elem(0));
    AdditionalNetworkFeatureSupportV_template* implied_template = new AdditionalNetworkFeatureSupportV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AdditionalNetworkFeatureSupportV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AdditionalNetworkFeatureSupportV_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_gPRS__SMS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV");
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 : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportV");
}

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

boolean AdditionalNetworkFeatureSupportV_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;
}

AdditionalNetworkFeatureSupportTLV::AdditionalNetworkFeatureSupportTLV()
{
}

AdditionalNetworkFeatureSupportTLV::AdditionalNetworkFeatureSupportTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const AdditionalNetworkFeatureSupportV& par_additionalNetworkFeatureSupportV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_additionalNetworkFeatureSupportV(par_additionalNetworkFeatureSupportV)
{
}

AdditionalNetworkFeatureSupportTLV::AdditionalNetworkFeatureSupportTLV(const AdditionalNetworkFeatureSupportTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.additionalNetworkFeatureSupportV().is_bound()) field_additionalNetworkFeatureSupportV = other_value.additionalNetworkFeatureSupportV();
else field_additionalNetworkFeatureSupportV.clean_up();
}

void AdditionalNetworkFeatureSupportTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_additionalNetworkFeatureSupportV.clean_up();
}

const TTCN_Typedescriptor_t* AdditionalNetworkFeatureSupportTLV::get_descriptor() const { return &AdditionalNetworkFeatureSupportTLV_descr_; }
AdditionalNetworkFeatureSupportTLV& AdditionalNetworkFeatureSupportTLV::operator=(const AdditionalNetworkFeatureSupportTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.additionalNetworkFeatureSupportV().is_bound()) field_additionalNetworkFeatureSupportV = other_value.additionalNetworkFeatureSupportV();
  else field_additionalNetworkFeatureSupportV.clean_up();
}
return *this;
}

boolean AdditionalNetworkFeatureSupportTLV::operator==(const AdditionalNetworkFeatureSupportTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_additionalNetworkFeatureSupportV==other_value.field_additionalNetworkFeatureSupportV;
}

boolean AdditionalNetworkFeatureSupportTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_additionalNetworkFeatureSupportV.is_bound());
}
boolean AdditionalNetworkFeatureSupportTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_additionalNetworkFeatureSupportV.is_value();
}
void AdditionalNetworkFeatureSupportTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupportV := ");
field_additionalNetworkFeatureSupportV.log();
TTCN_Logger::log_event_str(" }");
}

void AdditionalNetworkFeatureSupportTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (additionalNetworkFeatureSupportV().is_bound()) additionalNetworkFeatureSupportV().set_implicit_omit();
}

void AdditionalNetworkFeatureSupportTLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupportV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "additionalNetworkFeatureSupportV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupportV().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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
  }
}

void AdditionalNetworkFeatureSupportTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_additionalNetworkFeatureSupportV.encode_text(text_buf);
}

void AdditionalNetworkFeatureSupportTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_additionalNetworkFeatureSupportV.decode_text(text_buf);
}

void AdditionalNetworkFeatureSupportTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AdditionalNetworkFeatureSupportTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AdditionalNetworkFeatureSupportTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AdditionalNetworkFeatureSupportTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AdditionalNetworkFeatureSupportTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(AdditionalNetworkFeatureSupportTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, AdditionalNetworkFeatureSupportV_descr_.raw->forceomit);
  decoded_field_length = field_additionalNetworkFeatureSupportV.RAW_decode(AdditionalNetworkFeatureSupportV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_7) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AdditionalNetworkFeatureSupportTLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AdditionalNetworkFeatureSupportTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AdditionalNetworkFeatureSupportV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AdditionalNetworkFeatureSupportTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_additionalNetworkFeatureSupportV.RAW_encode(AdditionalNetworkFeatureSupportV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_7) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AdditionalNetworkFeatureSupportTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
AdditionalNetworkFeatureSupportV_template field_additionalNetworkFeatureSupportV;
};

void AdditionalNetworkFeatureSupportTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_additionalNetworkFeatureSupportV = ANY_VALUE;
}
}
}

void AdditionalNetworkFeatureSupportTLV_template::copy_value(const AdditionalNetworkFeatureSupportTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.additionalNetworkFeatureSupportV().is_bound()) {
  single_value->field_additionalNetworkFeatureSupportV = other_value.additionalNetworkFeatureSupportV();
} else {
  single_value->field_additionalNetworkFeatureSupportV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AdditionalNetworkFeatureSupportTLV_template::copy_template(const AdditionalNetworkFeatureSupportTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalNetworkFeatureSupportV().get_selection()) {
single_value->field_additionalNetworkFeatureSupportV = other_value.additionalNetworkFeatureSupportV();
} else {
single_value->field_additionalNetworkFeatureSupportV.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 AdditionalNetworkFeatureSupportTLV_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 AdditionalNetworkFeatureSupportTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AdditionalNetworkFeatureSupportTLV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
break;
}
set_selection(other_value);
}

AdditionalNetworkFeatureSupportTLV_template::AdditionalNetworkFeatureSupportTLV_template()
{
}

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

AdditionalNetworkFeatureSupportTLV_template::AdditionalNetworkFeatureSupportTLV_template(const AdditionalNetworkFeatureSupportTLV& other_value)
{
copy_value(other_value);
}

AdditionalNetworkFeatureSupportTLV_template::AdditionalNetworkFeatureSupportTLV_template(const OPTIONAL<AdditionalNetworkFeatureSupportTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalNetworkFeatureSupportTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV from an unbound optional field.");
}
}

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

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

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

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

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

AdditionalNetworkFeatureSupportTLV_template& AdditionalNetworkFeatureSupportTLV_template::operator=(const AdditionalNetworkFeatureSupportTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AdditionalNetworkFeatureSupportTLV_template& AdditionalNetworkFeatureSupportTLV_template::operator=(const OPTIONAL<AdditionalNetworkFeatureSupportTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AdditionalNetworkFeatureSupportTLV&)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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
}
return *this;
}

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

boolean AdditionalNetworkFeatureSupportTLV_template::match(const AdditionalNetworkFeatureSupportTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.additionalNetworkFeatureSupportV().is_bound()) return FALSE;
if(!single_value->field_additionalNetworkFeatureSupportV.match(other_value.additionalNetworkFeatureSupportV(), 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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
}
return FALSE;
}

boolean AdditionalNetworkFeatureSupportTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_additionalNetworkFeatureSupportV.is_bound();
}

boolean AdditionalNetworkFeatureSupportTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_additionalNetworkFeatureSupportV.is_value();
}

void AdditionalNetworkFeatureSupportTLV_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;
}

AdditionalNetworkFeatureSupportTLV AdditionalNetworkFeatureSupportTLV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
AdditionalNetworkFeatureSupportTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_additionalNetworkFeatureSupportV.is_bound()) {
ret_val.additionalNetworkFeatureSupportV() = single_value->field_additionalNetworkFeatureSupportV.valueof();
}
return ret_val;
}

void AdditionalNetworkFeatureSupportTLV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AdditionalNetworkFeatureSupportTLV_template[list_length];
}

AdditionalNetworkFeatureSupportTLV_template& AdditionalNetworkFeatureSupportTLV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& AdditionalNetworkFeatureSupportTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& AdditionalNetworkFeatureSupportTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& AdditionalNetworkFeatureSupportTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& AdditionalNetworkFeatureSupportTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
return single_value->field_lengthIndicator;
}

AdditionalNetworkFeatureSupportV_template& AdditionalNetworkFeatureSupportTLV_template::additionalNetworkFeatureSupportV()
{
set_specific();
return single_value->field_additionalNetworkFeatureSupportV;
}

const AdditionalNetworkFeatureSupportV_template& AdditionalNetworkFeatureSupportTLV_template::additionalNetworkFeatureSupportV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalNetworkFeatureSupportV of a non-specific template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
return single_value->field_additionalNetworkFeatureSupportV;
}

int AdditionalNetworkFeatureSupportTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV 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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
  }
  return 0;
}

void AdditionalNetworkFeatureSupportTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupportV := ");
single_value->field_additionalNetworkFeatureSupportV.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 AdditionalNetworkFeatureSupportTLV_template::log_match(const AdditionalNetworkFeatureSupportTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_additionalNetworkFeatureSupportV.match(match_value.additionalNetworkFeatureSupportV(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupportV");
single_value->field_additionalNetworkFeatureSupportV.log_match(match_value.additionalNetworkFeatureSupportV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupportV := ");
single_value->field_additionalNetworkFeatureSupportV.log_match(match_value.additionalNetworkFeatureSupportV(), 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 AdditionalNetworkFeatureSupportTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_additionalNetworkFeatureSupportV.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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
}
}

void AdditionalNetworkFeatureSupportTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_additionalNetworkFeatureSupportV.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 AdditionalNetworkFeatureSupportTLV_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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV.");
}
}

void AdditionalNetworkFeatureSupportTLV_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: {
    AdditionalNetworkFeatureSupportTLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupportV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "additionalNetworkFeatureSupportV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupportV().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 @MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AdditionalNetworkFeatureSupportTLV_template* precondition = new AdditionalNetworkFeatureSupportTLV_template;
    precondition->set_param(*param.get_elem(0));
    AdditionalNetworkFeatureSupportTLV_template* implied_template = new AdditionalNetworkFeatureSupportTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AdditionalNetworkFeatureSupportTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AdditionalNetworkFeatureSupportTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
single_value->field_additionalNetworkFeatureSupportV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
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 : "@MobileL3_GMM_SM_Types.AdditionalNetworkFeatureSupportTLV");
}

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

boolean AdditionalNetworkFeatureSupportTLV_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;
}

InterRATInformationContainerTLV::InterRATInformationContainerTLV()
{
}

InterRATInformationContainerTLV::InterRATInformationContainerTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_interRATInformationContainerV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_interRATInformationContainerV(par_interRATInformationContainerV)
{
}

InterRATInformationContainerTLV::InterRATInformationContainerTLV(const InterRATInformationContainerTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.interRATInformationContainerV().is_bound()) field_interRATInformationContainerV = other_value.interRATInformationContainerV();
else field_interRATInformationContainerV.clean_up();
}

void InterRATInformationContainerTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_interRATInformationContainerV.clean_up();
}

const TTCN_Typedescriptor_t* InterRATInformationContainerTLV::get_descriptor() const { return &InterRATInformationContainerTLV_descr_; }
InterRATInformationContainerTLV& InterRATInformationContainerTLV::operator=(const InterRATInformationContainerTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.interRATInformationContainerV().is_bound()) field_interRATInformationContainerV = other_value.interRATInformationContainerV();
  else field_interRATInformationContainerV.clean_up();
}
return *this;
}

boolean InterRATInformationContainerTLV::operator==(const InterRATInformationContainerTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_interRATInformationContainerV==other_value.field_interRATInformationContainerV;
}

boolean InterRATInformationContainerTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_interRATInformationContainerV.is_bound());
}
boolean InterRATInformationContainerTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_interRATInformationContainerV.is_value();
}
void InterRATInformationContainerTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", interRATInformationContainerV := ");
field_interRATInformationContainerV.log();
TTCN_Logger::log_event_str(" }");
}

void InterRATInformationContainerTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (interRATInformationContainerV().is_bound()) interRATInformationContainerV().set_implicit_omit();
}

void InterRATInformationContainerTLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) interRATInformationContainerV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "interRATInformationContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATInformationContainerV().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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
  }
}

void InterRATInformationContainerTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_interRATInformationContainerV.encode_text(text_buf);
}

void InterRATInformationContainerTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_interRATInformationContainerV.decode_text(text_buf);
}

void InterRATInformationContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void InterRATInformationContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int InterRATInformationContainerTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, InterRATInformationContainerTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(InterRATInformationContainerTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(InterRATInformationContainerTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_interRATInformationContainerV.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_0) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int InterRATInformationContainerTLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, InterRATInformationContainerTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &InterRATInformationContainerTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_interRATInformationContainerV.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct InterRATInformationContainerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_interRATInformationContainerV;
};

void InterRATInformationContainerTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_interRATInformationContainerV = ANY_VALUE;
}
}
}

void InterRATInformationContainerTLV_template::copy_value(const InterRATInformationContainerTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.interRATInformationContainerV().is_bound()) {
  single_value->field_interRATInformationContainerV = other_value.interRATInformationContainerV();
} else {
  single_value->field_interRATInformationContainerV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void InterRATInformationContainerTLV_template::copy_template(const InterRATInformationContainerTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interRATInformationContainerV().get_selection()) {
single_value->field_interRATInformationContainerV = other_value.interRATInformationContainerV();
} else {
single_value->field_interRATInformationContainerV.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 InterRATInformationContainerTLV_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 InterRATInformationContainerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new InterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
break;
}
set_selection(other_value);
}

InterRATInformationContainerTLV_template::InterRATInformationContainerTLV_template()
{
}

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

InterRATInformationContainerTLV_template::InterRATInformationContainerTLV_template(const InterRATInformationContainerTLV& other_value)
{
copy_value(other_value);
}

InterRATInformationContainerTLV_template::InterRATInformationContainerTLV_template(const OPTIONAL<InterRATInformationContainerTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const InterRATInformationContainerTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV from an unbound optional field.");
}
}

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

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

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

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

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

InterRATInformationContainerTLV_template& InterRATInformationContainerTLV_template::operator=(const InterRATInformationContainerTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

InterRATInformationContainerTLV_template& InterRATInformationContainerTLV_template::operator=(const OPTIONAL<InterRATInformationContainerTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const InterRATInformationContainerTLV&)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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
}
return *this;
}

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

boolean InterRATInformationContainerTLV_template::match(const InterRATInformationContainerTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.interRATInformationContainerV().is_bound()) return FALSE;
if(!single_value->field_interRATInformationContainerV.match(other_value.interRATInformationContainerV(), 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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
}
return FALSE;
}

boolean InterRATInformationContainerTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_interRATInformationContainerV.is_bound();
}

boolean InterRATInformationContainerTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_interRATInformationContainerV.is_value();
}

void InterRATInformationContainerTLV_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;
}

InterRATInformationContainerTLV InterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
InterRATInformationContainerTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_interRATInformationContainerV.is_bound()) {
ret_val.interRATInformationContainerV() = single_value->field_interRATInformationContainerV.valueof();
}
return ret_val;
}

void InterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new InterRATInformationContainerTLV_template[list_length];
}

InterRATInformationContainerTLV_template& InterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& InterRATInformationContainerTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& InterRATInformationContainerTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& InterRATInformationContainerTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& InterRATInformationContainerTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& InterRATInformationContainerTLV_template::interRATInformationContainerV()
{
set_specific();
return single_value->field_interRATInformationContainerV;
}

const OCTETSTRING_template& InterRATInformationContainerTLV_template::interRATInformationContainerV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interRATInformationContainerV of a non-specific template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
return single_value->field_interRATInformationContainerV;
}

int InterRATInformationContainerTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV 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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
  }
  return 0;
}

void InterRATInformationContainerTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", interRATInformationContainerV := ");
single_value->field_interRATInformationContainerV.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 InterRATInformationContainerTLV_template::log_match(const InterRATInformationContainerTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_interRATInformationContainerV.match(match_value.interRATInformationContainerV(), legacy)){
TTCN_Logger::log_logmatch_info(".interRATInformationContainerV");
single_value->field_interRATInformationContainerV.log_match(match_value.interRATInformationContainerV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", interRATInformationContainerV := ");
single_value->field_interRATInformationContainerV.log_match(match_value.interRATInformationContainerV(), 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 InterRATInformationContainerTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_interRATInformationContainerV.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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
}
}

void InterRATInformationContainerTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_interRATInformationContainerV.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 InterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV.");
}
}

void InterRATInformationContainerTLV_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: {
    InterRATInformationContainerTLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) interRATInformationContainerV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "interRATInformationContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATInformationContainerV().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 @MobileL3_GMM_SM_Types.InterRATInformationContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    InterRATInformationContainerTLV_template* precondition = new InterRATInformationContainerTLV_template;
    precondition->set_param(*param.get_elem(0));
    InterRATInformationContainerTLV_template* implied_template = new InterRATInformationContainerTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = InterRATInformationContainerTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void InterRATInformationContainerTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
single_value->field_interRATInformationContainerV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
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 : "@MobileL3_GMM_SM_Types.InterRATInformationContainerTLV");
}

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

boolean InterRATInformationContainerTLV_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;
}

RequestedMSInformationTV::RequestedMSInformationTV()
{
}

RequestedMSInformationTV::RequestedMSInformationTV(const BITSTRING& par_spare,
    const BITSTRING& par_i__RAT2,
    const BITSTRING& par_i__RAT,
    const BITSTRING& par_elementIdentifier)
  :   field_spare(par_spare),
  field_i__RAT2(par_i__RAT2),
  field_i__RAT(par_i__RAT),
  field_elementIdentifier(par_elementIdentifier)
{
}

RequestedMSInformationTV::RequestedMSInformationTV(const RequestedMSInformationTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.i__RAT2().is_bound()) field_i__RAT2 = other_value.i__RAT2();
else field_i__RAT2.clean_up();
if (other_value.i__RAT().is_bound()) field_i__RAT = other_value.i__RAT();
else field_i__RAT.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void RequestedMSInformationTV::clean_up()
{
field_spare.clean_up();
field_i__RAT2.clean_up();
field_i__RAT.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RequestedMSInformationTV::get_descriptor() const { return &RequestedMSInformationTV_descr_; }
RequestedMSInformationTV& RequestedMSInformationTV::operator=(const RequestedMSInformationTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.i__RAT2().is_bound()) field_i__RAT2 = other_value.i__RAT2();
  else field_i__RAT2.clean_up();
  if (other_value.i__RAT().is_bound()) field_i__RAT = other_value.i__RAT();
  else field_i__RAT.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean RequestedMSInformationTV::operator==(const RequestedMSInformationTV& other_value) const
{
return field_spare==other_value.field_spare
  && field_i__RAT2==other_value.field_i__RAT2
  && field_i__RAT==other_value.field_i__RAT
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RequestedMSInformationTV::is_bound() const
{
return (field_spare.is_bound())
  || (field_i__RAT2.is_bound())
  || (field_i__RAT.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RequestedMSInformationTV::is_value() const
{
return field_spare.is_value()
  && field_i__RAT2.is_value()
  && field_i__RAT.is_value()
  && field_elementIdentifier.is_value();
}
void RequestedMSInformationTV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", i_RAT2 := ");
field_i__RAT2.log();
TTCN_Logger::log_event_str(", i_RAT := ");
field_i__RAT.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void RequestedMSInformationTV::set_implicit_omit()
{
if (spare().is_bound()) spare().set_implicit_omit();
if (i__RAT2().is_bound()) i__RAT2().set_implicit_omit();
if (i__RAT().is_bound()) i__RAT().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RequestedMSInformationTV::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV has 4 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) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) i__RAT2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) i__RAT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(3));
    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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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(), "i_RAT2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          i__RAT2().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(), "i_RAT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          i__RAT().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
  }
}

void RequestedMSInformationTV::encode_text(Text_Buf& text_buf) const
{
field_spare.encode_text(text_buf);
field_i__RAT2.encode_text(text_buf);
field_i__RAT.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RequestedMSInformationTV::decode_text(Text_Buf& text_buf)
{
field_spare.decode_text(text_buf);
field_i__RAT2.decode_text(text_buf);
field_i__RAT.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void RequestedMSInformationTV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RequestedMSInformationTV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RequestedMSInformationTV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT2_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_i__RAT2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_i__RAT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  if (field_elementIdentifier !=  bs_11) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RequestedMSInformationTV::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_i__RAT2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_i__RAT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  if (field_elementIdentifier !=  bs_11) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={3};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct RequestedMSInformationTV_template::single_value_struct {
BITSTRING_template field_spare;
BITSTRING_template field_i__RAT2;
BITSTRING_template field_i__RAT;
BITSTRING_template field_elementIdentifier;
};

void RequestedMSInformationTV_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_spare = ANY_VALUE;
single_value->field_i__RAT2 = ANY_VALUE;
single_value->field_i__RAT = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void RequestedMSInformationTV_template::copy_value(const RequestedMSInformationTV& other_value)
{
single_value = new single_value_struct;
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.i__RAT2().is_bound()) {
  single_value->field_i__RAT2 = other_value.i__RAT2();
} else {
  single_value->field_i__RAT2.clean_up();
}
if (other_value.i__RAT().is_bound()) {
  single_value->field_i__RAT = other_value.i__RAT();
} else {
  single_value->field_i__RAT.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RequestedMSInformationTV_template::copy_template(const RequestedMSInformationTV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.i__RAT2().get_selection()) {
single_value->field_i__RAT2 = other_value.i__RAT2();
} else {
single_value->field_i__RAT2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.i__RAT().get_selection()) {
single_value->field_i__RAT = other_value.i__RAT();
} else {
single_value->field_i__RAT.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 RequestedMSInformationTV_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 RequestedMSInformationTV_template(*other_value.implication_.precondition);
implication_.implied_template = new RequestedMSInformationTV_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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
break;
}
set_selection(other_value);
}

RequestedMSInformationTV_template::RequestedMSInformationTV_template()
{
}

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

RequestedMSInformationTV_template::RequestedMSInformationTV_template(const RequestedMSInformationTV& other_value)
{
copy_value(other_value);
}

RequestedMSInformationTV_template::RequestedMSInformationTV_template(const OPTIONAL<RequestedMSInformationTV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RequestedMSInformationTV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV from an unbound optional field.");
}
}

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

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

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

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

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

RequestedMSInformationTV_template& RequestedMSInformationTV_template::operator=(const RequestedMSInformationTV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RequestedMSInformationTV_template& RequestedMSInformationTV_template::operator=(const OPTIONAL<RequestedMSInformationTV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RequestedMSInformationTV&)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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
}
return *this;
}

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

boolean RequestedMSInformationTV_template::match(const RequestedMSInformationTV& 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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.i__RAT2().is_bound()) return FALSE;
if(!single_value->field_i__RAT2.match(other_value.i__RAT2(), legacy))return FALSE;
if(!other_value.i__RAT().is_bound()) return FALSE;
if(!single_value->field_i__RAT.match(other_value.i__RAT(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
}
return FALSE;
}

boolean RequestedMSInformationTV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_spare.is_bound()
 || single_value->field_i__RAT2.is_bound()
 || single_value->field_i__RAT.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean RequestedMSInformationTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_spare.is_value()
 && single_value->field_i__RAT2.is_value()
 && single_value->field_i__RAT.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void RequestedMSInformationTV_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;
}

RequestedMSInformationTV RequestedMSInformationTV_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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
RequestedMSInformationTV ret_val;
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_i__RAT2.is_bound()) {
ret_val.i__RAT2() = single_value->field_i__RAT2.valueof();
}
if (single_value->field_i__RAT.is_bound()) {
ret_val.i__RAT() = single_value->field_i__RAT.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void RequestedMSInformationTV_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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RequestedMSInformationTV_template[list_length];
}

RequestedMSInformationTV_template& RequestedMSInformationTV_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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
return value_list.list_value[list_index];
}

BITSTRING_template& RequestedMSInformationTV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& RequestedMSInformationTV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
return single_value->field_spare;
}

BITSTRING_template& RequestedMSInformationTV_template::i__RAT2()
{
set_specific();
return single_value->field_i__RAT2;
}

const BITSTRING_template& RequestedMSInformationTV_template::i__RAT2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field i_RAT2 of a non-specific template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
return single_value->field_i__RAT2;
}

BITSTRING_template& RequestedMSInformationTV_template::i__RAT()
{
set_specific();
return single_value->field_i__RAT;
}

const BITSTRING_template& RequestedMSInformationTV_template::i__RAT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field i_RAT of a non-specific template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
return single_value->field_i__RAT;
}

BITSTRING_template& RequestedMSInformationTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& RequestedMSInformationTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
return single_value->field_elementIdentifier;
}

int RequestedMSInformationTV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV 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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
  }
  return 0;
}

void RequestedMSInformationTV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", i_RAT2 := ");
single_value->field_i__RAT2.log();
TTCN_Logger::log_event_str(", i_RAT := ");
single_value->field_i__RAT.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 RequestedMSInformationTV_template::log_match(const RequestedMSInformationTV& 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_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_i__RAT2.match(match_value.i__RAT2(), legacy)){
TTCN_Logger::log_logmatch_info(".i_RAT2");
single_value->field_i__RAT2.log_match(match_value.i__RAT2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_i__RAT.match(match_value.i__RAT(), legacy)){
TTCN_Logger::log_logmatch_info(".i_RAT");
single_value->field_i__RAT.log_match(match_value.i__RAT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", i_RAT2 := ");
single_value->field_i__RAT2.log_match(match_value.i__RAT2(), legacy);
TTCN_Logger::log_event_str(", i_RAT := ");
single_value->field_i__RAT.log_match(match_value.i__RAT(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 RequestedMSInformationTV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_spare.encode_text(text_buf);
single_value->field_i__RAT2.encode_text(text_buf);
single_value->field_i__RAT.encode_text(text_buf);
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
}
}

void RequestedMSInformationTV_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_spare.decode_text(text_buf);
single_value->field_i__RAT2.decode_text(text_buf);
single_value->field_i__RAT.decode_text(text_buf);
single_value->field_elementIdentifier.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 RequestedMSInformationTV_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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV.");
}
}

void RequestedMSInformationTV_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: {
    RequestedMSInformationTV_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RequestedMSInformationTV has 4 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) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) i__RAT2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) i__RAT().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(3));
    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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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(), "i_RAT2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          i__RAT2().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(), "i_RAT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          i__RAT().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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 @MobileL3_GMM_SM_Types.RequestedMSInformationTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RequestedMSInformationTV_template* precondition = new RequestedMSInformationTV_template;
    precondition->set_param(*param.get_elem(0));
    RequestedMSInformationTV_template* implied_template = new RequestedMSInformationTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RequestedMSInformationTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RequestedMSInformationTV_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_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
single_value->field_i__RAT2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
single_value->field_i__RAT.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
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 : "@MobileL3_GMM_SM_Types.RequestedMSInformationTV");
}

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

boolean RequestedMSInformationTV_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;
}

UENetworkCapabilityV::UENetworkCapabilityV()
{
}

UENetworkCapabilityV::UENetworkCapabilityV(const BITSTRING& par_eEA,
    const BITSTRING& par_eIA,
    const OPTIONAL< BITSTRING >& par_uEA,
    const OPTIONAL< BITSTRING >& par_uIA,
    const OPTIONAL< BITSTRING >& par_uCS2,
    const OPTIONAL< BITSTRING >& par_nF,
    const OPTIONAL< BITSTRING >& par_sRVCC,
    const OPTIONAL< BITSTRING >& par_lCS,
    const OPTIONAL< BITSTRING >& par_lPP,
    const OPTIONAL< BITSTRING >& par_aCC__CSFB,
    const OPTIONAL< BITSTRING >& par_h245__ASH,
    const OPTIONAL< BITSTRING >& par_proSe,
    const OPTIONAL< BITSTRING >& par_proSe__dd,
    const OPTIONAL< BITSTRING >& par_proSe__dc,
    const OPTIONAL< BITSTRING >& par_spare,
    const OPTIONAL< OCTETSTRING >& par_spare4)
  :   field_eEA(par_eEA),
  field_eIA(par_eIA),
  field_uEA(par_uEA),
  field_uIA(par_uIA),
  field_uCS2(par_uCS2),
  field_nF(par_nF),
  field_sRVCC(par_sRVCC),
  field_lCS(par_lCS),
  field_lPP(par_lPP),
  field_aCC__CSFB(par_aCC__CSFB),
  field_h245__ASH(par_h245__ASH),
  field_proSe(par_proSe),
  field_proSe__dd(par_proSe__dd),
  field_proSe__dc(par_proSe__dc),
  field_spare(par_spare),
  field_spare4(par_spare4)
{
}

UENetworkCapabilityV::UENetworkCapabilityV(const UENetworkCapabilityV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
if (other_value.eEA().is_bound()) field_eEA = other_value.eEA();
else field_eEA.clean_up();
if (other_value.eIA().is_bound()) field_eIA = other_value.eIA();
else field_eIA.clean_up();
if (other_value.uEA().is_bound()) field_uEA = other_value.uEA();
else field_uEA.clean_up();
if (other_value.uIA().is_bound()) field_uIA = other_value.uIA();
else field_uIA.clean_up();
if (other_value.uCS2().is_bound()) field_uCS2 = other_value.uCS2();
else field_uCS2.clean_up();
if (other_value.nF().is_bound()) field_nF = other_value.nF();
else field_nF.clean_up();
if (other_value.sRVCC().is_bound()) field_sRVCC = other_value.sRVCC();
else field_sRVCC.clean_up();
if (other_value.lCS().is_bound()) field_lCS = other_value.lCS();
else field_lCS.clean_up();
if (other_value.lPP().is_bound()) field_lPP = other_value.lPP();
else field_lPP.clean_up();
if (other_value.aCC__CSFB().is_bound()) field_aCC__CSFB = other_value.aCC__CSFB();
else field_aCC__CSFB.clean_up();
if (other_value.h245__ASH().is_bound()) field_h245__ASH = other_value.h245__ASH();
else field_h245__ASH.clean_up();
if (other_value.proSe().is_bound()) field_proSe = other_value.proSe();
else field_proSe.clean_up();
if (other_value.proSe__dd().is_bound()) field_proSe__dd = other_value.proSe__dd();
else field_proSe__dd.clean_up();
if (other_value.proSe__dc().is_bound()) field_proSe__dc = other_value.proSe__dc();
else field_proSe__dc.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
else field_spare4.clean_up();
}

void UENetworkCapabilityV::clean_up()
{
field_eEA.clean_up();
field_eIA.clean_up();
field_uEA.clean_up();
field_uIA.clean_up();
field_uCS2.clean_up();
field_nF.clean_up();
field_sRVCC.clean_up();
field_lCS.clean_up();
field_lPP.clean_up();
field_aCC__CSFB.clean_up();
field_h245__ASH.clean_up();
field_proSe.clean_up();
field_proSe__dd.clean_up();
field_proSe__dc.clean_up();
field_spare.clean_up();
field_spare4.clean_up();
}

const TTCN_Typedescriptor_t* UENetworkCapabilityV::get_descriptor() const { return &UENetworkCapabilityV_descr_; }
UENetworkCapabilityV& UENetworkCapabilityV::operator=(const UENetworkCapabilityV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
  if (other_value.eEA().is_bound()) field_eEA = other_value.eEA();
  else field_eEA.clean_up();
  if (other_value.eIA().is_bound()) field_eIA = other_value.eIA();
  else field_eIA.clean_up();
  if (other_value.uEA().is_bound()) field_uEA = other_value.uEA();
  else field_uEA.clean_up();
  if (other_value.uIA().is_bound()) field_uIA = other_value.uIA();
  else field_uIA.clean_up();
  if (other_value.uCS2().is_bound()) field_uCS2 = other_value.uCS2();
  else field_uCS2.clean_up();
  if (other_value.nF().is_bound()) field_nF = other_value.nF();
  else field_nF.clean_up();
  if (other_value.sRVCC().is_bound()) field_sRVCC = other_value.sRVCC();
  else field_sRVCC.clean_up();
  if (other_value.lCS().is_bound()) field_lCS = other_value.lCS();
  else field_lCS.clean_up();
  if (other_value.lPP().is_bound()) field_lPP = other_value.lPP();
  else field_lPP.clean_up();
  if (other_value.aCC__CSFB().is_bound()) field_aCC__CSFB = other_value.aCC__CSFB();
  else field_aCC__CSFB.clean_up();
  if (other_value.h245__ASH().is_bound()) field_h245__ASH = other_value.h245__ASH();
  else field_h245__ASH.clean_up();
  if (other_value.proSe().is_bound()) field_proSe = other_value.proSe();
  else field_proSe.clean_up();
  if (other_value.proSe__dd().is_bound()) field_proSe__dd = other_value.proSe__dd();
  else field_proSe__dd.clean_up();
  if (other_value.proSe__dc().is_bound()) field_proSe__dc = other_value.proSe__dc();
  else field_proSe__dc.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
  else field_spare4.clean_up();
}
return *this;
}

boolean UENetworkCapabilityV::operator==(const UENetworkCapabilityV& other_value) const
{
return field_eEA==other_value.field_eEA
  && field_eIA==other_value.field_eIA
  && field_uEA==other_value.field_uEA
  && field_uIA==other_value.field_uIA
  && field_uCS2==other_value.field_uCS2
  && field_nF==other_value.field_nF
  && field_sRVCC==other_value.field_sRVCC
  && field_lCS==other_value.field_lCS
  && field_lPP==other_value.field_lPP
  && field_aCC__CSFB==other_value.field_aCC__CSFB
  && field_h245__ASH==other_value.field_h245__ASH
  && field_proSe==other_value.field_proSe
  && field_proSe__dd==other_value.field_proSe__dd
  && field_proSe__dc==other_value.field_proSe__dc
  && field_spare==other_value.field_spare
  && field_spare4==other_value.field_spare4;
}

boolean UENetworkCapabilityV::is_bound() const
{
return (field_eEA.is_bound())
  || (field_eIA.is_bound())
  || (OPTIONAL_OMIT == field_uEA.get_selection() || field_uEA.is_bound())
  || (OPTIONAL_OMIT == field_uIA.get_selection() || field_uIA.is_bound())
  || (OPTIONAL_OMIT == field_uCS2.get_selection() || field_uCS2.is_bound())
  || (OPTIONAL_OMIT == field_nF.get_selection() || field_nF.is_bound())
  || (OPTIONAL_OMIT == field_sRVCC.get_selection() || field_sRVCC.is_bound())
  || (OPTIONAL_OMIT == field_lCS.get_selection() || field_lCS.is_bound())
  || (OPTIONAL_OMIT == field_lPP.get_selection() || field_lPP.is_bound())
  || (OPTIONAL_OMIT == field_aCC__CSFB.get_selection() || field_aCC__CSFB.is_bound())
  || (OPTIONAL_OMIT == field_h245__ASH.get_selection() || field_h245__ASH.is_bound())
  || (OPTIONAL_OMIT == field_proSe.get_selection() || field_proSe.is_bound())
  || (OPTIONAL_OMIT == field_proSe__dd.get_selection() || field_proSe__dd.is_bound())
  || (OPTIONAL_OMIT == field_proSe__dc.get_selection() || field_proSe__dc.is_bound())
  || (OPTIONAL_OMIT == field_spare.get_selection() || field_spare.is_bound())
  || (OPTIONAL_OMIT == field_spare4.get_selection() || field_spare4.is_bound());
}
boolean UENetworkCapabilityV::is_value() const
{
return field_eEA.is_value()
  && field_eIA.is_value()
  && (OPTIONAL_OMIT == field_uEA.get_selection() || field_uEA.is_value())
  && (OPTIONAL_OMIT == field_uIA.get_selection() || field_uIA.is_value())
  && (OPTIONAL_OMIT == field_uCS2.get_selection() || field_uCS2.is_value())
  && (OPTIONAL_OMIT == field_nF.get_selection() || field_nF.is_value())
  && (OPTIONAL_OMIT == field_sRVCC.get_selection() || field_sRVCC.is_value())
  && (OPTIONAL_OMIT == field_lCS.get_selection() || field_lCS.is_value())
  && (OPTIONAL_OMIT == field_lPP.get_selection() || field_lPP.is_value())
  && (OPTIONAL_OMIT == field_aCC__CSFB.get_selection() || field_aCC__CSFB.is_value())
  && (OPTIONAL_OMIT == field_h245__ASH.get_selection() || field_h245__ASH.is_value())
  && (OPTIONAL_OMIT == field_proSe.get_selection() || field_proSe.is_value())
  && (OPTIONAL_OMIT == field_proSe__dd.get_selection() || field_proSe__dd.is_value())
  && (OPTIONAL_OMIT == field_proSe__dc.get_selection() || field_proSe__dc.is_value())
  && (OPTIONAL_OMIT == field_spare.get_selection() || field_spare.is_value())
  && (OPTIONAL_OMIT == field_spare4.get_selection() || field_spare4.is_value());
}
int UENetworkCapabilityV::size_of() const
{
  int ret_val = 2;
  if (field_uEA.ispresent()) ret_val++;
  if (field_uIA.ispresent()) ret_val++;
  if (field_uCS2.ispresent()) ret_val++;
  if (field_nF.ispresent()) ret_val++;
  if (field_sRVCC.ispresent()) ret_val++;
  if (field_lCS.ispresent()) ret_val++;
  if (field_lPP.ispresent()) ret_val++;
  if (field_aCC__CSFB.ispresent()) ret_val++;
  if (field_h245__ASH.ispresent()) ret_val++;
  if (field_proSe.ispresent()) ret_val++;
  if (field_proSe__dd.ispresent()) ret_val++;
  if (field_proSe__dc.ispresent()) ret_val++;
  if (field_spare.ispresent()) ret_val++;
  if (field_spare4.ispresent()) ret_val++;
  return ret_val;
}

void UENetworkCapabilityV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ eEA := ");
field_eEA.log();
TTCN_Logger::log_event_str(", eIA := ");
field_eIA.log();
TTCN_Logger::log_event_str(", uEA := ");
field_uEA.log();
TTCN_Logger::log_event_str(", uIA := ");
field_uIA.log();
TTCN_Logger::log_event_str(", uCS2 := ");
field_uCS2.log();
TTCN_Logger::log_event_str(", nF := ");
field_nF.log();
TTCN_Logger::log_event_str(", sRVCC := ");
field_sRVCC.log();
TTCN_Logger::log_event_str(", lCS := ");
field_lCS.log();
TTCN_Logger::log_event_str(", lPP := ");
field_lPP.log();
TTCN_Logger::log_event_str(", aCC_CSFB := ");
field_aCC__CSFB.log();
TTCN_Logger::log_event_str(", h245_ASH := ");
field_h245__ASH.log();
TTCN_Logger::log_event_str(", proSe := ");
field_proSe.log();
TTCN_Logger::log_event_str(", proSe_dd := ");
field_proSe__dd.log();
TTCN_Logger::log_event_str(", proSe_dc := ");
field_proSe__dc.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", spare4 := ");
field_spare4.log();
TTCN_Logger::log_event_str(" }");
}

void UENetworkCapabilityV::set_implicit_omit()
{
if (eEA().is_bound()) eEA().set_implicit_omit();
if (eIA().is_bound()) eIA().set_implicit_omit();
if (!uEA().is_bound()) uEA() = OMIT_VALUE;
else uEA().set_implicit_omit();
if (!uIA().is_bound()) uIA() = OMIT_VALUE;
else uIA().set_implicit_omit();
if (!uCS2().is_bound()) uCS2() = OMIT_VALUE;
else uCS2().set_implicit_omit();
if (!nF().is_bound()) nF() = OMIT_VALUE;
else nF().set_implicit_omit();
if (!sRVCC().is_bound()) sRVCC() = OMIT_VALUE;
else sRVCC().set_implicit_omit();
if (!lCS().is_bound()) lCS() = OMIT_VALUE;
else lCS().set_implicit_omit();
if (!lPP().is_bound()) lPP() = OMIT_VALUE;
else lPP().set_implicit_omit();
if (!aCC__CSFB().is_bound()) aCC__CSFB() = OMIT_VALUE;
else aCC__CSFB().set_implicit_omit();
if (!h245__ASH().is_bound()) h245__ASH() = OMIT_VALUE;
else h245__ASH().set_implicit_omit();
if (!proSe().is_bound()) proSe() = OMIT_VALUE;
else proSe().set_implicit_omit();
if (!proSe__dd().is_bound()) proSe__dd() = OMIT_VALUE;
else proSe__dd().set_implicit_omit();
if (!proSe__dc().is_bound()) proSe__dc() = OMIT_VALUE;
else proSe__dc().set_implicit_omit();
if (!spare().is_bound()) spare() = OMIT_VALUE;
else spare().set_implicit_omit();
if (!spare4().is_bound()) spare4() = OMIT_VALUE;
else spare4().set_implicit_omit();
}

void UENetworkCapabilityV::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 (16<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV has 16 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) eEA().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eIA().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uEA().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uIA().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uCS2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nF().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sRVCC().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) lCS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) lPP().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) aCC__CSFB().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) h245__ASH().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) proSe().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) proSe__dd().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) proSe__dc().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(15));
    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(), "eEA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eEA().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(), "eIA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eIA().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(), "uEA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uEA().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(), "uIA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uIA().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(), "uCS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uCS2().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(), "nF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nF().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(), "sRVCC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sRVCC().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(), "lCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS().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(), "lPP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lPP().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(), "aCC_CSFB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aCC__CSFB().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(), "h245_ASH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          h245__ASH().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(), "proSe")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe().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(), "proSe_dd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe__dd().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(), "proSe_dc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe__dc().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
  }
}

void UENetworkCapabilityV::encode_text(Text_Buf& text_buf) const
{
field_eEA.encode_text(text_buf);
field_eIA.encode_text(text_buf);
field_uEA.encode_text(text_buf);
field_uIA.encode_text(text_buf);
field_uCS2.encode_text(text_buf);
field_nF.encode_text(text_buf);
field_sRVCC.encode_text(text_buf);
field_lCS.encode_text(text_buf);
field_lPP.encode_text(text_buf);
field_aCC__CSFB.encode_text(text_buf);
field_h245__ASH.encode_text(text_buf);
field_proSe.encode_text(text_buf);
field_proSe__dd.encode_text(text_buf);
field_proSe__dc.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_spare4.encode_text(text_buf);
}

void UENetworkCapabilityV::decode_text(Text_Buf& text_buf)
{
field_eEA.decode_text(text_buf);
field_eIA.decode_text(text_buf);
field_uEA.decode_text(text_buf);
field_uIA.decode_text(text_buf);
field_uCS2.decode_text(text_buf);
field_nF.decode_text(text_buf);
field_sRVCC.decode_text(text_buf);
field_lCS.decode_text(text_buf);
field_lPP.decode_text(text_buf);
field_aCC__CSFB.decode_text(text_buf);
field_h245__ASH.decode_text(text_buf);
field_proSe.decode_text(text_buf);
field_proSe__dd.decode_text(text_buf);
field_proSe__dc.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_spare4.decode_text(text_buf);
}

void UENetworkCapabilityV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UENetworkCapabilityV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UENetworkCapabilityV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_eEA.RAW_decode(General__Types::BIT8_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_eIA.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_uEA = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_uEA().RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_uEA = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_uEA=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_uIA = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_uIA().RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_uIA = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_uIA=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_uCS2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_uCS2().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_uCS2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_uCS2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_nF = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_nF().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_nF = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_nF=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_sRVCC = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_sRVCC().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_sRVCC = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_sRVCC=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_lCS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lCS().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_lCS = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lCS=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_lPP = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lPP().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_lPP = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lPP=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_aCC__CSFB = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_aCC__CSFB().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_aCC__CSFB = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_aCC__CSFB=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_h245__ASH = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_h245__ASH().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_h245__ASH = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_h245__ASH=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_proSe = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_proSe().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_proSe = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_proSe=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_proSe__dd = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_proSe__dd().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_proSe__dd = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_proSe__dd=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_proSe__dc = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_proSe__dc().RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_proSe__dc = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_proSe__dc=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_spare = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare().RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_spare = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_spare=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_spare4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_spare4().RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_spare4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_spare4=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UENetworkCapabilityV::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 = 16;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(16);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT8_descr_.raw);
  if (field_uEA.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT8_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_uIA.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT7_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_uCS2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_nF.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_sRVCC.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_lCS.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_lPP.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_aCC__CSFB.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_h245__ASH.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_proSe.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_proSe__dd.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_proSe__dc.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, General__Types::BIT1_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_spare.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, General__Types::BIT7_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_spare4.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, OCTETSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  encoded_length += field_eEA.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eIA.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[1]);
  if (field_uEA.ispresent()) {
  encoded_length += field_uEA().RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_uIA.ispresent()) {
  encoded_length += field_uIA().RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_uCS2.ispresent()) {
  encoded_length += field_uCS2().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_nF.ispresent()) {
  encoded_length += field_nF().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_sRVCC.ispresent()) {
  encoded_length += field_sRVCC().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_lCS.ispresent()) {
  encoded_length += field_lCS().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_lPP.ispresent()) {
  encoded_length += field_lPP().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_aCC__CSFB.ispresent()) {
  encoded_length += field_aCC__CSFB().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_h245__ASH.ispresent()) {
  encoded_length += field_h245__ASH().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_proSe.ispresent()) {
  encoded_length += field_proSe().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_proSe__dd.ispresent()) {
  encoded_length += field_proSe__dd().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_proSe__dc.ispresent()) {
  encoded_length += field_proSe__dc().RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_spare.ispresent()) {
  encoded_length += field_spare().RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_spare4.ispresent()) {
  encoded_length += field_spare4().RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[15]);
  }
  return myleaf.length = encoded_length;
}

struct UENetworkCapabilityV_template::single_value_struct {
BITSTRING_template field_eEA;
BITSTRING_template field_eIA;
BITSTRING_template field_uEA;
BITSTRING_template field_uIA;
BITSTRING_template field_uCS2;
BITSTRING_template field_nF;
BITSTRING_template field_sRVCC;
BITSTRING_template field_lCS;
BITSTRING_template field_lPP;
BITSTRING_template field_aCC__CSFB;
BITSTRING_template field_h245__ASH;
BITSTRING_template field_proSe;
BITSTRING_template field_proSe__dd;
BITSTRING_template field_proSe__dc;
BITSTRING_template field_spare;
OCTETSTRING_template field_spare4;
};

void UENetworkCapabilityV_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_eEA = ANY_VALUE;
single_value->field_eIA = ANY_VALUE;
single_value->field_uEA = ANY_OR_OMIT;
single_value->field_uIA = ANY_OR_OMIT;
single_value->field_uCS2 = ANY_OR_OMIT;
single_value->field_nF = ANY_OR_OMIT;
single_value->field_sRVCC = ANY_OR_OMIT;
single_value->field_lCS = ANY_OR_OMIT;
single_value->field_lPP = ANY_OR_OMIT;
single_value->field_aCC__CSFB = ANY_OR_OMIT;
single_value->field_h245__ASH = ANY_OR_OMIT;
single_value->field_proSe = ANY_OR_OMIT;
single_value->field_proSe__dd = ANY_OR_OMIT;
single_value->field_proSe__dc = ANY_OR_OMIT;
single_value->field_spare = ANY_OR_OMIT;
single_value->field_spare4 = ANY_OR_OMIT;
}
}
}

void UENetworkCapabilityV_template::copy_value(const UENetworkCapabilityV& other_value)
{
single_value = new single_value_struct;
if (other_value.eEA().is_bound()) {
  single_value->field_eEA = other_value.eEA();
} else {
  single_value->field_eEA.clean_up();
}
if (other_value.eIA().is_bound()) {
  single_value->field_eIA = other_value.eIA();
} else {
  single_value->field_eIA.clean_up();
}
if (other_value.uEA().is_bound()) {
  if (other_value.uEA().ispresent()) single_value->field_uEA = other_value.uEA()();
  else single_value->field_uEA = OMIT_VALUE;
} else {
  single_value->field_uEA.clean_up();
}
if (other_value.uIA().is_bound()) {
  if (other_value.uIA().ispresent()) single_value->field_uIA = other_value.uIA()();
  else single_value->field_uIA = OMIT_VALUE;
} else {
  single_value->field_uIA.clean_up();
}
if (other_value.uCS2().is_bound()) {
  if (other_value.uCS2().ispresent()) single_value->field_uCS2 = other_value.uCS2()();
  else single_value->field_uCS2 = OMIT_VALUE;
} else {
  single_value->field_uCS2.clean_up();
}
if (other_value.nF().is_bound()) {
  if (other_value.nF().ispresent()) single_value->field_nF = other_value.nF()();
  else single_value->field_nF = OMIT_VALUE;
} else {
  single_value->field_nF.clean_up();
}
if (other_value.sRVCC().is_bound()) {
  if (other_value.sRVCC().ispresent()) single_value->field_sRVCC = other_value.sRVCC()();
  else single_value->field_sRVCC = OMIT_VALUE;
} else {
  single_value->field_sRVCC.clean_up();
}
if (other_value.lCS().is_bound()) {
  if (other_value.lCS().ispresent()) single_value->field_lCS = other_value.lCS()();
  else single_value->field_lCS = OMIT_VALUE;
} else {
  single_value->field_lCS.clean_up();
}
if (other_value.lPP().is_bound()) {
  if (other_value.lPP().ispresent()) single_value->field_lPP = other_value.lPP()();
  else single_value->field_lPP = OMIT_VALUE;
} else {
  single_value->field_lPP.clean_up();
}
if (other_value.aCC__CSFB().is_bound()) {
  if (other_value.aCC__CSFB().ispresent()) single_value->field_aCC__CSFB = other_value.aCC__CSFB()();
  else single_value->field_aCC__CSFB = OMIT_VALUE;
} else {
  single_value->field_aCC__CSFB.clean_up();
}
if (other_value.h245__ASH().is_bound()) {
  if (other_value.h245__ASH().ispresent()) single_value->field_h245__ASH = other_value.h245__ASH()();
  else single_value->field_h245__ASH = OMIT_VALUE;
} else {
  single_value->field_h245__ASH.clean_up();
}
if (other_value.proSe().is_bound()) {
  if (other_value.proSe().ispresent()) single_value->field_proSe = other_value.proSe()();
  else single_value->field_proSe = OMIT_VALUE;
} else {
  single_value->field_proSe.clean_up();
}
if (other_value.proSe__dd().is_bound()) {
  if (other_value.proSe__dd().ispresent()) single_value->field_proSe__dd = other_value.proSe__dd()();
  else single_value->field_proSe__dd = OMIT_VALUE;
} else {
  single_value->field_proSe__dd.clean_up();
}
if (other_value.proSe__dc().is_bound()) {
  if (other_value.proSe__dc().ispresent()) single_value->field_proSe__dc = other_value.proSe__dc()();
  else single_value->field_proSe__dc = OMIT_VALUE;
} else {
  single_value->field_proSe__dc.clean_up();
}
if (other_value.spare().is_bound()) {
  if (other_value.spare().ispresent()) single_value->field_spare = other_value.spare()();
  else single_value->field_spare = OMIT_VALUE;
} else {
  single_value->field_spare.clean_up();
}
if (other_value.spare4().is_bound()) {
  if (other_value.spare4().ispresent()) single_value->field_spare4 = other_value.spare4()();
  else single_value->field_spare4 = OMIT_VALUE;
} else {
  single_value->field_spare4.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UENetworkCapabilityV_template::copy_template(const UENetworkCapabilityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.eEA().get_selection()) {
single_value->field_eEA = other_value.eEA();
} else {
single_value->field_eEA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eIA().get_selection()) {
single_value->field_eIA = other_value.eIA();
} else {
single_value->field_eIA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uEA().get_selection()) {
single_value->field_uEA = other_value.uEA();
} else {
single_value->field_uEA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uIA().get_selection()) {
single_value->field_uIA = other_value.uIA();
} else {
single_value->field_uIA.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uCS2().get_selection()) {
single_value->field_uCS2 = other_value.uCS2();
} else {
single_value->field_uCS2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nF().get_selection()) {
single_value->field_nF = other_value.nF();
} else {
single_value->field_nF.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sRVCC().get_selection()) {
single_value->field_sRVCC = other_value.sRVCC();
} else {
single_value->field_sRVCC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lCS().get_selection()) {
single_value->field_lCS = other_value.lCS();
} else {
single_value->field_lCS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lPP().get_selection()) {
single_value->field_lPP = other_value.lPP();
} else {
single_value->field_lPP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aCC__CSFB().get_selection()) {
single_value->field_aCC__CSFB = other_value.aCC__CSFB();
} else {
single_value->field_aCC__CSFB.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.h245__ASH().get_selection()) {
single_value->field_h245__ASH = other_value.h245__ASH();
} else {
single_value->field_h245__ASH.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.proSe().get_selection()) {
single_value->field_proSe = other_value.proSe();
} else {
single_value->field_proSe.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.proSe__dd().get_selection()) {
single_value->field_proSe__dd = other_value.proSe__dd();
} else {
single_value->field_proSe__dd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.proSe__dc().get_selection()) {
single_value->field_proSe__dc = other_value.proSe__dc();
} else {
single_value->field_proSe__dc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare4().get_selection()) {
single_value->field_spare4 = other_value.spare4();
} else {
single_value->field_spare4.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 UENetworkCapabilityV_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 UENetworkCapabilityV_template(*other_value.implication_.precondition);
implication_.implied_template = new UENetworkCapabilityV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
break;
}
set_selection(other_value);
}

UENetworkCapabilityV_template::UENetworkCapabilityV_template()
{
}

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

UENetworkCapabilityV_template::UENetworkCapabilityV_template(const UENetworkCapabilityV& other_value)
{
copy_value(other_value);
}

UENetworkCapabilityV_template::UENetworkCapabilityV_template(const OPTIONAL<UENetworkCapabilityV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV from an unbound optional field.");
}
}

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

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

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

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

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

UENetworkCapabilityV_template& UENetworkCapabilityV_template::operator=(const UENetworkCapabilityV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UENetworkCapabilityV_template& UENetworkCapabilityV_template::operator=(const OPTIONAL<UENetworkCapabilityV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityV&)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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
}
return *this;
}

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

boolean UENetworkCapabilityV_template::match(const UENetworkCapabilityV& 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.eEA().is_bound()) return FALSE;
if(!single_value->field_eEA.match(other_value.eEA(), legacy))return FALSE;
if(!other_value.eIA().is_bound()) return FALSE;
if(!single_value->field_eIA.match(other_value.eIA(), legacy))return FALSE;
if(!other_value.uEA().is_bound()) return FALSE;
if((other_value.uEA().ispresent() ? !single_value->field_uEA.match((const BITSTRING&)other_value.uEA(), legacy) : !single_value->field_uEA.match_omit(legacy)))return FALSE;
if(!other_value.uIA().is_bound()) return FALSE;
if((other_value.uIA().ispresent() ? !single_value->field_uIA.match((const BITSTRING&)other_value.uIA(), legacy) : !single_value->field_uIA.match_omit(legacy)))return FALSE;
if(!other_value.uCS2().is_bound()) return FALSE;
if((other_value.uCS2().ispresent() ? !single_value->field_uCS2.match((const BITSTRING&)other_value.uCS2(), legacy) : !single_value->field_uCS2.match_omit(legacy)))return FALSE;
if(!other_value.nF().is_bound()) return FALSE;
if((other_value.nF().ispresent() ? !single_value->field_nF.match((const BITSTRING&)other_value.nF(), legacy) : !single_value->field_nF.match_omit(legacy)))return FALSE;
if(!other_value.sRVCC().is_bound()) return FALSE;
if((other_value.sRVCC().ispresent() ? !single_value->field_sRVCC.match((const BITSTRING&)other_value.sRVCC(), legacy) : !single_value->field_sRVCC.match_omit(legacy)))return FALSE;
if(!other_value.lCS().is_bound()) return FALSE;
if((other_value.lCS().ispresent() ? !single_value->field_lCS.match((const BITSTRING&)other_value.lCS(), legacy) : !single_value->field_lCS.match_omit(legacy)))return FALSE;
if(!other_value.lPP().is_bound()) return FALSE;
if((other_value.lPP().ispresent() ? !single_value->field_lPP.match((const BITSTRING&)other_value.lPP(), legacy) : !single_value->field_lPP.match_omit(legacy)))return FALSE;
if(!other_value.aCC__CSFB().is_bound()) return FALSE;
if((other_value.aCC__CSFB().ispresent() ? !single_value->field_aCC__CSFB.match((const BITSTRING&)other_value.aCC__CSFB(), legacy) : !single_value->field_aCC__CSFB.match_omit(legacy)))return FALSE;
if(!other_value.h245__ASH().is_bound()) return FALSE;
if((other_value.h245__ASH().ispresent() ? !single_value->field_h245__ASH.match((const BITSTRING&)other_value.h245__ASH(), legacy) : !single_value->field_h245__ASH.match_omit(legacy)))return FALSE;
if(!other_value.proSe().is_bound()) return FALSE;
if((other_value.proSe().ispresent() ? !single_value->field_proSe.match((const BITSTRING&)other_value.proSe(), legacy) : !single_value->field_proSe.match_omit(legacy)))return FALSE;
if(!other_value.proSe__dd().is_bound()) return FALSE;
if((other_value.proSe__dd().ispresent() ? !single_value->field_proSe__dd.match((const BITSTRING&)other_value.proSe__dd(), legacy) : !single_value->field_proSe__dd.match_omit(legacy)))return FALSE;
if(!other_value.proSe__dc().is_bound()) return FALSE;
if((other_value.proSe__dc().ispresent() ? !single_value->field_proSe__dc.match((const BITSTRING&)other_value.proSe__dc(), legacy) : !single_value->field_proSe__dc.match_omit(legacy)))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if((other_value.spare().ispresent() ? !single_value->field_spare.match((const BITSTRING&)other_value.spare(), legacy) : !single_value->field_spare.match_omit(legacy)))return FALSE;
if(!other_value.spare4().is_bound()) return FALSE;
if((other_value.spare4().ispresent() ? !single_value->field_spare4.match((const OCTETSTRING&)other_value.spare4(), legacy) : !single_value->field_spare4.match_omit(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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
}
return FALSE;
}

boolean UENetworkCapabilityV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_eEA.is_bound()
 || single_value->field_eIA.is_bound()
 || (single_value->field_uEA.is_omit() || single_value->field_uEA.is_bound())
 || (single_value->field_uIA.is_omit() || single_value->field_uIA.is_bound())
 || (single_value->field_uCS2.is_omit() || single_value->field_uCS2.is_bound())
 || (single_value->field_nF.is_omit() || single_value->field_nF.is_bound())
 || (single_value->field_sRVCC.is_omit() || single_value->field_sRVCC.is_bound())
 || (single_value->field_lCS.is_omit() || single_value->field_lCS.is_bound())
 || (single_value->field_lPP.is_omit() || single_value->field_lPP.is_bound())
 || (single_value->field_aCC__CSFB.is_omit() || single_value->field_aCC__CSFB.is_bound())
 || (single_value->field_h245__ASH.is_omit() || single_value->field_h245__ASH.is_bound())
 || (single_value->field_proSe.is_omit() || single_value->field_proSe.is_bound())
 || (single_value->field_proSe__dd.is_omit() || single_value->field_proSe__dd.is_bound())
 || (single_value->field_proSe__dc.is_omit() || single_value->field_proSe__dc.is_bound())
 || (single_value->field_spare.is_omit() || single_value->field_spare.is_bound())
 || (single_value->field_spare4.is_omit() || single_value->field_spare4.is_bound());
}

boolean UENetworkCapabilityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_eEA.is_value()
 && single_value->field_eIA.is_value()
 && (single_value->field_uEA.is_omit() || single_value->field_uEA.is_value())
 && (single_value->field_uIA.is_omit() || single_value->field_uIA.is_value())
 && (single_value->field_uCS2.is_omit() || single_value->field_uCS2.is_value())
 && (single_value->field_nF.is_omit() || single_value->field_nF.is_value())
 && (single_value->field_sRVCC.is_omit() || single_value->field_sRVCC.is_value())
 && (single_value->field_lCS.is_omit() || single_value->field_lCS.is_value())
 && (single_value->field_lPP.is_omit() || single_value->field_lPP.is_value())
 && (single_value->field_aCC__CSFB.is_omit() || single_value->field_aCC__CSFB.is_value())
 && (single_value->field_h245__ASH.is_omit() || single_value->field_h245__ASH.is_value())
 && (single_value->field_proSe.is_omit() || single_value->field_proSe.is_value())
 && (single_value->field_proSe__dd.is_omit() || single_value->field_proSe__dd.is_value())
 && (single_value->field_proSe__dc.is_omit() || single_value->field_proSe__dc.is_value())
 && (single_value->field_spare.is_omit() || single_value->field_spare.is_value())
 && (single_value->field_spare4.is_omit() || single_value->field_spare4.is_value());
}

void UENetworkCapabilityV_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;
}

UENetworkCapabilityV UENetworkCapabilityV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
UENetworkCapabilityV ret_val;
if (single_value->field_eEA.is_bound()) {
ret_val.eEA() = single_value->field_eEA.valueof();
}
if (single_value->field_eIA.is_bound()) {
ret_val.eIA() = single_value->field_eIA.valueof();
}
if (single_value->field_uEA.is_omit()) ret_val.uEA() = OMIT_VALUE;
else if (single_value->field_uEA.is_bound()) {
ret_val.uEA() = single_value->field_uEA.valueof();
}
if (single_value->field_uIA.is_omit()) ret_val.uIA() = OMIT_VALUE;
else if (single_value->field_uIA.is_bound()) {
ret_val.uIA() = single_value->field_uIA.valueof();
}
if (single_value->field_uCS2.is_omit()) ret_val.uCS2() = OMIT_VALUE;
else if (single_value->field_uCS2.is_bound()) {
ret_val.uCS2() = single_value->field_uCS2.valueof();
}
if (single_value->field_nF.is_omit()) ret_val.nF() = OMIT_VALUE;
else if (single_value->field_nF.is_bound()) {
ret_val.nF() = single_value->field_nF.valueof();
}
if (single_value->field_sRVCC.is_omit()) ret_val.sRVCC() = OMIT_VALUE;
else if (single_value->field_sRVCC.is_bound()) {
ret_val.sRVCC() = single_value->field_sRVCC.valueof();
}
if (single_value->field_lCS.is_omit()) ret_val.lCS() = OMIT_VALUE;
else if (single_value->field_lCS.is_bound()) {
ret_val.lCS() = single_value->field_lCS.valueof();
}
if (single_value->field_lPP.is_omit()) ret_val.lPP() = OMIT_VALUE;
else if (single_value->field_lPP.is_bound()) {
ret_val.lPP() = single_value->field_lPP.valueof();
}
if (single_value->field_aCC__CSFB.is_omit()) ret_val.aCC__CSFB() = OMIT_VALUE;
else if (single_value->field_aCC__CSFB.is_bound()) {
ret_val.aCC__CSFB() = single_value->field_aCC__CSFB.valueof();
}
if (single_value->field_h245__ASH.is_omit()) ret_val.h245__ASH() = OMIT_VALUE;
else if (single_value->field_h245__ASH.is_bound()) {
ret_val.h245__ASH() = single_value->field_h245__ASH.valueof();
}
if (single_value->field_proSe.is_omit()) ret_val.proSe() = OMIT_VALUE;
else if (single_value->field_proSe.is_bound()) {
ret_val.proSe() = single_value->field_proSe.valueof();
}
if (single_value->field_proSe__dd.is_omit()) ret_val.proSe__dd() = OMIT_VALUE;
else if (single_value->field_proSe__dd.is_bound()) {
ret_val.proSe__dd() = single_value->field_proSe__dd.valueof();
}
if (single_value->field_proSe__dc.is_omit()) ret_val.proSe__dc() = OMIT_VALUE;
else if (single_value->field_proSe__dc.is_bound()) {
ret_val.proSe__dc() = single_value->field_proSe__dc.valueof();
}
if (single_value->field_spare.is_omit()) ret_val.spare() = OMIT_VALUE;
else if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_spare4.is_omit()) ret_val.spare4() = OMIT_VALUE;
else if (single_value->field_spare4.is_bound()) {
ret_val.spare4() = single_value->field_spare4.valueof();
}
return ret_val;
}

void UENetworkCapabilityV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UENetworkCapabilityV_template[list_length];
}

UENetworkCapabilityV_template& UENetworkCapabilityV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return value_list.list_value[list_index];
}

BITSTRING_template& UENetworkCapabilityV_template::eEA()
{
set_specific();
return single_value->field_eEA;
}

const BITSTRING_template& UENetworkCapabilityV_template::eEA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eEA of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_eEA;
}

BITSTRING_template& UENetworkCapabilityV_template::eIA()
{
set_specific();
return single_value->field_eIA;
}

const BITSTRING_template& UENetworkCapabilityV_template::eIA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eIA of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_eIA;
}

BITSTRING_template& UENetworkCapabilityV_template::uEA()
{
set_specific();
return single_value->field_uEA;
}

const BITSTRING_template& UENetworkCapabilityV_template::uEA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uEA of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_uEA;
}

BITSTRING_template& UENetworkCapabilityV_template::uIA()
{
set_specific();
return single_value->field_uIA;
}

const BITSTRING_template& UENetworkCapabilityV_template::uIA() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uIA of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_uIA;
}

BITSTRING_template& UENetworkCapabilityV_template::uCS2()
{
set_specific();
return single_value->field_uCS2;
}

const BITSTRING_template& UENetworkCapabilityV_template::uCS2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uCS2 of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_uCS2;
}

BITSTRING_template& UENetworkCapabilityV_template::nF()
{
set_specific();
return single_value->field_nF;
}

const BITSTRING_template& UENetworkCapabilityV_template::nF() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nF of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_nF;
}

BITSTRING_template& UENetworkCapabilityV_template::sRVCC()
{
set_specific();
return single_value->field_sRVCC;
}

const BITSTRING_template& UENetworkCapabilityV_template::sRVCC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sRVCC of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_sRVCC;
}

BITSTRING_template& UENetworkCapabilityV_template::lCS()
{
set_specific();
return single_value->field_lCS;
}

const BITSTRING_template& UENetworkCapabilityV_template::lCS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lCS of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_lCS;
}

BITSTRING_template& UENetworkCapabilityV_template::lPP()
{
set_specific();
return single_value->field_lPP;
}

const BITSTRING_template& UENetworkCapabilityV_template::lPP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lPP of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_lPP;
}

BITSTRING_template& UENetworkCapabilityV_template::aCC__CSFB()
{
set_specific();
return single_value->field_aCC__CSFB;
}

const BITSTRING_template& UENetworkCapabilityV_template::aCC__CSFB() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aCC_CSFB of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_aCC__CSFB;
}

BITSTRING_template& UENetworkCapabilityV_template::h245__ASH()
{
set_specific();
return single_value->field_h245__ASH;
}

const BITSTRING_template& UENetworkCapabilityV_template::h245__ASH() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field h245_ASH of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_h245__ASH;
}

BITSTRING_template& UENetworkCapabilityV_template::proSe()
{
set_specific();
return single_value->field_proSe;
}

const BITSTRING_template& UENetworkCapabilityV_template::proSe() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field proSe of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_proSe;
}

BITSTRING_template& UENetworkCapabilityV_template::proSe__dd()
{
set_specific();
return single_value->field_proSe__dd;
}

const BITSTRING_template& UENetworkCapabilityV_template::proSe__dd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field proSe_dd of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_proSe__dd;
}

BITSTRING_template& UENetworkCapabilityV_template::proSe__dc()
{
set_specific();
return single_value->field_proSe__dc;
}

const BITSTRING_template& UENetworkCapabilityV_template::proSe__dc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field proSe_dc of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_proSe__dc;
}

BITSTRING_template& UENetworkCapabilityV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& UENetworkCapabilityV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_spare;
}

OCTETSTRING_template& UENetworkCapabilityV_template::spare4()
{
set_specific();
return single_value->field_spare4;
}

const OCTETSTRING_template& UENetworkCapabilityV_template::spare4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare4 of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
return single_value->field_spare4;
}

int UENetworkCapabilityV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_uEA.is_present()) ret_val++;
      if (single_value->field_uIA.is_present()) ret_val++;
      if (single_value->field_uCS2.is_present()) ret_val++;
      if (single_value->field_nF.is_present()) ret_val++;
      if (single_value->field_sRVCC.is_present()) ret_val++;
      if (single_value->field_lCS.is_present()) ret_val++;
      if (single_value->field_lPP.is_present()) ret_val++;
      if (single_value->field_aCC__CSFB.is_present()) ret_val++;
      if (single_value->field_h245__ASH.is_present()) ret_val++;
      if (single_value->field_proSe.is_present()) ret_val++;
      if (single_value->field_proSe__dd.is_present()) ret_val++;
      if (single_value->field_proSe__dc.is_present()) ret_val++;
      if (single_value->field_spare.is_present()) ret_val++;
      if (single_value->field_spare4.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
  }
  return 0;
}

void UENetworkCapabilityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ eEA := ");
single_value->field_eEA.log();
TTCN_Logger::log_event_str(", eIA := ");
single_value->field_eIA.log();
TTCN_Logger::log_event_str(", uEA := ");
single_value->field_uEA.log();
TTCN_Logger::log_event_str(", uIA := ");
single_value->field_uIA.log();
TTCN_Logger::log_event_str(", uCS2 := ");
single_value->field_uCS2.log();
TTCN_Logger::log_event_str(", nF := ");
single_value->field_nF.log();
TTCN_Logger::log_event_str(", sRVCC := ");
single_value->field_sRVCC.log();
TTCN_Logger::log_event_str(", lCS := ");
single_value->field_lCS.log();
TTCN_Logger::log_event_str(", lPP := ");
single_value->field_lPP.log();
TTCN_Logger::log_event_str(", aCC_CSFB := ");
single_value->field_aCC__CSFB.log();
TTCN_Logger::log_event_str(", h245_ASH := ");
single_value->field_h245__ASH.log();
TTCN_Logger::log_event_str(", proSe := ");
single_value->field_proSe.log();
TTCN_Logger::log_event_str(", proSe_dd := ");
single_value->field_proSe__dd.log();
TTCN_Logger::log_event_str(", proSe_dc := ");
single_value->field_proSe__dc.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", spare4 := ");
single_value->field_spare4.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 UENetworkCapabilityV_template::log_match(const UENetworkCapabilityV& 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_eEA.match(match_value.eEA(), legacy)){
TTCN_Logger::log_logmatch_info(".eEA");
single_value->field_eEA.log_match(match_value.eEA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eIA.match(match_value.eIA(), legacy)){
TTCN_Logger::log_logmatch_info(".eIA");
single_value->field_eIA.log_match(match_value.eIA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.uEA().ispresent()){
if(!single_value->field_uEA.match(match_value.uEA(), legacy)){
TTCN_Logger::log_logmatch_info(".uEA");
single_value->field_uEA.log_match(match_value.uEA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uEA.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uEA := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uEA.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uIA().ispresent()){
if(!single_value->field_uIA.match(match_value.uIA(), legacy)){
TTCN_Logger::log_logmatch_info(".uIA");
single_value->field_uIA.log_match(match_value.uIA(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uIA.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uIA := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uIA.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uCS2().ispresent()){
if(!single_value->field_uCS2.match(match_value.uCS2(), legacy)){
TTCN_Logger::log_logmatch_info(".uCS2");
single_value->field_uCS2.log_match(match_value.uCS2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uCS2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uCS2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uCS2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nF().ispresent()){
if(!single_value->field_nF.match(match_value.nF(), legacy)){
TTCN_Logger::log_logmatch_info(".nF");
single_value->field_nF.log_match(match_value.nF(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nF.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nF := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nF.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sRVCC().ispresent()){
if(!single_value->field_sRVCC.match(match_value.sRVCC(), legacy)){
TTCN_Logger::log_logmatch_info(".sRVCC");
single_value->field_sRVCC.log_match(match_value.sRVCC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sRVCC.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sRVCC := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sRVCC.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lCS().ispresent()){
if(!single_value->field_lCS.match(match_value.lCS(), legacy)){
TTCN_Logger::log_logmatch_info(".lCS");
single_value->field_lCS.log_match(match_value.lCS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lCS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lCS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lCS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lPP().ispresent()){
if(!single_value->field_lPP.match(match_value.lPP(), legacy)){
TTCN_Logger::log_logmatch_info(".lPP");
single_value->field_lPP.log_match(match_value.lPP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lPP.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lPP := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lPP.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.aCC__CSFB().ispresent()){
if(!single_value->field_aCC__CSFB.match(match_value.aCC__CSFB(), legacy)){
TTCN_Logger::log_logmatch_info(".aCC_CSFB");
single_value->field_aCC__CSFB.log_match(match_value.aCC__CSFB(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_aCC__CSFB.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".aCC_CSFB := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_aCC__CSFB.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.h245__ASH().ispresent()){
if(!single_value->field_h245__ASH.match(match_value.h245__ASH(), legacy)){
TTCN_Logger::log_logmatch_info(".h245_ASH");
single_value->field_h245__ASH.log_match(match_value.h245__ASH(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_h245__ASH.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".h245_ASH := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_h245__ASH.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.proSe().ispresent()){
if(!single_value->field_proSe.match(match_value.proSe(), legacy)){
TTCN_Logger::log_logmatch_info(".proSe");
single_value->field_proSe.log_match(match_value.proSe(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_proSe.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".proSe := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_proSe.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.proSe__dd().ispresent()){
if(!single_value->field_proSe__dd.match(match_value.proSe__dd(), legacy)){
TTCN_Logger::log_logmatch_info(".proSe_dd");
single_value->field_proSe__dd.log_match(match_value.proSe__dd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_proSe__dd.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".proSe_dd := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_proSe__dd.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.proSe__dc().ispresent()){
if(!single_value->field_proSe__dc.match(match_value.proSe__dc(), legacy)){
TTCN_Logger::log_logmatch_info(".proSe_dc");
single_value->field_proSe__dc.log_match(match_value.proSe__dc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_proSe__dc.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".proSe_dc := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_proSe__dc.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.spare().ispresent()){
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spare.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spare := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spare.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.spare4().ispresent()){
if(!single_value->field_spare4.match(match_value.spare4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare4");
single_value->field_spare4.log_match(match_value.spare4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spare4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spare4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spare4.log();
TTCN_Logger::log_event_str(" unmatched");
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("{ eEA := ");
single_value->field_eEA.log_match(match_value.eEA(), legacy);
TTCN_Logger::log_event_str(", eIA := ");
single_value->field_eIA.log_match(match_value.eIA(), legacy);
TTCN_Logger::log_event_str(", uEA := ");
if (match_value.uEA().ispresent()) {
single_value->field_uEA.log_match(match_value.uEA(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uEA.log();
if (single_value->field_uEA.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uIA := ");
if (match_value.uIA().ispresent()) {
single_value->field_uIA.log_match(match_value.uIA(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uIA.log();
if (single_value->field_uIA.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uCS2 := ");
if (match_value.uCS2().ispresent()) {
single_value->field_uCS2.log_match(match_value.uCS2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uCS2.log();
if (single_value->field_uCS2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nF := ");
if (match_value.nF().ispresent()) {
single_value->field_nF.log_match(match_value.nF(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nF.log();
if (single_value->field_nF.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sRVCC := ");
if (match_value.sRVCC().ispresent()) {
single_value->field_sRVCC.log_match(match_value.sRVCC(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sRVCC.log();
if (single_value->field_sRVCC.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lCS := ");
if (match_value.lCS().ispresent()) {
single_value->field_lCS.log_match(match_value.lCS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lCS.log();
if (single_value->field_lCS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lPP := ");
if (match_value.lPP().ispresent()) {
single_value->field_lPP.log_match(match_value.lPP(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lPP.log();
if (single_value->field_lPP.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", aCC_CSFB := ");
if (match_value.aCC__CSFB().ispresent()) {
single_value->field_aCC__CSFB.log_match(match_value.aCC__CSFB(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_aCC__CSFB.log();
if (single_value->field_aCC__CSFB.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", h245_ASH := ");
if (match_value.h245__ASH().ispresent()) {
single_value->field_h245__ASH.log_match(match_value.h245__ASH(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_h245__ASH.log();
if (single_value->field_h245__ASH.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", proSe := ");
if (match_value.proSe().ispresent()) {
single_value->field_proSe.log_match(match_value.proSe(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_proSe.log();
if (single_value->field_proSe.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", proSe_dd := ");
if (match_value.proSe__dd().ispresent()) {
single_value->field_proSe__dd.log_match(match_value.proSe__dd(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_proSe__dd.log();
if (single_value->field_proSe__dd.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", proSe_dc := ");
if (match_value.proSe__dc().ispresent()) {
single_value->field_proSe__dc.log_match(match_value.proSe__dc(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_proSe__dc.log();
if (single_value->field_proSe__dc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", spare := ");
if (match_value.spare().ispresent()) {
single_value->field_spare.log_match(match_value.spare(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spare.log();
if (single_value->field_spare.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", spare4 := ");
if (match_value.spare4().ispresent()) {
single_value->field_spare4.log_match(match_value.spare4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spare4.log();
if (single_value->field_spare4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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 UENetworkCapabilityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_eEA.encode_text(text_buf);
single_value->field_eIA.encode_text(text_buf);
single_value->field_uEA.encode_text(text_buf);
single_value->field_uIA.encode_text(text_buf);
single_value->field_uCS2.encode_text(text_buf);
single_value->field_nF.encode_text(text_buf);
single_value->field_sRVCC.encode_text(text_buf);
single_value->field_lCS.encode_text(text_buf);
single_value->field_lPP.encode_text(text_buf);
single_value->field_aCC__CSFB.encode_text(text_buf);
single_value->field_h245__ASH.encode_text(text_buf);
single_value->field_proSe.encode_text(text_buf);
single_value->field_proSe__dd.encode_text(text_buf);
single_value->field_proSe__dc.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_spare4.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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
}
}

void UENetworkCapabilityV_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_eEA.decode_text(text_buf);
single_value->field_eIA.decode_text(text_buf);
single_value->field_uEA.decode_text(text_buf);
single_value->field_uIA.decode_text(text_buf);
single_value->field_uCS2.decode_text(text_buf);
single_value->field_nF.decode_text(text_buf);
single_value->field_sRVCC.decode_text(text_buf);
single_value->field_lCS.decode_text(text_buf);
single_value->field_lPP.decode_text(text_buf);
single_value->field_aCC__CSFB.decode_text(text_buf);
single_value->field_h245__ASH.decode_text(text_buf);
single_value->field_proSe.decode_text(text_buf);
single_value->field_proSe__dd.decode_text(text_buf);
single_value->field_proSe__dc.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_spare4.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 UENetworkCapabilityV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV.");
}
}

void UENetworkCapabilityV_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: {
    UENetworkCapabilityV_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 (16<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityV has 16 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) eEA().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eIA().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uEA().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uIA().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uCS2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nF().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sRVCC().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) lCS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) lPP().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) aCC__CSFB().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) h245__ASH().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) proSe().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) proSe__dd().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) proSe__dc().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(15));
    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(), "eEA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eEA().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(), "eIA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eIA().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(), "uEA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uEA().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(), "uIA")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uIA().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(), "uCS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uCS2().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(), "nF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nF().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(), "sRVCC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sRVCC().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(), "lCS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lCS().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(), "lPP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lPP().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(), "aCC_CSFB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aCC__CSFB().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(), "h245_ASH")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          h245__ASH().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(), "proSe")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe().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(), "proSe_dd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe__dd().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(), "proSe_dc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          proSe__dc().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UENetworkCapabilityV_template* precondition = new UENetworkCapabilityV_template;
    precondition->set_param(*param.get_elem(0));
    UENetworkCapabilityV_template* implied_template = new UENetworkCapabilityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UENetworkCapabilityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UENetworkCapabilityV_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_eEA.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_eIA.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_uEA.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_uIA.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_uCS2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_nF.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_sRVCC.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_lCS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_lPP.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_aCC__CSFB.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_h245__ASH.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_proSe.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_proSe__dd.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_proSe__dc.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
single_value->field_spare4.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
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 : "@MobileL3_GMM_SM_Types.UENetworkCapabilityV");
}

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

boolean UENetworkCapabilityV_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;
}

UENetworkCapabilityLV::UENetworkCapabilityLV()
{
}

UENetworkCapabilityLV::UENetworkCapabilityLV(const INTEGER& par_lengthIndicator,
    const UENetworkCapabilityV& par_uENetworkCapabilityV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_uENetworkCapabilityV(par_uENetworkCapabilityV)
{
}

UENetworkCapabilityLV::UENetworkCapabilityLV(const UENetworkCapabilityLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.uENetworkCapabilityV().is_bound()) field_uENetworkCapabilityV = other_value.uENetworkCapabilityV();
else field_uENetworkCapabilityV.clean_up();
}

void UENetworkCapabilityLV::clean_up()
{
field_lengthIndicator.clean_up();
field_uENetworkCapabilityV.clean_up();
}

const TTCN_Typedescriptor_t* UENetworkCapabilityLV::get_descriptor() const { return &UENetworkCapabilityLV_descr_; }
UENetworkCapabilityLV& UENetworkCapabilityLV::operator=(const UENetworkCapabilityLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.uENetworkCapabilityV().is_bound()) field_uENetworkCapabilityV = other_value.uENetworkCapabilityV();
  else field_uENetworkCapabilityV.clean_up();
}
return *this;
}

boolean UENetworkCapabilityLV::operator==(const UENetworkCapabilityLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_uENetworkCapabilityV==other_value.field_uENetworkCapabilityV;
}

boolean UENetworkCapabilityLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_uENetworkCapabilityV.is_bound());
}
boolean UENetworkCapabilityLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_uENetworkCapabilityV.is_value();
}
void UENetworkCapabilityLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", uENetworkCapabilityV := ");
field_uENetworkCapabilityV.log();
TTCN_Logger::log_event_str(" }");
}

void UENetworkCapabilityLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (uENetworkCapabilityV().is_bound()) uENetworkCapabilityV().set_implicit_omit();
}

void UENetworkCapabilityLV::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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "uENetworkCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapabilityV().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UENetworkCapabilityLV");
  }
}

void UENetworkCapabilityLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_uENetworkCapabilityV.encode_text(text_buf);
}

void UENetworkCapabilityLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_uENetworkCapabilityV.decode_text(text_buf);
}

void UENetworkCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UENetworkCapabilityLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UENetworkCapabilityLV::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;
  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, UENetworkCapabilityLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(UENetworkCapabilityLV_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(UENetworkCapabilityLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, UENetworkCapabilityV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapabilityV.RAW_decode(UENetworkCapabilityV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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 UENetworkCapabilityLV::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, UENetworkCapabilityLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, UENetworkCapabilityV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &UENetworkCapabilityLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_uENetworkCapabilityV.RAW_encode(UENetworkCapabilityV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct UENetworkCapabilityLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
UENetworkCapabilityV_template field_uENetworkCapabilityV;
};

void UENetworkCapabilityLV_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_lengthIndicator = ANY_VALUE;
single_value->field_uENetworkCapabilityV = ANY_VALUE;
}
}
}

void UENetworkCapabilityLV_template::copy_value(const UENetworkCapabilityLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.uENetworkCapabilityV().is_bound()) {
  single_value->field_uENetworkCapabilityV = other_value.uENetworkCapabilityV();
} else {
  single_value->field_uENetworkCapabilityV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UENetworkCapabilityLV_template::copy_template(const UENetworkCapabilityLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapabilityV().get_selection()) {
single_value->field_uENetworkCapabilityV = other_value.uENetworkCapabilityV();
} else {
single_value->field_uENetworkCapabilityV.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 UENetworkCapabilityLV_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 UENetworkCapabilityLV_template(*other_value.implication_.precondition);
implication_.implied_template = new UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
break;
}
set_selection(other_value);
}

UENetworkCapabilityLV_template::UENetworkCapabilityLV_template()
{
}

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

UENetworkCapabilityLV_template::UENetworkCapabilityLV_template(const UENetworkCapabilityLV& other_value)
{
copy_value(other_value);
}

UENetworkCapabilityLV_template::UENetworkCapabilityLV_template(const OPTIONAL<UENetworkCapabilityLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV from an unbound optional field.");
}
}

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

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

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

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

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

UENetworkCapabilityLV_template& UENetworkCapabilityLV_template::operator=(const UENetworkCapabilityLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UENetworkCapabilityLV_template& UENetworkCapabilityLV_template::operator=(const OPTIONAL<UENetworkCapabilityLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityLV&)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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
}
return *this;
}

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

boolean UENetworkCapabilityLV_template::match(const UENetworkCapabilityLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.uENetworkCapabilityV().is_bound()) return FALSE;
if(!single_value->field_uENetworkCapabilityV.match(other_value.uENetworkCapabilityV(), 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
}
return FALSE;
}

boolean UENetworkCapabilityLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_uENetworkCapabilityV.is_bound();
}

boolean UENetworkCapabilityLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_uENetworkCapabilityV.is_value();
}

void UENetworkCapabilityLV_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;
}

UENetworkCapabilityLV UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
UENetworkCapabilityLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_uENetworkCapabilityV.is_bound()) {
ret_val.uENetworkCapabilityV() = single_value->field_uENetworkCapabilityV.valueof();
}
return ret_val;
}

void UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UENetworkCapabilityLV_template[list_length];
}

UENetworkCapabilityLV_template& UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
return value_list.list_value[list_index];
}

INTEGER_template& UENetworkCapabilityLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& UENetworkCapabilityLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
return single_value->field_lengthIndicator;
}

UENetworkCapabilityV_template& UENetworkCapabilityLV_template::uENetworkCapabilityV()
{
set_specific();
return single_value->field_uENetworkCapabilityV;
}

const UENetworkCapabilityV_template& UENetworkCapabilityLV_template::uENetworkCapabilityV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapabilityV of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
return single_value->field_uENetworkCapabilityV;
}

int UENetworkCapabilityLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
  }
  return 0;
}

void UENetworkCapabilityLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", uENetworkCapabilityV := ");
single_value->field_uENetworkCapabilityV.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 UENetworkCapabilityLV_template::log_match(const UENetworkCapabilityLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uENetworkCapabilityV.match(match_value.uENetworkCapabilityV(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapabilityV");
single_value->field_uENetworkCapabilityV.log_match(match_value.uENetworkCapabilityV(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", uENetworkCapabilityV := ");
single_value->field_uENetworkCapabilityV.log_match(match_value.uENetworkCapabilityV(), 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 UENetworkCapabilityLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_uENetworkCapabilityV.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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
}
}

void UENetworkCapabilityLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_uENetworkCapabilityV.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 UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV.");
}
}

void UENetworkCapabilityLV_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: {
    UENetworkCapabilityLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapabilityV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "uENetworkCapabilityV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapabilityV().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UENetworkCapabilityLV_template* precondition = new UENetworkCapabilityLV_template;
    precondition->set_param(*param.get_elem(0));
    UENetworkCapabilityLV_template* implied_template = new UENetworkCapabilityLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UENetworkCapabilityLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UENetworkCapabilityLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UENetworkCapabilityLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityLV");
single_value->field_uENetworkCapabilityV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityLV");
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 : "@MobileL3_GMM_SM_Types.UENetworkCapabilityLV");
}

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

boolean UENetworkCapabilityLV_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;
}

UENetworkCapabilityTLV::UENetworkCapabilityTLV()
{
}

UENetworkCapabilityTLV::UENetworkCapabilityTLV(const OCTETSTRING& par_elementIdentifier,
    const UENetworkCapabilityLV& par_uENetworkCapabilityLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_uENetworkCapabilityLV(par_uENetworkCapabilityLV)
{
}

UENetworkCapabilityTLV::UENetworkCapabilityTLV(const UENetworkCapabilityTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.uENetworkCapabilityLV().is_bound()) field_uENetworkCapabilityLV = other_value.uENetworkCapabilityLV();
else field_uENetworkCapabilityLV.clean_up();
}

void UENetworkCapabilityTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_uENetworkCapabilityLV.clean_up();
}

const TTCN_Typedescriptor_t* UENetworkCapabilityTLV::get_descriptor() const { return &UENetworkCapabilityTLV_descr_; }
UENetworkCapabilityTLV& UENetworkCapabilityTLV::operator=(const UENetworkCapabilityTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.uENetworkCapabilityLV().is_bound()) field_uENetworkCapabilityLV = other_value.uENetworkCapabilityLV();
  else field_uENetworkCapabilityLV.clean_up();
}
return *this;
}

boolean UENetworkCapabilityTLV::operator==(const UENetworkCapabilityTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_uENetworkCapabilityLV==other_value.field_uENetworkCapabilityLV;
}

boolean UENetworkCapabilityTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_uENetworkCapabilityLV.is_bound());
}
boolean UENetworkCapabilityTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_uENetworkCapabilityLV.is_value();
}
void UENetworkCapabilityTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", uENetworkCapabilityLV := ");
field_uENetworkCapabilityLV.log();
TTCN_Logger::log_event_str(" }");
}

void UENetworkCapabilityTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (uENetworkCapabilityLV().is_bound()) uENetworkCapabilityLV().set_implicit_omit();
}

void UENetworkCapabilityTLV::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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapabilityLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "uENetworkCapabilityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapabilityLV().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UENetworkCapabilityTLV");
  }
}

void UENetworkCapabilityTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_uENetworkCapabilityLV.encode_text(text_buf);
}

void UENetworkCapabilityTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_uENetworkCapabilityLV.decode_text(text_buf);
}

void UENetworkCapabilityTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UENetworkCapabilityTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UENetworkCapabilityTLV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, UENetworkCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapabilityLV.RAW_decode(UENetworkCapabilityLV_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_elementIdentifier !=  os_8) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UENetworkCapabilityTLV::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, UENetworkCapabilityLV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_uENetworkCapabilityLV.RAW_encode(UENetworkCapabilityLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_8) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct UENetworkCapabilityTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
UENetworkCapabilityLV_template field_uENetworkCapabilityLV;
};

void UENetworkCapabilityTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_uENetworkCapabilityLV = ANY_VALUE;
}
}
}

void UENetworkCapabilityTLV_template::copy_value(const UENetworkCapabilityTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.uENetworkCapabilityLV().is_bound()) {
  single_value->field_uENetworkCapabilityLV = other_value.uENetworkCapabilityLV();
} else {
  single_value->field_uENetworkCapabilityLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UENetworkCapabilityTLV_template::copy_template(const UENetworkCapabilityTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapabilityLV().get_selection()) {
single_value->field_uENetworkCapabilityLV = other_value.uENetworkCapabilityLV();
} else {
single_value->field_uENetworkCapabilityLV.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 UENetworkCapabilityTLV_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 UENetworkCapabilityTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
break;
}
set_selection(other_value);
}

UENetworkCapabilityTLV_template::UENetworkCapabilityTLV_template()
{
}

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

UENetworkCapabilityTLV_template::UENetworkCapabilityTLV_template(const UENetworkCapabilityTLV& other_value)
{
copy_value(other_value);
}

UENetworkCapabilityTLV_template::UENetworkCapabilityTLV_template(const OPTIONAL<UENetworkCapabilityTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV from an unbound optional field.");
}
}

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

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

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

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

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

UENetworkCapabilityTLV_template& UENetworkCapabilityTLV_template::operator=(const UENetworkCapabilityTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UENetworkCapabilityTLV_template& UENetworkCapabilityTLV_template::operator=(const OPTIONAL<UENetworkCapabilityTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UENetworkCapabilityTLV&)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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
}
return *this;
}

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

boolean UENetworkCapabilityTLV_template::match(const UENetworkCapabilityTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.uENetworkCapabilityLV().is_bound()) return FALSE;
if(!single_value->field_uENetworkCapabilityLV.match(other_value.uENetworkCapabilityLV(), 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
}
return FALSE;
}

boolean UENetworkCapabilityTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_uENetworkCapabilityLV.is_bound();
}

boolean UENetworkCapabilityTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_uENetworkCapabilityLV.is_value();
}

void UENetworkCapabilityTLV_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;
}

UENetworkCapabilityTLV UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
UENetworkCapabilityTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_uENetworkCapabilityLV.is_bound()) {
ret_val.uENetworkCapabilityLV() = single_value->field_uENetworkCapabilityLV.valueof();
}
return ret_val;
}

void UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UENetworkCapabilityTLV_template[list_length];
}

UENetworkCapabilityTLV_template& UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& UENetworkCapabilityTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& UENetworkCapabilityTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
return single_value->field_elementIdentifier;
}

UENetworkCapabilityLV_template& UENetworkCapabilityTLV_template::uENetworkCapabilityLV()
{
set_specific();
return single_value->field_uENetworkCapabilityLV;
}

const UENetworkCapabilityLV_template& UENetworkCapabilityTLV_template::uENetworkCapabilityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapabilityLV of a non-specific template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
return single_value->field_uENetworkCapabilityLV;
}

int UENetworkCapabilityTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV 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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
  }
  return 0;
}

void UENetworkCapabilityTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", uENetworkCapabilityLV := ");
single_value->field_uENetworkCapabilityLV.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 UENetworkCapabilityTLV_template::log_match(const UENetworkCapabilityTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uENetworkCapabilityLV.match(match_value.uENetworkCapabilityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapabilityLV");
single_value->field_uENetworkCapabilityLV.log_match(match_value.uENetworkCapabilityLV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", uENetworkCapabilityLV := ");
single_value->field_uENetworkCapabilityLV.log_match(match_value.uENetworkCapabilityLV(), 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 UENetworkCapabilityTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_uENetworkCapabilityLV.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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
}
}

void UENetworkCapabilityTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_uENetworkCapabilityLV.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 UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV.");
}
}

void UENetworkCapabilityTLV_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: {
    UENetworkCapabilityTLV_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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapabilityLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "uENetworkCapabilityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapabilityLV().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 @MobileL3_GMM_SM_Types.UENetworkCapabilityTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UENetworkCapabilityTLV_template* precondition = new UENetworkCapabilityTLV_template;
    precondition->set_param(*param.get_elem(0));
    UENetworkCapabilityTLV_template* implied_template = new UENetworkCapabilityTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UENetworkCapabilityTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UENetworkCapabilityTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UENetworkCapabilityTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityTLV");
single_value->field_uENetworkCapabilityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UENetworkCapabilityTLV");
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 : "@MobileL3_GMM_SM_Types.UENetworkCapabilityTLV");
}

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

boolean UENetworkCapabilityTLV_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;
}

EUTRANinterRATInformationContainerTLV::EUTRANinterRATInformationContainerTLV()
{
}

EUTRANinterRATInformationContainerTLV::EUTRANinterRATInformationContainerTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_eUTRANinterRATInformationContainerV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_eUTRANinterRATInformationContainerV(par_eUTRANinterRATInformationContainerV)
{
}

EUTRANinterRATInformationContainerTLV::EUTRANinterRATInformationContainerTLV(const EUTRANinterRATInformationContainerTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.eUTRANinterRATInformationContainerV().is_bound()) field_eUTRANinterRATInformationContainerV = other_value.eUTRANinterRATInformationContainerV();
else field_eUTRANinterRATInformationContainerV.clean_up();
}

void EUTRANinterRATInformationContainerTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_eUTRANinterRATInformationContainerV.clean_up();
}

const TTCN_Typedescriptor_t* EUTRANinterRATInformationContainerTLV::get_descriptor() const { return &EUTRANinterRATInformationContainerTLV_descr_; }
EUTRANinterRATInformationContainerTLV& EUTRANinterRATInformationContainerTLV::operator=(const EUTRANinterRATInformationContainerTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.eUTRANinterRATInformationContainerV().is_bound()) field_eUTRANinterRATInformationContainerV = other_value.eUTRANinterRATInformationContainerV();
  else field_eUTRANinterRATInformationContainerV.clean_up();
}
return *this;
}

boolean EUTRANinterRATInformationContainerTLV::operator==(const EUTRANinterRATInformationContainerTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_eUTRANinterRATInformationContainerV==other_value.field_eUTRANinterRATInformationContainerV;
}

boolean EUTRANinterRATInformationContainerTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_eUTRANinterRATInformationContainerV.is_bound());
}
boolean EUTRANinterRATInformationContainerTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_eUTRANinterRATInformationContainerV.is_value();
}
void EUTRANinterRATInformationContainerTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", eUTRANinterRATInformationContainerV := ");
field_eUTRANinterRATInformationContainerV.log();
TTCN_Logger::log_event_str(" }");
}

void EUTRANinterRATInformationContainerTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (eUTRANinterRATInformationContainerV().is_bound()) eUTRANinterRATInformationContainerV().set_implicit_omit();
}

void EUTRANinterRATInformationContainerTLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATInformationContainerV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "eUTRANinterRATInformationContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATInformationContainerV().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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
  }
}

void EUTRANinterRATInformationContainerTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_eUTRANinterRATInformationContainerV.encode_text(text_buf);
}

void EUTRANinterRATInformationContainerTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_eUTRANinterRATInformationContainerV.decode_text(text_buf);
}

void EUTRANinterRATInformationContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void EUTRANinterRATInformationContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int EUTRANinterRATInformationContainerTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, EUTRANinterRATInformationContainerTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(EUTRANinterRATInformationContainerTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(EUTRANinterRATInformationContainerTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_eUTRANinterRATInformationContainerV.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_9) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int EUTRANinterRATInformationContainerTLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EUTRANinterRATInformationContainerTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &EUTRANinterRATInformationContainerTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_eUTRANinterRATInformationContainerV.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_9) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_9.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct EUTRANinterRATInformationContainerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_eUTRANinterRATInformationContainerV;
};

void EUTRANinterRATInformationContainerTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_eUTRANinterRATInformationContainerV = ANY_VALUE;
}
}
}

void EUTRANinterRATInformationContainerTLV_template::copy_value(const EUTRANinterRATInformationContainerTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.eUTRANinterRATInformationContainerV().is_bound()) {
  single_value->field_eUTRANinterRATInformationContainerV = other_value.eUTRANinterRATInformationContainerV();
} else {
  single_value->field_eUTRANinterRATInformationContainerV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EUTRANinterRATInformationContainerTLV_template::copy_template(const EUTRANinterRATInformationContainerTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANinterRATInformationContainerV().get_selection()) {
single_value->field_eUTRANinterRATInformationContainerV = other_value.eUTRANinterRATInformationContainerV();
} else {
single_value->field_eUTRANinterRATInformationContainerV.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 EUTRANinterRATInformationContainerTLV_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 EUTRANinterRATInformationContainerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new EUTRANinterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
break;
}
set_selection(other_value);
}

EUTRANinterRATInformationContainerTLV_template::EUTRANinterRATInformationContainerTLV_template()
{
}

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

EUTRANinterRATInformationContainerTLV_template::EUTRANinterRATInformationContainerTLV_template(const EUTRANinterRATInformationContainerTLV& other_value)
{
copy_value(other_value);
}

EUTRANinterRATInformationContainerTLV_template::EUTRANinterRATInformationContainerTLV_template(const OPTIONAL<EUTRANinterRATInformationContainerTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const EUTRANinterRATInformationContainerTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV from an unbound optional field.");
}
}

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

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

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

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

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

EUTRANinterRATInformationContainerTLV_template& EUTRANinterRATInformationContainerTLV_template::operator=(const EUTRANinterRATInformationContainerTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

EUTRANinterRATInformationContainerTLV_template& EUTRANinterRATInformationContainerTLV_template::operator=(const OPTIONAL<EUTRANinterRATInformationContainerTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const EUTRANinterRATInformationContainerTLV&)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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
}
return *this;
}

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

boolean EUTRANinterRATInformationContainerTLV_template::match(const EUTRANinterRATInformationContainerTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.eUTRANinterRATInformationContainerV().is_bound()) return FALSE;
if(!single_value->field_eUTRANinterRATInformationContainerV.match(other_value.eUTRANinterRATInformationContainerV(), 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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
}
return FALSE;
}

boolean EUTRANinterRATInformationContainerTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_eUTRANinterRATInformationContainerV.is_bound();
}

boolean EUTRANinterRATInformationContainerTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_eUTRANinterRATInformationContainerV.is_value();
}

void EUTRANinterRATInformationContainerTLV_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;
}

EUTRANinterRATInformationContainerTLV EUTRANinterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
EUTRANinterRATInformationContainerTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_eUTRANinterRATInformationContainerV.is_bound()) {
ret_val.eUTRANinterRATInformationContainerV() = single_value->field_eUTRANinterRATInformationContainerV.valueof();
}
return ret_val;
}

void EUTRANinterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EUTRANinterRATInformationContainerTLV_template[list_length];
}

EUTRANinterRATInformationContainerTLV_template& EUTRANinterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& EUTRANinterRATInformationContainerTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& EUTRANinterRATInformationContainerTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& EUTRANinterRATInformationContainerTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& EUTRANinterRATInformationContainerTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& EUTRANinterRATInformationContainerTLV_template::eUTRANinterRATInformationContainerV()
{
set_specific();
return single_value->field_eUTRANinterRATInformationContainerV;
}

const OCTETSTRING_template& EUTRANinterRATInformationContainerTLV_template::eUTRANinterRATInformationContainerV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANinterRATInformationContainerV of a non-specific template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
return single_value->field_eUTRANinterRATInformationContainerV;
}

int EUTRANinterRATInformationContainerTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV 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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
  }
  return 0;
}

void EUTRANinterRATInformationContainerTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", eUTRANinterRATInformationContainerV := ");
single_value->field_eUTRANinterRATInformationContainerV.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 EUTRANinterRATInformationContainerTLV_template::log_match(const EUTRANinterRATInformationContainerTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRANinterRATInformationContainerV.match(match_value.eUTRANinterRATInformationContainerV(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANinterRATInformationContainerV");
single_value->field_eUTRANinterRATInformationContainerV.log_match(match_value.eUTRANinterRATInformationContainerV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", eUTRANinterRATInformationContainerV := ");
single_value->field_eUTRANinterRATInformationContainerV.log_match(match_value.eUTRANinterRATInformationContainerV(), 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 EUTRANinterRATInformationContainerTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_eUTRANinterRATInformationContainerV.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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
}
}

void EUTRANinterRATInformationContainerTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_eUTRANinterRATInformationContainerV.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 EUTRANinterRATInformationContainerTLV_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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV.");
}
}

void EUTRANinterRATInformationContainerTLV_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: {
    EUTRANinterRATInformationContainerTLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATInformationContainerV().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "eUTRANinterRATInformationContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATInformationContainerV().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 @MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    EUTRANinterRATInformationContainerTLV_template* precondition = new EUTRANinterRATInformationContainerTLV_template;
    precondition->set_param(*param.get_elem(0));
    EUTRANinterRATInformationContainerTLV_template* implied_template = new EUTRANinterRATInformationContainerTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = EUTRANinterRATInformationContainerTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void EUTRANinterRATInformationContainerTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
single_value->field_eUTRANinterRATInformationContainerV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
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 : "@MobileL3_GMM_SM_Types.EUTRANinterRATInformationContainerTLV");
}

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

boolean EUTRANinterRATInformationContainerTLV_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;
}

VDPaUEsUS__V::VDPaUEsUS__V()
{
}

VDPaUEsUS__V::VDPaUEsUS__V(const BITSTRING& par_voiceDomainPreferenceforEUTRAN,
    const BITSTRING& par_uEsUsageSetting,
    const BITSTRING& par_spare1,
    const BITSTRING& par_spare2,
    const BITSTRING& par_spare3,
    const BITSTRING& par_spare4,
    const BITSTRING& par_spare5)
  :   field_voiceDomainPreferenceforEUTRAN(par_voiceDomainPreferenceforEUTRAN),
  field_uEsUsageSetting(par_uEsUsageSetting),
  field_spare1(par_spare1),
  field_spare2(par_spare2),
  field_spare3(par_spare3),
  field_spare4(par_spare4),
  field_spare5(par_spare5)
{
}

VDPaUEsUS__V::VDPaUEsUS__V(const VDPaUEsUS__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
if (other_value.voiceDomainPreferenceforEUTRAN().is_bound()) field_voiceDomainPreferenceforEUTRAN = other_value.voiceDomainPreferenceforEUTRAN();
else field_voiceDomainPreferenceforEUTRAN.clean_up();
if (other_value.uEsUsageSetting().is_bound()) field_uEsUsageSetting = other_value.uEsUsageSetting();
else field_uEsUsageSetting.clean_up();
if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
else field_spare1.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
if (other_value.spare3().is_bound()) field_spare3 = other_value.spare3();
else field_spare3.clean_up();
if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
else field_spare4.clean_up();
if (other_value.spare5().is_bound()) field_spare5 = other_value.spare5();
else field_spare5.clean_up();
}

void VDPaUEsUS__V::clean_up()
{
field_voiceDomainPreferenceforEUTRAN.clean_up();
field_uEsUsageSetting.clean_up();
field_spare1.clean_up();
field_spare2.clean_up();
field_spare3.clean_up();
field_spare4.clean_up();
field_spare5.clean_up();
}

const TTCN_Typedescriptor_t* VDPaUEsUS__V::get_descriptor() const { return &VDPaUEsUS__V_descr_; }
VDPaUEsUS__V& VDPaUEsUS__V::operator=(const VDPaUEsUS__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
  if (other_value.voiceDomainPreferenceforEUTRAN().is_bound()) field_voiceDomainPreferenceforEUTRAN = other_value.voiceDomainPreferenceforEUTRAN();
  else field_voiceDomainPreferenceforEUTRAN.clean_up();
  if (other_value.uEsUsageSetting().is_bound()) field_uEsUsageSetting = other_value.uEsUsageSetting();
  else field_uEsUsageSetting.clean_up();
  if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
  else field_spare1.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
  if (other_value.spare3().is_bound()) field_spare3 = other_value.spare3();
  else field_spare3.clean_up();
  if (other_value.spare4().is_bound()) field_spare4 = other_value.spare4();
  else field_spare4.clean_up();
  if (other_value.spare5().is_bound()) field_spare5 = other_value.spare5();
  else field_spare5.clean_up();
}
return *this;
}

boolean VDPaUEsUS__V::operator==(const VDPaUEsUS__V& other_value) const
{
return field_voiceDomainPreferenceforEUTRAN==other_value.field_voiceDomainPreferenceforEUTRAN
  && field_uEsUsageSetting==other_value.field_uEsUsageSetting
  && field_spare1==other_value.field_spare1
  && field_spare2==other_value.field_spare2
  && field_spare3==other_value.field_spare3
  && field_spare4==other_value.field_spare4
  && field_spare5==other_value.field_spare5;
}

boolean VDPaUEsUS__V::is_bound() const
{
return (field_voiceDomainPreferenceforEUTRAN.is_bound())
  || (field_uEsUsageSetting.is_bound())
  || (field_spare1.is_bound())
  || (field_spare2.is_bound())
  || (field_spare3.is_bound())
  || (field_spare4.is_bound())
  || (field_spare5.is_bound());
}
boolean VDPaUEsUS__V::is_value() const
{
return field_voiceDomainPreferenceforEUTRAN.is_value()
  && field_uEsUsageSetting.is_value()
  && field_spare1.is_value()
  && field_spare2.is_value()
  && field_spare3.is_value()
  && field_spare4.is_value()
  && field_spare5.is_value();
}
void VDPaUEsUS__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ voiceDomainPreferenceforEUTRAN := ");
field_voiceDomainPreferenceforEUTRAN.log();
TTCN_Logger::log_event_str(", uEsUsageSetting := ");
field_uEsUsageSetting.log();
TTCN_Logger::log_event_str(", spare1 := ");
field_spare1.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(", spare3 := ");
field_spare3.log();
TTCN_Logger::log_event_str(", spare4 := ");
field_spare4.log();
TTCN_Logger::log_event_str(", spare5 := ");
field_spare5.log();
TTCN_Logger::log_event_str(" }");
}

void VDPaUEsUS__V::set_implicit_omit()
{
if (voiceDomainPreferenceforEUTRAN().is_bound()) voiceDomainPreferenceforEUTRAN().set_implicit_omit();
if (uEsUsageSetting().is_bound()) uEsUsageSetting().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (spare2().is_bound()) spare2().set_implicit_omit();
if (spare3().is_bound()) spare3().set_implicit_omit();
if (spare4().is_bound()) spare4().set_implicit_omit();
if (spare5().is_bound()) spare5().set_implicit_omit();
}

void VDPaUEsUS__V::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 (7<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V has 7 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) voiceDomainPreferenceforEUTRAN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uEsUsageSetting().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare5().set_param(*param.get_elem(6));
    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(), "voiceDomainPreferenceforEUTRAN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainPreferenceforEUTRAN().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(), "uEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uEsUsageSetting().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(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().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(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().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(), "spare3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3().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(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().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(), "spare5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5().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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
  }
}

void VDPaUEsUS__V::encode_text(Text_Buf& text_buf) const
{
field_voiceDomainPreferenceforEUTRAN.encode_text(text_buf);
field_uEsUsageSetting.encode_text(text_buf);
field_spare1.encode_text(text_buf);
field_spare2.encode_text(text_buf);
field_spare3.encode_text(text_buf);
field_spare4.encode_text(text_buf);
field_spare5.encode_text(text_buf);
}

void VDPaUEsUS__V::decode_text(Text_Buf& text_buf)
{
field_voiceDomainPreferenceforEUTRAN.decode_text(text_buf);
field_uEsUsageSetting.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_spare2.decode_text(text_buf);
field_spare3.decode_text(text_buf);
field_spare4.decode_text(text_buf);
field_spare5.decode_text(text_buf);
}

void VDPaUEsUS__V::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void VDPaUEsUS__V::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int VDPaUEsUS__V::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_voiceDomainPreferenceforEUTRAN.RAW_decode(General__Types::BIT2_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_uEsUsageSetting.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare2.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare3.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare4.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare5.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int VDPaUEsUS__V::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 = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  encoded_length += field_voiceDomainPreferenceforEUTRAN.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_uEsUsageSetting.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare2.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare3.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare4.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare5.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct VDPaUEsUS__V_template::single_value_struct {
BITSTRING_template field_voiceDomainPreferenceforEUTRAN;
BITSTRING_template field_uEsUsageSetting;
BITSTRING_template field_spare1;
BITSTRING_template field_spare2;
BITSTRING_template field_spare3;
BITSTRING_template field_spare4;
BITSTRING_template field_spare5;
};

void VDPaUEsUS__V_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_voiceDomainPreferenceforEUTRAN = ANY_VALUE;
single_value->field_uEsUsageSetting = ANY_VALUE;
single_value->field_spare1 = ANY_VALUE;
single_value->field_spare2 = ANY_VALUE;
single_value->field_spare3 = ANY_VALUE;
single_value->field_spare4 = ANY_VALUE;
single_value->field_spare5 = ANY_VALUE;
}
}
}

void VDPaUEsUS__V_template::copy_value(const VDPaUEsUS__V& other_value)
{
single_value = new single_value_struct;
if (other_value.voiceDomainPreferenceforEUTRAN().is_bound()) {
  single_value->field_voiceDomainPreferenceforEUTRAN = other_value.voiceDomainPreferenceforEUTRAN();
} else {
  single_value->field_voiceDomainPreferenceforEUTRAN.clean_up();
}
if (other_value.uEsUsageSetting().is_bound()) {
  single_value->field_uEsUsageSetting = other_value.uEsUsageSetting();
} else {
  single_value->field_uEsUsageSetting.clean_up();
}
if (other_value.spare1().is_bound()) {
  single_value->field_spare1 = other_value.spare1();
} else {
  single_value->field_spare1.clean_up();
}
if (other_value.spare2().is_bound()) {
  single_value->field_spare2 = other_value.spare2();
} else {
  single_value->field_spare2.clean_up();
}
if (other_value.spare3().is_bound()) {
  single_value->field_spare3 = other_value.spare3();
} else {
  single_value->field_spare3.clean_up();
}
if (other_value.spare4().is_bound()) {
  single_value->field_spare4 = other_value.spare4();
} else {
  single_value->field_spare4.clean_up();
}
if (other_value.spare5().is_bound()) {
  single_value->field_spare5 = other_value.spare5();
} else {
  single_value->field_spare5.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void VDPaUEsUS__V_template::copy_template(const VDPaUEsUS__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.voiceDomainPreferenceforEUTRAN().get_selection()) {
single_value->field_voiceDomainPreferenceforEUTRAN = other_value.voiceDomainPreferenceforEUTRAN();
} else {
single_value->field_voiceDomainPreferenceforEUTRAN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uEsUsageSetting().get_selection()) {
single_value->field_uEsUsageSetting = other_value.uEsUsageSetting();
} else {
single_value->field_uEsUsageSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1().get_selection()) {
single_value->field_spare1 = other_value.spare1();
} else {
single_value->field_spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2().get_selection()) {
single_value->field_spare2 = other_value.spare2();
} else {
single_value->field_spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare3().get_selection()) {
single_value->field_spare3 = other_value.spare3();
} else {
single_value->field_spare3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare4().get_selection()) {
single_value->field_spare4 = other_value.spare4();
} else {
single_value->field_spare4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare5().get_selection()) {
single_value->field_spare5 = other_value.spare5();
} else {
single_value->field_spare5.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 VDPaUEsUS__V_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 VDPaUEsUS__V_template(*other_value.implication_.precondition);
implication_.implied_template = new VDPaUEsUS__V_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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
break;
}
set_selection(other_value);
}

VDPaUEsUS__V_template::VDPaUEsUS__V_template()
{
}

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

VDPaUEsUS__V_template::VDPaUEsUS__V_template(const VDPaUEsUS__V& other_value)
{
copy_value(other_value);
}

VDPaUEsUS__V_template::VDPaUEsUS__V_template(const OPTIONAL<VDPaUEsUS__V>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const VDPaUEsUS__V&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V from an unbound optional field.");
}
}

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

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

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

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

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

VDPaUEsUS__V_template& VDPaUEsUS__V_template::operator=(const VDPaUEsUS__V& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

VDPaUEsUS__V_template& VDPaUEsUS__V_template::operator=(const OPTIONAL<VDPaUEsUS__V>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const VDPaUEsUS__V&)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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
}
return *this;
}

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

boolean VDPaUEsUS__V_template::match(const VDPaUEsUS__V& 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.voiceDomainPreferenceforEUTRAN().is_bound()) return FALSE;
if(!single_value->field_voiceDomainPreferenceforEUTRAN.match(other_value.voiceDomainPreferenceforEUTRAN(), legacy))return FALSE;
if(!other_value.uEsUsageSetting().is_bound()) return FALSE;
if(!single_value->field_uEsUsageSetting.match(other_value.uEsUsageSetting(), legacy))return FALSE;
if(!other_value.spare1().is_bound()) return FALSE;
if(!single_value->field_spare1.match(other_value.spare1(), legacy))return FALSE;
if(!other_value.spare2().is_bound()) return FALSE;
if(!single_value->field_spare2.match(other_value.spare2(), legacy))return FALSE;
if(!other_value.spare3().is_bound()) return FALSE;
if(!single_value->field_spare3.match(other_value.spare3(), legacy))return FALSE;
if(!other_value.spare4().is_bound()) return FALSE;
if(!single_value->field_spare4.match(other_value.spare4(), legacy))return FALSE;
if(!other_value.spare5().is_bound()) return FALSE;
if(!single_value->field_spare5.match(other_value.spare5(), 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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
}
return FALSE;
}

boolean VDPaUEsUS__V_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_voiceDomainPreferenceforEUTRAN.is_bound()
 || single_value->field_uEsUsageSetting.is_bound()
 || single_value->field_spare1.is_bound()
 || single_value->field_spare2.is_bound()
 || single_value->field_spare3.is_bound()
 || single_value->field_spare4.is_bound()
 || single_value->field_spare5.is_bound();
}

boolean VDPaUEsUS__V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_voiceDomainPreferenceforEUTRAN.is_value()
 && single_value->field_uEsUsageSetting.is_value()
 && single_value->field_spare1.is_value()
 && single_value->field_spare2.is_value()
 && single_value->field_spare3.is_value()
 && single_value->field_spare4.is_value()
 && single_value->field_spare5.is_value();
}

void VDPaUEsUS__V_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;
}

VDPaUEsUS__V VDPaUEsUS__V_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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
VDPaUEsUS__V ret_val;
if (single_value->field_voiceDomainPreferenceforEUTRAN.is_bound()) {
ret_val.voiceDomainPreferenceforEUTRAN() = single_value->field_voiceDomainPreferenceforEUTRAN.valueof();
}
if (single_value->field_uEsUsageSetting.is_bound()) {
ret_val.uEsUsageSetting() = single_value->field_uEsUsageSetting.valueof();
}
if (single_value->field_spare1.is_bound()) {
ret_val.spare1() = single_value->field_spare1.valueof();
}
if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
if (single_value->field_spare3.is_bound()) {
ret_val.spare3() = single_value->field_spare3.valueof();
}
if (single_value->field_spare4.is_bound()) {
ret_val.spare4() = single_value->field_spare4.valueof();
}
if (single_value->field_spare5.is_bound()) {
ret_val.spare5() = single_value->field_spare5.valueof();
}
return ret_val;
}

void VDPaUEsUS__V_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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new VDPaUEsUS__V_template[list_length];
}

VDPaUEsUS__V_template& VDPaUEsUS__V_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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return value_list.list_value[list_index];
}

BITSTRING_template& VDPaUEsUS__V_template::voiceDomainPreferenceforEUTRAN()
{
set_specific();
return single_value->field_voiceDomainPreferenceforEUTRAN;
}

const BITSTRING_template& VDPaUEsUS__V_template::voiceDomainPreferenceforEUTRAN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field voiceDomainPreferenceforEUTRAN of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_voiceDomainPreferenceforEUTRAN;
}

BITSTRING_template& VDPaUEsUS__V_template::uEsUsageSetting()
{
set_specific();
return single_value->field_uEsUsageSetting;
}

const BITSTRING_template& VDPaUEsUS__V_template::uEsUsageSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uEsUsageSetting of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_uEsUsageSetting;
}

BITSTRING_template& VDPaUEsUS__V_template::spare1()
{
set_specific();
return single_value->field_spare1;
}

const BITSTRING_template& VDPaUEsUS__V_template::spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1 of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_spare1;
}

BITSTRING_template& VDPaUEsUS__V_template::spare2()
{
set_specific();
return single_value->field_spare2;
}

const BITSTRING_template& VDPaUEsUS__V_template::spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2 of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_spare2;
}

BITSTRING_template& VDPaUEsUS__V_template::spare3()
{
set_specific();
return single_value->field_spare3;
}

const BITSTRING_template& VDPaUEsUS__V_template::spare3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare3 of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_spare3;
}

BITSTRING_template& VDPaUEsUS__V_template::spare4()
{
set_specific();
return single_value->field_spare4;
}

const BITSTRING_template& VDPaUEsUS__V_template::spare4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare4 of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_spare4;
}

BITSTRING_template& VDPaUEsUS__V_template::spare5()
{
set_specific();
return single_value->field_spare5;
}

const BITSTRING_template& VDPaUEsUS__V_template::spare5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare5 of a non-specific template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
return single_value->field_spare5;
}

int VDPaUEsUS__V_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 7;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V 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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
  }
  return 0;
}

void VDPaUEsUS__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ voiceDomainPreferenceforEUTRAN := ");
single_value->field_voiceDomainPreferenceforEUTRAN.log();
TTCN_Logger::log_event_str(", uEsUsageSetting := ");
single_value->field_uEsUsageSetting.log();
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log();
TTCN_Logger::log_event_str(", spare3 := ");
single_value->field_spare3.log();
TTCN_Logger::log_event_str(", spare4 := ");
single_value->field_spare4.log();
TTCN_Logger::log_event_str(", spare5 := ");
single_value->field_spare5.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 VDPaUEsUS__V_template::log_match(const VDPaUEsUS__V& 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_voiceDomainPreferenceforEUTRAN.match(match_value.voiceDomainPreferenceforEUTRAN(), legacy)){
TTCN_Logger::log_logmatch_info(".voiceDomainPreferenceforEUTRAN");
single_value->field_voiceDomainPreferenceforEUTRAN.log_match(match_value.voiceDomainPreferenceforEUTRAN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uEsUsageSetting.match(match_value.uEsUsageSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".uEsUsageSetting");
single_value->field_uEsUsageSetting.log_match(match_value.uEsUsageSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1.match(match_value.spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2.match(match_value.spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare3.match(match_value.spare3(), legacy)){
TTCN_Logger::log_logmatch_info(".spare3");
single_value->field_spare3.log_match(match_value.spare3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare4.match(match_value.spare4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare4");
single_value->field_spare4.log_match(match_value.spare4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare5.match(match_value.spare5(), legacy)){
TTCN_Logger::log_logmatch_info(".spare5");
single_value->field_spare5.log_match(match_value.spare5(), 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("{ voiceDomainPreferenceforEUTRAN := ");
single_value->field_voiceDomainPreferenceforEUTRAN.log_match(match_value.voiceDomainPreferenceforEUTRAN(), legacy);
TTCN_Logger::log_event_str(", uEsUsageSetting := ");
single_value->field_uEsUsageSetting.log_match(match_value.uEsUsageSetting(), legacy);
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::log_event_str(", spare3 := ");
single_value->field_spare3.log_match(match_value.spare3(), legacy);
TTCN_Logger::log_event_str(", spare4 := ");
single_value->field_spare4.log_match(match_value.spare4(), legacy);
TTCN_Logger::log_event_str(", spare5 := ");
single_value->field_spare5.log_match(match_value.spare5(), 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 VDPaUEsUS__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_voiceDomainPreferenceforEUTRAN.encode_text(text_buf);
single_value->field_uEsUsageSetting.encode_text(text_buf);
single_value->field_spare1.encode_text(text_buf);
single_value->field_spare2.encode_text(text_buf);
single_value->field_spare3.encode_text(text_buf);
single_value->field_spare4.encode_text(text_buf);
single_value->field_spare5.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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
}
}

void VDPaUEsUS__V_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_voiceDomainPreferenceforEUTRAN.decode_text(text_buf);
single_value->field_uEsUsageSetting.decode_text(text_buf);
single_value->field_spare1.decode_text(text_buf);
single_value->field_spare2.decode_text(text_buf);
single_value->field_spare3.decode_text(text_buf);
single_value->field_spare4.decode_text(text_buf);
single_value->field_spare5.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 VDPaUEsUS__V_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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V.");
}
}

void VDPaUEsUS__V_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: {
    VDPaUEsUS__V_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 (7<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.VDPaUEsUS_V has 7 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) voiceDomainPreferenceforEUTRAN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) uEsUsageSetting().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare5().set_param(*param.get_elem(6));
    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(), "voiceDomainPreferenceforEUTRAN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainPreferenceforEUTRAN().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(), "uEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uEsUsageSetting().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(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().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(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().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(), "spare3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3().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(), "spare4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare4().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(), "spare5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare5().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 @MobileL3_GMM_SM_Types.VDPaUEsUS_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    VDPaUEsUS__V_template* precondition = new VDPaUEsUS__V_template;
    precondition->set_param(*param.get_elem(0));
    VDPaUEsUS__V_template* implied_template = new VDPaUEsUS__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = VDPaUEsUS__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void VDPaUEsUS__V_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_voiceDomainPreferenceforEUTRAN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_uEsUsageSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_spare3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_spare4.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
single_value->field_spare5.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
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 : "@MobileL3_GMM_SM_Types.VDPaUEsUS_V");
}

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

boolean VDPaUEsUS__V_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;
}

VoiceDomainPreferenceandUEsUsageSettingTLV::VoiceDomainPreferenceandUEsUsageSettingTLV()
{
}

VoiceDomainPreferenceandUEsUsageSettingTLV::VoiceDomainPreferenceandUEsUsageSettingTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const VDPaUEsUS__V& par_informationElement)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_informationElement(par_informationElement)
{
}

VoiceDomainPreferenceandUEsUsageSettingTLV::VoiceDomainPreferenceandUEsUsageSettingTLV(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.informationElement().is_bound()) field_informationElement = other_value.informationElement();
else field_informationElement.clean_up();
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_informationElement.clean_up();
}

const TTCN_Typedescriptor_t* VoiceDomainPreferenceandUEsUsageSettingTLV::get_descriptor() const { return &VoiceDomainPreferenceandUEsUsageSettingTLV_descr_; }
VoiceDomainPreferenceandUEsUsageSettingTLV& VoiceDomainPreferenceandUEsUsageSettingTLV::operator=(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.informationElement().is_bound()) field_informationElement = other_value.informationElement();
  else field_informationElement.clean_up();
}
return *this;
}

boolean VoiceDomainPreferenceandUEsUsageSettingTLV::operator==(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_informationElement==other_value.field_informationElement;
}

boolean VoiceDomainPreferenceandUEsUsageSettingTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_informationElement.is_bound());
}
boolean VoiceDomainPreferenceandUEsUsageSettingTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_informationElement.is_value();
}
void VoiceDomainPreferenceandUEsUsageSettingTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", informationElement := ");
field_informationElement.log();
TTCN_Logger::log_event_str(" }");
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (informationElement().is_bound()) informationElement().set_implicit_omit();
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) informationElement().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "informationElement")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          informationElement().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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
  }
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_informationElement.encode_text(text_buf);
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_informationElement.decode_text(text_buf);
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void VoiceDomainPreferenceandUEsUsageSettingTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int VoiceDomainPreferenceandUEsUsageSettingTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, VoiceDomainPreferenceandUEsUsageSettingTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(VoiceDomainPreferenceandUEsUsageSettingTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(VoiceDomainPreferenceandUEsUsageSettingTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, VDPaUEsUS__V_descr_.raw->forceomit);
  decoded_field_length = field_informationElement.RAW_decode(VDPaUEsUS__V_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_10) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int VoiceDomainPreferenceandUEsUsageSettingTLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, VoiceDomainPreferenceandUEsUsageSettingTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, VDPaUEsUS__V_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &VoiceDomainPreferenceandUEsUsageSettingTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_informationElement.RAW_encode(VDPaUEsUS__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_10) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct VoiceDomainPreferenceandUEsUsageSettingTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
VDPaUEsUS__V_template field_informationElement;
};

void VoiceDomainPreferenceandUEsUsageSettingTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_informationElement = ANY_VALUE;
}
}
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_template::copy_value(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.informationElement().is_bound()) {
  single_value->field_informationElement = other_value.informationElement();
} else {
  single_value->field_informationElement.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_template::copy_template(const VoiceDomainPreferenceandUEsUsageSettingTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.informationElement().get_selection()) {
single_value->field_informationElement = other_value.informationElement();
} else {
single_value->field_informationElement.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 VoiceDomainPreferenceandUEsUsageSettingTLV_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 VoiceDomainPreferenceandUEsUsageSettingTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new VoiceDomainPreferenceandUEsUsageSettingTLV_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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
break;
}
set_selection(other_value);
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template::VoiceDomainPreferenceandUEsUsageSettingTLV_template()
{
}

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

VoiceDomainPreferenceandUEsUsageSettingTLV_template::VoiceDomainPreferenceandUEsUsageSettingTLV_template(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value)
{
copy_value(other_value);
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template::VoiceDomainPreferenceandUEsUsageSettingTLV_template(const OPTIONAL<VoiceDomainPreferenceandUEsUsageSettingTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const VoiceDomainPreferenceandUEsUsageSettingTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV from an unbound optional field.");
}
}

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

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

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

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

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

VoiceDomainPreferenceandUEsUsageSettingTLV_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::operator=(const VoiceDomainPreferenceandUEsUsageSettingTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::operator=(const OPTIONAL<VoiceDomainPreferenceandUEsUsageSettingTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const VoiceDomainPreferenceandUEsUsageSettingTLV&)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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
}
return *this;
}

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

boolean VoiceDomainPreferenceandUEsUsageSettingTLV_template::match(const VoiceDomainPreferenceandUEsUsageSettingTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.informationElement().is_bound()) return FALSE;
if(!single_value->field_informationElement.match(other_value.informationElement(), 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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
}
return FALSE;
}

boolean VoiceDomainPreferenceandUEsUsageSettingTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_informationElement.is_bound();
}

boolean VoiceDomainPreferenceandUEsUsageSettingTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_informationElement.is_value();
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_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;
}

VoiceDomainPreferenceandUEsUsageSettingTLV VoiceDomainPreferenceandUEsUsageSettingTLV_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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
VoiceDomainPreferenceandUEsUsageSettingTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_informationElement.is_bound()) {
ret_val.informationElement() = single_value->field_informationElement.valueof();
}
return ret_val;
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new VoiceDomainPreferenceandUEsUsageSettingTLV_template[list_length];
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& VoiceDomainPreferenceandUEsUsageSettingTLV_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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
return single_value->field_lengthIndicator;
}

VDPaUEsUS__V_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::informationElement()
{
set_specific();
return single_value->field_informationElement;
}

const VDPaUEsUS__V_template& VoiceDomainPreferenceandUEsUsageSettingTLV_template::informationElement() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field informationElement of a non-specific template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
return single_value->field_informationElement;
}

int VoiceDomainPreferenceandUEsUsageSettingTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV 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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
  }
  return 0;
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", informationElement := ");
single_value->field_informationElement.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 VoiceDomainPreferenceandUEsUsageSettingTLV_template::log_match(const VoiceDomainPreferenceandUEsUsageSettingTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_informationElement.match(match_value.informationElement(), legacy)){
TTCN_Logger::log_logmatch_info(".informationElement");
single_value->field_informationElement.log_match(match_value.informationElement(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", informationElement := ");
single_value->field_informationElement.log_match(match_value.informationElement(), 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 VoiceDomainPreferenceandUEsUsageSettingTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_informationElement.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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
}
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_informationElement.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 VoiceDomainPreferenceandUEsUsageSettingTLV_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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV.");
}
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_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: {
    VoiceDomainPreferenceandUEsUsageSettingTLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) informationElement().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "informationElement")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          informationElement().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 @MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    VoiceDomainPreferenceandUEsUsageSettingTLV_template* precondition = new VoiceDomainPreferenceandUEsUsageSettingTLV_template;
    precondition->set_param(*param.get_elem(0));
    VoiceDomainPreferenceandUEsUsageSettingTLV_template* implied_template = new VoiceDomainPreferenceandUEsUsageSettingTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = VoiceDomainPreferenceandUEsUsageSettingTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void VoiceDomainPreferenceandUEsUsageSettingTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
single_value->field_informationElement.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
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 : "@MobileL3_GMM_SM_Types.VoiceDomainPreferenceandUEsUsageSettingTLV");
}

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

boolean VoiceDomainPreferenceandUEsUsageSettingTLV_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;
}

LocationAreaIdentification2__TLV::LocationAreaIdentification2__TLV()
{
}

LocationAreaIdentification2__TLV::LocationAreaIdentification2__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_locationAreaIdentificationValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_locationAreaIdentificationValue(par_locationAreaIdentificationValue)
{
}

LocationAreaIdentification2__TLV::LocationAreaIdentification2__TLV(const LocationAreaIdentification2__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.locationAreaIdentificationValue().is_bound()) field_locationAreaIdentificationValue = other_value.locationAreaIdentificationValue();
else field_locationAreaIdentificationValue.clean_up();
}

void LocationAreaIdentification2__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_locationAreaIdentificationValue.clean_up();
}

const TTCN_Typedescriptor_t* LocationAreaIdentification2__TLV::get_descriptor() const { return &LocationAreaIdentification2__TLV_descr_; }
LocationAreaIdentification2__TLV& LocationAreaIdentification2__TLV::operator=(const LocationAreaIdentification2__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.locationAreaIdentificationValue().is_bound()) field_locationAreaIdentificationValue = other_value.locationAreaIdentificationValue();
  else field_locationAreaIdentificationValue.clean_up();
}
return *this;
}

boolean LocationAreaIdentification2__TLV::operator==(const LocationAreaIdentification2__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_locationAreaIdentificationValue==other_value.field_locationAreaIdentificationValue;
}

boolean LocationAreaIdentification2__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_locationAreaIdentificationValue.is_bound());
}
boolean LocationAreaIdentification2__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_locationAreaIdentificationValue.is_value();
}
void LocationAreaIdentification2__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", locationAreaIdentificationValue := ");
field_locationAreaIdentificationValue.log();
TTCN_Logger::log_event_str(" }");
}

void LocationAreaIdentification2__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (locationAreaIdentificationValue().is_bound()) locationAreaIdentificationValue().set_implicit_omit();
}

void LocationAreaIdentification2__TLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentificationValue().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "locationAreaIdentificationValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentificationValue().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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
  }
}

void LocationAreaIdentification2__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_locationAreaIdentificationValue.encode_text(text_buf);
}

void LocationAreaIdentification2__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_locationAreaIdentificationValue.decode_text(text_buf);
}

void LocationAreaIdentification2__TLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void LocationAreaIdentification2__TLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int LocationAreaIdentification2__TLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, LocationAreaIdentification2__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(LocationAreaIdentification2__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(LocationAreaIdentification2__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT5_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentificationValue.RAW_decode(General__Types::OCT5_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_11) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int LocationAreaIdentification2__TLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, LocationAreaIdentification2__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT5_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &LocationAreaIdentification2__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_locationAreaIdentificationValue.RAW_encode(General__Types::OCT5_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_11) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_11.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct LocationAreaIdentification2__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_locationAreaIdentificationValue;
};

void LocationAreaIdentification2__TLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_locationAreaIdentificationValue = ANY_VALUE;
}
}
}

void LocationAreaIdentification2__TLV_template::copy_value(const LocationAreaIdentification2__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.locationAreaIdentificationValue().is_bound()) {
  single_value->field_locationAreaIdentificationValue = other_value.locationAreaIdentificationValue();
} else {
  single_value->field_locationAreaIdentificationValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LocationAreaIdentification2__TLV_template::copy_template(const LocationAreaIdentification2__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationAreaIdentificationValue().get_selection()) {
single_value->field_locationAreaIdentificationValue = other_value.locationAreaIdentificationValue();
} else {
single_value->field_locationAreaIdentificationValue.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 LocationAreaIdentification2__TLV_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 LocationAreaIdentification2__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new LocationAreaIdentification2__TLV_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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
break;
}
set_selection(other_value);
}

LocationAreaIdentification2__TLV_template::LocationAreaIdentification2__TLV_template()
{
}

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

LocationAreaIdentification2__TLV_template::LocationAreaIdentification2__TLV_template(const LocationAreaIdentification2__TLV& other_value)
{
copy_value(other_value);
}

LocationAreaIdentification2__TLV_template::LocationAreaIdentification2__TLV_template(const OPTIONAL<LocationAreaIdentification2__TLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const LocationAreaIdentification2__TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV from an unbound optional field.");
}
}

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

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

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

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

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

LocationAreaIdentification2__TLV_template& LocationAreaIdentification2__TLV_template::operator=(const LocationAreaIdentification2__TLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

LocationAreaIdentification2__TLV_template& LocationAreaIdentification2__TLV_template::operator=(const OPTIONAL<LocationAreaIdentification2__TLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const LocationAreaIdentification2__TLV&)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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
}
return *this;
}

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

boolean LocationAreaIdentification2__TLV_template::match(const LocationAreaIdentification2__TLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.locationAreaIdentificationValue().is_bound()) return FALSE;
if(!single_value->field_locationAreaIdentificationValue.match(other_value.locationAreaIdentificationValue(), 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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
}
return FALSE;
}

boolean LocationAreaIdentification2__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_locationAreaIdentificationValue.is_bound();
}

boolean LocationAreaIdentification2__TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_locationAreaIdentificationValue.is_value();
}

void LocationAreaIdentification2__TLV_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;
}

LocationAreaIdentification2__TLV LocationAreaIdentification2__TLV_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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
LocationAreaIdentification2__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_locationAreaIdentificationValue.is_bound()) {
ret_val.locationAreaIdentificationValue() = single_value->field_locationAreaIdentificationValue.valueof();
}
return ret_val;
}

void LocationAreaIdentification2__TLV_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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LocationAreaIdentification2__TLV_template[list_length];
}

LocationAreaIdentification2__TLV_template& LocationAreaIdentification2__TLV_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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& LocationAreaIdentification2__TLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& LocationAreaIdentification2__TLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& LocationAreaIdentification2__TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& LocationAreaIdentification2__TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& LocationAreaIdentification2__TLV_template::locationAreaIdentificationValue()
{
set_specific();
return single_value->field_locationAreaIdentificationValue;
}

const OCTETSTRING_template& LocationAreaIdentification2__TLV_template::locationAreaIdentificationValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentificationValue of a non-specific template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
return single_value->field_locationAreaIdentificationValue;
}

int LocationAreaIdentification2__TLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV 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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
  }
  return 0;
}

void LocationAreaIdentification2__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", locationAreaIdentificationValue := ");
single_value->field_locationAreaIdentificationValue.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 LocationAreaIdentification2__TLV_template::log_match(const LocationAreaIdentification2__TLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_locationAreaIdentificationValue.match(match_value.locationAreaIdentificationValue(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentificationValue");
single_value->field_locationAreaIdentificationValue.log_match(match_value.locationAreaIdentificationValue(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentificationValue := ");
single_value->field_locationAreaIdentificationValue.log_match(match_value.locationAreaIdentificationValue(), 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 LocationAreaIdentification2__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_locationAreaIdentificationValue.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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
}
}

void LocationAreaIdentification2__TLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_locationAreaIdentificationValue.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 LocationAreaIdentification2__TLV_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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV.");
}
}

void LocationAreaIdentification2__TLV_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: {
    LocationAreaIdentification2__TLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentificationValue().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "locationAreaIdentificationValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentificationValue().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 @MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LocationAreaIdentification2__TLV_template* precondition = new LocationAreaIdentification2__TLV_template;
    precondition->set_param(*param.get_elem(0));
    LocationAreaIdentification2__TLV_template* implied_template = new LocationAreaIdentification2__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LocationAreaIdentification2__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void LocationAreaIdentification2__TLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
single_value->field_locationAreaIdentificationValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
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 : "@MobileL3_GMM_SM_Types.LocationAreaIdentification2_TLV");
}

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

boolean LocationAreaIdentification2__TLV_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;
}

NetworkResourceIdentifierContainerV::NetworkResourceIdentifierContainerV()
{
}

NetworkResourceIdentifierContainerV::NetworkResourceIdentifierContainerV(const BITSTRING& par_nRIContainerValue,
    const BITSTRING& par_spare)
  :   field_nRIContainerValue(par_nRIContainerValue),
  field_spare(par_spare)
{
}

NetworkResourceIdentifierContainerV::NetworkResourceIdentifierContainerV(const NetworkResourceIdentifierContainerV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
if (other_value.nRIContainerValue().is_bound()) field_nRIContainerValue = other_value.nRIContainerValue();
else field_nRIContainerValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void NetworkResourceIdentifierContainerV::clean_up()
{
field_nRIContainerValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* NetworkResourceIdentifierContainerV::get_descriptor() const { return &NetworkResourceIdentifierContainerV_descr_; }
NetworkResourceIdentifierContainerV& NetworkResourceIdentifierContainerV::operator=(const NetworkResourceIdentifierContainerV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
  if (other_value.nRIContainerValue().is_bound()) field_nRIContainerValue = other_value.nRIContainerValue();
  else field_nRIContainerValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean NetworkResourceIdentifierContainerV::operator==(const NetworkResourceIdentifierContainerV& other_value) const
{
return field_nRIContainerValue==other_value.field_nRIContainerValue
  && field_spare==other_value.field_spare;
}

boolean NetworkResourceIdentifierContainerV::is_bound() const
{
return (field_nRIContainerValue.is_bound())
  || (field_spare.is_bound());
}
boolean NetworkResourceIdentifierContainerV::is_value() const
{
return field_nRIContainerValue.is_value()
  && field_spare.is_value();
}
void NetworkResourceIdentifierContainerV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ nRIContainerValue := ");
field_nRIContainerValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkResourceIdentifierContainerV::set_implicit_omit()
{
if (nRIContainerValue().is_bound()) nRIContainerValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void NetworkResourceIdentifierContainerV::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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV 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) nRIContainerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "nRIContainerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nRIContainerValue().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV");
  }
}

void NetworkResourceIdentifierContainerV::encode_text(Text_Buf& text_buf) const
{
field_nRIContainerValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void NetworkResourceIdentifierContainerV::decode_text(Text_Buf& text_buf)
{
field_nRIContainerValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void NetworkResourceIdentifierContainerV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void NetworkResourceIdentifierContainerV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int NetworkResourceIdentifierContainerV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, NetworkResourceIdentifierContainerV_nRIContainerValue_descr_.raw->forceomit);
  decoded_field_length = field_nRIContainerValue.RAW_decode(NetworkResourceIdentifierContainerV_nRIContainerValue_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, NetworkResourceIdentifierContainerV_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(NetworkResourceIdentifierContainerV_spare_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkResourceIdentifierContainerV::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, NetworkResourceIdentifierContainerV_nRIContainerValue_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, NetworkResourceIdentifierContainerV_spare_descr_.raw);
  encoded_length += field_nRIContainerValue.RAW_encode(NetworkResourceIdentifierContainerV_nRIContainerValue_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(NetworkResourceIdentifierContainerV_spare_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct NetworkResourceIdentifierContainerV_template::single_value_struct {
BITSTRING_template field_nRIContainerValue;
BITSTRING_template field_spare;
};

void NetworkResourceIdentifierContainerV_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_nRIContainerValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void NetworkResourceIdentifierContainerV_template::copy_value(const NetworkResourceIdentifierContainerV& other_value)
{
single_value = new single_value_struct;
if (other_value.nRIContainerValue().is_bound()) {
  single_value->field_nRIContainerValue = other_value.nRIContainerValue();
} else {
  single_value->field_nRIContainerValue.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkResourceIdentifierContainerV_template::copy_template(const NetworkResourceIdentifierContainerV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.nRIContainerValue().get_selection()) {
single_value->field_nRIContainerValue = other_value.nRIContainerValue();
} else {
single_value->field_nRIContainerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.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 NetworkResourceIdentifierContainerV_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 NetworkResourceIdentifierContainerV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
break;
}
set_selection(other_value);
}

NetworkResourceIdentifierContainerV_template::NetworkResourceIdentifierContainerV_template()
{
}

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

NetworkResourceIdentifierContainerV_template::NetworkResourceIdentifierContainerV_template(const NetworkResourceIdentifierContainerV& other_value)
{
copy_value(other_value);
}

NetworkResourceIdentifierContainerV_template::NetworkResourceIdentifierContainerV_template(const OPTIONAL<NetworkResourceIdentifierContainerV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV from an unbound optional field.");
}
}

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

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

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

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

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

NetworkResourceIdentifierContainerV_template& NetworkResourceIdentifierContainerV_template::operator=(const NetworkResourceIdentifierContainerV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NetworkResourceIdentifierContainerV_template& NetworkResourceIdentifierContainerV_template::operator=(const OPTIONAL<NetworkResourceIdentifierContainerV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerV&)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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
}
return *this;
}

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

boolean NetworkResourceIdentifierContainerV_template::match(const NetworkResourceIdentifierContainerV& 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.nRIContainerValue().is_bound()) return FALSE;
if(!single_value->field_nRIContainerValue.match(other_value.nRIContainerValue(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
}
return FALSE;
}

boolean NetworkResourceIdentifierContainerV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_nRIContainerValue.is_bound()
 || single_value->field_spare.is_bound();
}

boolean NetworkResourceIdentifierContainerV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_nRIContainerValue.is_value()
 && single_value->field_spare.is_value();
}

void NetworkResourceIdentifierContainerV_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;
}

NetworkResourceIdentifierContainerV NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
NetworkResourceIdentifierContainerV ret_val;
if (single_value->field_nRIContainerValue.is_bound()) {
ret_val.nRIContainerValue() = single_value->field_nRIContainerValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkResourceIdentifierContainerV_template[list_length];
}

NetworkResourceIdentifierContainerV_template& NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
return value_list.list_value[list_index];
}

BITSTRING_template& NetworkResourceIdentifierContainerV_template::nRIContainerValue()
{
set_specific();
return single_value->field_nRIContainerValue;
}

const BITSTRING_template& NetworkResourceIdentifierContainerV_template::nRIContainerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nRIContainerValue of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
return single_value->field_nRIContainerValue;
}

BITSTRING_template& NetworkResourceIdentifierContainerV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& NetworkResourceIdentifierContainerV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
return single_value->field_spare;
}

int NetworkResourceIdentifierContainerV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
  }
  return 0;
}

void NetworkResourceIdentifierContainerV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ nRIContainerValue := ");
single_value->field_nRIContainerValue.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.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 NetworkResourceIdentifierContainerV_template::log_match(const NetworkResourceIdentifierContainerV& 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_nRIContainerValue.match(match_value.nRIContainerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".nRIContainerValue");
single_value->field_nRIContainerValue.log_match(match_value.nRIContainerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), 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("{ nRIContainerValue := ");
single_value->field_nRIContainerValue.log_match(match_value.nRIContainerValue(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), 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 NetworkResourceIdentifierContainerV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_nRIContainerValue.encode_text(text_buf);
single_value->field_spare.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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
}
}

void NetworkResourceIdentifierContainerV_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_nRIContainerValue.decode_text(text_buf);
single_value->field_spare.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 NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV.");
}
}

void NetworkResourceIdentifierContainerV_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: {
    NetworkResourceIdentifierContainerV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV 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) nRIContainerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "nRIContainerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nRIContainerValue().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(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkResourceIdentifierContainerV_template* precondition = new NetworkResourceIdentifierContainerV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkResourceIdentifierContainerV_template* implied_template = new NetworkResourceIdentifierContainerV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkResourceIdentifierContainerV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkResourceIdentifierContainerV_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_nRIContainerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV");
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 : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerV");
}

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

boolean NetworkResourceIdentifierContainerV_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;
}

NetworkResourceIdentifierContainerLV::NetworkResourceIdentifierContainerLV()
{
}

NetworkResourceIdentifierContainerLV::NetworkResourceIdentifierContainerLV(const INTEGER& par_lengthIndicator,
    const NetworkResourceIdentifierContainerV& par_networkResourceIdentifierContainerV)
  :   field_lengthIndicator(par_lengthIndicator),
  field_networkResourceIdentifierContainerV(par_networkResourceIdentifierContainerV)
{
}

NetworkResourceIdentifierContainerLV::NetworkResourceIdentifierContainerLV(const NetworkResourceIdentifierContainerLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.networkResourceIdentifierContainerV().is_bound()) field_networkResourceIdentifierContainerV = other_value.networkResourceIdentifierContainerV();
else field_networkResourceIdentifierContainerV.clean_up();
}

void NetworkResourceIdentifierContainerLV::clean_up()
{
field_lengthIndicator.clean_up();
field_networkResourceIdentifierContainerV.clean_up();
}

const TTCN_Typedescriptor_t* NetworkResourceIdentifierContainerLV::get_descriptor() const { return &NetworkResourceIdentifierContainerLV_descr_; }
NetworkResourceIdentifierContainerLV& NetworkResourceIdentifierContainerLV::operator=(const NetworkResourceIdentifierContainerLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.networkResourceIdentifierContainerV().is_bound()) field_networkResourceIdentifierContainerV = other_value.networkResourceIdentifierContainerV();
  else field_networkResourceIdentifierContainerV.clean_up();
}
return *this;
}

boolean NetworkResourceIdentifierContainerLV::operator==(const NetworkResourceIdentifierContainerLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_networkResourceIdentifierContainerV==other_value.field_networkResourceIdentifierContainerV;
}

boolean NetworkResourceIdentifierContainerLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_networkResourceIdentifierContainerV.is_bound());
}
boolean NetworkResourceIdentifierContainerLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_networkResourceIdentifierContainerV.is_value();
}
void NetworkResourceIdentifierContainerLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerV := ");
field_networkResourceIdentifierContainerV.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkResourceIdentifierContainerLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (networkResourceIdentifierContainerV().is_bound()) networkResourceIdentifierContainerV().set_implicit_omit();
}

void NetworkResourceIdentifierContainerLV::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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) networkResourceIdentifierContainerV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "networkResourceIdentifierContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkResourceIdentifierContainerV().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV");
  }
}

void NetworkResourceIdentifierContainerLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_networkResourceIdentifierContainerV.encode_text(text_buf);
}

void NetworkResourceIdentifierContainerLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_networkResourceIdentifierContainerV.decode_text(text_buf);
}

void NetworkResourceIdentifierContainerLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void NetworkResourceIdentifierContainerLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int NetworkResourceIdentifierContainerLV::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;
  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, NetworkResourceIdentifierContainerLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NetworkResourceIdentifierContainerLV_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(NetworkResourceIdentifierContainerLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, NetworkResourceIdentifierContainerV_descr_.raw->forceomit);
  decoded_field_length = field_networkResourceIdentifierContainerV.RAW_decode(NetworkResourceIdentifierContainerV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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 NetworkResourceIdentifierContainerLV::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, NetworkResourceIdentifierContainerLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, NetworkResourceIdentifierContainerV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &NetworkResourceIdentifierContainerLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_networkResourceIdentifierContainerV.RAW_encode(NetworkResourceIdentifierContainerV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct NetworkResourceIdentifierContainerLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
NetworkResourceIdentifierContainerV_template field_networkResourceIdentifierContainerV;
};

void NetworkResourceIdentifierContainerLV_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_lengthIndicator = ANY_VALUE;
single_value->field_networkResourceIdentifierContainerV = ANY_VALUE;
}
}
}

void NetworkResourceIdentifierContainerLV_template::copy_value(const NetworkResourceIdentifierContainerLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.networkResourceIdentifierContainerV().is_bound()) {
  single_value->field_networkResourceIdentifierContainerV = other_value.networkResourceIdentifierContainerV();
} else {
  single_value->field_networkResourceIdentifierContainerV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkResourceIdentifierContainerLV_template::copy_template(const NetworkResourceIdentifierContainerLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkResourceIdentifierContainerV().get_selection()) {
single_value->field_networkResourceIdentifierContainerV = other_value.networkResourceIdentifierContainerV();
} else {
single_value->field_networkResourceIdentifierContainerV.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 NetworkResourceIdentifierContainerLV_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 NetworkResourceIdentifierContainerLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
break;
}
set_selection(other_value);
}

NetworkResourceIdentifierContainerLV_template::NetworkResourceIdentifierContainerLV_template()
{
}

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

NetworkResourceIdentifierContainerLV_template::NetworkResourceIdentifierContainerLV_template(const NetworkResourceIdentifierContainerLV& other_value)
{
copy_value(other_value);
}

NetworkResourceIdentifierContainerLV_template::NetworkResourceIdentifierContainerLV_template(const OPTIONAL<NetworkResourceIdentifierContainerLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV from an unbound optional field.");
}
}

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

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

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

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

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

NetworkResourceIdentifierContainerLV_template& NetworkResourceIdentifierContainerLV_template::operator=(const NetworkResourceIdentifierContainerLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NetworkResourceIdentifierContainerLV_template& NetworkResourceIdentifierContainerLV_template::operator=(const OPTIONAL<NetworkResourceIdentifierContainerLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerLV&)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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
}
return *this;
}

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

boolean NetworkResourceIdentifierContainerLV_template::match(const NetworkResourceIdentifierContainerLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.networkResourceIdentifierContainerV().is_bound()) return FALSE;
if(!single_value->field_networkResourceIdentifierContainerV.match(other_value.networkResourceIdentifierContainerV(), 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
}
return FALSE;
}

boolean NetworkResourceIdentifierContainerLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_networkResourceIdentifierContainerV.is_bound();
}

boolean NetworkResourceIdentifierContainerLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_networkResourceIdentifierContainerV.is_value();
}

void NetworkResourceIdentifierContainerLV_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;
}

NetworkResourceIdentifierContainerLV NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
NetworkResourceIdentifierContainerLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_networkResourceIdentifierContainerV.is_bound()) {
ret_val.networkResourceIdentifierContainerV() = single_value->field_networkResourceIdentifierContainerV.valueof();
}
return ret_val;
}

void NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkResourceIdentifierContainerLV_template[list_length];
}

NetworkResourceIdentifierContainerLV_template& NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
return value_list.list_value[list_index];
}

INTEGER_template& NetworkResourceIdentifierContainerLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NetworkResourceIdentifierContainerLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
return single_value->field_lengthIndicator;
}

NetworkResourceIdentifierContainerV_template& NetworkResourceIdentifierContainerLV_template::networkResourceIdentifierContainerV()
{
set_specific();
return single_value->field_networkResourceIdentifierContainerV;
}

const NetworkResourceIdentifierContainerV_template& NetworkResourceIdentifierContainerLV_template::networkResourceIdentifierContainerV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkResourceIdentifierContainerV of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
return single_value->field_networkResourceIdentifierContainerV;
}

int NetworkResourceIdentifierContainerLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
  }
  return 0;
}

void NetworkResourceIdentifierContainerLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerV := ");
single_value->field_networkResourceIdentifierContainerV.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 NetworkResourceIdentifierContainerLV_template::log_match(const NetworkResourceIdentifierContainerLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_networkResourceIdentifierContainerV.match(match_value.networkResourceIdentifierContainerV(), legacy)){
TTCN_Logger::log_logmatch_info(".networkResourceIdentifierContainerV");
single_value->field_networkResourceIdentifierContainerV.log_match(match_value.networkResourceIdentifierContainerV(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerV := ");
single_value->field_networkResourceIdentifierContainerV.log_match(match_value.networkResourceIdentifierContainerV(), 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 NetworkResourceIdentifierContainerLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_networkResourceIdentifierContainerV.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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
}
}

void NetworkResourceIdentifierContainerLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_networkResourceIdentifierContainerV.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 NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV.");
}
}

void NetworkResourceIdentifierContainerLV_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: {
    NetworkResourceIdentifierContainerLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) networkResourceIdentifierContainerV().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "networkResourceIdentifierContainerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkResourceIdentifierContainerV().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkResourceIdentifierContainerLV_template* precondition = new NetworkResourceIdentifierContainerLV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkResourceIdentifierContainerLV_template* implied_template = new NetworkResourceIdentifierContainerLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkResourceIdentifierContainerLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkResourceIdentifierContainerLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV");
single_value->field_networkResourceIdentifierContainerV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV");
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 : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerLV");
}

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

boolean NetworkResourceIdentifierContainerLV_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;
}

NetworkResourceIdentifierContainerTLV::NetworkResourceIdentifierContainerTLV()
{
}

NetworkResourceIdentifierContainerTLV::NetworkResourceIdentifierContainerTLV(const OCTETSTRING& par_elementIdentifier,
    const NetworkResourceIdentifierContainerLV& par_networkResourceIdentifierContainerLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_networkResourceIdentifierContainerLV(par_networkResourceIdentifierContainerLV)
{
}

NetworkResourceIdentifierContainerTLV::NetworkResourceIdentifierContainerTLV(const NetworkResourceIdentifierContainerTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.networkResourceIdentifierContainerLV().is_bound()) field_networkResourceIdentifierContainerLV = other_value.networkResourceIdentifierContainerLV();
else field_networkResourceIdentifierContainerLV.clean_up();
}

void NetworkResourceIdentifierContainerTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_networkResourceIdentifierContainerLV.clean_up();
}

const TTCN_Typedescriptor_t* NetworkResourceIdentifierContainerTLV::get_descriptor() const { return &NetworkResourceIdentifierContainerTLV_descr_; }
NetworkResourceIdentifierContainerTLV& NetworkResourceIdentifierContainerTLV::operator=(const NetworkResourceIdentifierContainerTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.networkResourceIdentifierContainerLV().is_bound()) field_networkResourceIdentifierContainerLV = other_value.networkResourceIdentifierContainerLV();
  else field_networkResourceIdentifierContainerLV.clean_up();
}
return *this;
}

boolean NetworkResourceIdentifierContainerTLV::operator==(const NetworkResourceIdentifierContainerTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_networkResourceIdentifierContainerLV==other_value.field_networkResourceIdentifierContainerLV;
}

boolean NetworkResourceIdentifierContainerTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_networkResourceIdentifierContainerLV.is_bound());
}
boolean NetworkResourceIdentifierContainerTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_networkResourceIdentifierContainerLV.is_value();
}
void NetworkResourceIdentifierContainerTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerLV := ");
field_networkResourceIdentifierContainerLV.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkResourceIdentifierContainerTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (networkResourceIdentifierContainerLV().is_bound()) networkResourceIdentifierContainerLV().set_implicit_omit();
}

void NetworkResourceIdentifierContainerTLV::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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) networkResourceIdentifierContainerLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "networkResourceIdentifierContainerLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkResourceIdentifierContainerLV().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV");
  }
}

void NetworkResourceIdentifierContainerTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_networkResourceIdentifierContainerLV.encode_text(text_buf);
}

void NetworkResourceIdentifierContainerTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_networkResourceIdentifierContainerLV.decode_text(text_buf);
}

void NetworkResourceIdentifierContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void NetworkResourceIdentifierContainerTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int NetworkResourceIdentifierContainerTLV::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;
  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;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, NetworkResourceIdentifierContainerLV_descr_.raw->forceomit);
  decoded_field_length = field_networkResourceIdentifierContainerLV.RAW_decode(NetworkResourceIdentifierContainerLV_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  if (field_elementIdentifier !=  os_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkResourceIdentifierContainerTLV::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, NetworkResourceIdentifierContainerLV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_networkResourceIdentifierContainerLV.RAW_encode(NetworkResourceIdentifierContainerLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_12) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_12.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct NetworkResourceIdentifierContainerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
NetworkResourceIdentifierContainerLV_template field_networkResourceIdentifierContainerLV;
};

void NetworkResourceIdentifierContainerTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_networkResourceIdentifierContainerLV = ANY_VALUE;
}
}
}

void NetworkResourceIdentifierContainerTLV_template::copy_value(const NetworkResourceIdentifierContainerTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.networkResourceIdentifierContainerLV().is_bound()) {
  single_value->field_networkResourceIdentifierContainerLV = other_value.networkResourceIdentifierContainerLV();
} else {
  single_value->field_networkResourceIdentifierContainerLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkResourceIdentifierContainerTLV_template::copy_template(const NetworkResourceIdentifierContainerTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkResourceIdentifierContainerLV().get_selection()) {
single_value->field_networkResourceIdentifierContainerLV = other_value.networkResourceIdentifierContainerLV();
} else {
single_value->field_networkResourceIdentifierContainerLV.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 NetworkResourceIdentifierContainerTLV_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 NetworkResourceIdentifierContainerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
break;
}
set_selection(other_value);
}

NetworkResourceIdentifierContainerTLV_template::NetworkResourceIdentifierContainerTLV_template()
{
}

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

NetworkResourceIdentifierContainerTLV_template::NetworkResourceIdentifierContainerTLV_template(const NetworkResourceIdentifierContainerTLV& other_value)
{
copy_value(other_value);
}

NetworkResourceIdentifierContainerTLV_template::NetworkResourceIdentifierContainerTLV_template(const OPTIONAL<NetworkResourceIdentifierContainerTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV from an unbound optional field.");
}
}

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

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

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

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

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

NetworkResourceIdentifierContainerTLV_template& NetworkResourceIdentifierContainerTLV_template::operator=(const NetworkResourceIdentifierContainerTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NetworkResourceIdentifierContainerTLV_template& NetworkResourceIdentifierContainerTLV_template::operator=(const OPTIONAL<NetworkResourceIdentifierContainerTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NetworkResourceIdentifierContainerTLV&)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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
}
return *this;
}

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

boolean NetworkResourceIdentifierContainerTLV_template::match(const NetworkResourceIdentifierContainerTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.networkResourceIdentifierContainerLV().is_bound()) return FALSE;
if(!single_value->field_networkResourceIdentifierContainerLV.match(other_value.networkResourceIdentifierContainerLV(), 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
}
return FALSE;
}

boolean NetworkResourceIdentifierContainerTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_networkResourceIdentifierContainerLV.is_bound();
}

boolean NetworkResourceIdentifierContainerTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_networkResourceIdentifierContainerLV.is_value();
}

void NetworkResourceIdentifierContainerTLV_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;
}

NetworkResourceIdentifierContainerTLV NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
NetworkResourceIdentifierContainerTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_networkResourceIdentifierContainerLV.is_bound()) {
ret_val.networkResourceIdentifierContainerLV() = single_value->field_networkResourceIdentifierContainerLV.valueof();
}
return ret_val;
}

void NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkResourceIdentifierContainerTLV_template[list_length];
}

NetworkResourceIdentifierContainerTLV_template& NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& NetworkResourceIdentifierContainerTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& NetworkResourceIdentifierContainerTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
return single_value->field_elementIdentifier;
}

NetworkResourceIdentifierContainerLV_template& NetworkResourceIdentifierContainerTLV_template::networkResourceIdentifierContainerLV()
{
set_specific();
return single_value->field_networkResourceIdentifierContainerLV;
}

const NetworkResourceIdentifierContainerLV_template& NetworkResourceIdentifierContainerTLV_template::networkResourceIdentifierContainerLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkResourceIdentifierContainerLV of a non-specific template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
return single_value->field_networkResourceIdentifierContainerLV;
}

int NetworkResourceIdentifierContainerTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV 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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
  }
  return 0;
}

void NetworkResourceIdentifierContainerTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerLV := ");
single_value->field_networkResourceIdentifierContainerLV.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 NetworkResourceIdentifierContainerTLV_template::log_match(const NetworkResourceIdentifierContainerTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_networkResourceIdentifierContainerLV.match(match_value.networkResourceIdentifierContainerLV(), legacy)){
TTCN_Logger::log_logmatch_info(".networkResourceIdentifierContainerLV");
single_value->field_networkResourceIdentifierContainerLV.log_match(match_value.networkResourceIdentifierContainerLV(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", networkResourceIdentifierContainerLV := ");
single_value->field_networkResourceIdentifierContainerLV.log_match(match_value.networkResourceIdentifierContainerLV(), 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 NetworkResourceIdentifierContainerTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_networkResourceIdentifierContainerLV.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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
}
}

void NetworkResourceIdentifierContainerTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_networkResourceIdentifierContainerLV.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 NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV.");
}
}

void NetworkResourceIdentifierContainerTLV_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: {
    NetworkResourceIdentifierContainerTLV_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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) networkResourceIdentifierContainerLV().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "networkResourceIdentifierContainerLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkResourceIdentifierContainerLV().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 @MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkResourceIdentifierContainerTLV_template* precondition = new NetworkResourceIdentifierContainerTLV_template;
    precondition->set_param(*param.get_elem(0));
    NetworkResourceIdentifierContainerTLV_template* implied_template = new NetworkResourceIdentifierContainerTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkResourceIdentifierContainerTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkResourceIdentifierContainerTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV");
single_value->field_networkResourceIdentifierContainerLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV");
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 : "@MobileL3_GMM_SM_Types.NetworkResourceIdentifierContainerTLV");
}

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

boolean NetworkResourceIdentifierContainerTLV_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;
}

ExtendedDRXParametersTLV::ExtendedDRXParametersTLV()
{
}

ExtendedDRXParametersTLV::ExtendedDRXParametersTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_eDRXValue,
    const BITSTRING& par_pagingTimeWindow)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_eDRXValue(par_eDRXValue),
  field_pagingTimeWindow(par_pagingTimeWindow)
{
}

ExtendedDRXParametersTLV::ExtendedDRXParametersTLV(const ExtendedDRXParametersTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.eDRXValue().is_bound()) field_eDRXValue = other_value.eDRXValue();
else field_eDRXValue.clean_up();
if (other_value.pagingTimeWindow().is_bound()) field_pagingTimeWindow = other_value.pagingTimeWindow();
else field_pagingTimeWindow.clean_up();
}

void ExtendedDRXParametersTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_eDRXValue.clean_up();
field_pagingTimeWindow.clean_up();
}

const TTCN_Typedescriptor_t* ExtendedDRXParametersTLV::get_descriptor() const { return &ExtendedDRXParametersTLV_descr_; }
ExtendedDRXParametersTLV& ExtendedDRXParametersTLV::operator=(const ExtendedDRXParametersTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.eDRXValue().is_bound()) field_eDRXValue = other_value.eDRXValue();
  else field_eDRXValue.clean_up();
  if (other_value.pagingTimeWindow().is_bound()) field_pagingTimeWindow = other_value.pagingTimeWindow();
  else field_pagingTimeWindow.clean_up();
}
return *this;
}

boolean ExtendedDRXParametersTLV::operator==(const ExtendedDRXParametersTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_eDRXValue==other_value.field_eDRXValue
  && field_pagingTimeWindow==other_value.field_pagingTimeWindow;
}

boolean ExtendedDRXParametersTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_eDRXValue.is_bound())
  || (field_pagingTimeWindow.is_bound());
}
boolean ExtendedDRXParametersTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_eDRXValue.is_value()
  && field_pagingTimeWindow.is_value();
}
void ExtendedDRXParametersTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", eDRXValue := ");
field_eDRXValue.log();
TTCN_Logger::log_event_str(", pagingTimeWindow := ");
field_pagingTimeWindow.log();
TTCN_Logger::log_event_str(" }");
}

void ExtendedDRXParametersTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (eDRXValue().is_bound()) eDRXValue().set_implicit_omit();
if (pagingTimeWindow().is_bound()) pagingTimeWindow().set_implicit_omit();
}

void ExtendedDRXParametersTLV::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV has 4 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eDRXValue().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pagingTimeWindow().set_param(*param.get_elem(3));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "eDRXValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRXValue().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(), "pagingTimeWindow")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pagingTimeWindow().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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
  }
}

void ExtendedDRXParametersTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_eDRXValue.encode_text(text_buf);
field_pagingTimeWindow.encode_text(text_buf);
}

void ExtendedDRXParametersTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_eDRXValue.decode_text(text_buf);
field_pagingTimeWindow.decode_text(text_buf);
}

void ExtendedDRXParametersTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ExtendedDRXParametersTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ExtendedDRXParametersTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, ExtendedDRXParametersTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ExtendedDRXParametersTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(ExtendedDRXParametersTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_eDRXValue.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_pagingTimeWindow.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_13) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ExtendedDRXParametersTLV::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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ExtendedDRXParametersTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &ExtendedDRXParametersTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_eDRXValue.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pagingTimeWindow.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  if (field_elementIdentifier !=  os_13) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct ExtendedDRXParametersTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_eDRXValue;
BITSTRING_template field_pagingTimeWindow;
};

void ExtendedDRXParametersTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_eDRXValue = ANY_VALUE;
single_value->field_pagingTimeWindow = ANY_VALUE;
}
}
}

void ExtendedDRXParametersTLV_template::copy_value(const ExtendedDRXParametersTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.eDRXValue().is_bound()) {
  single_value->field_eDRXValue = other_value.eDRXValue();
} else {
  single_value->field_eDRXValue.clean_up();
}
if (other_value.pagingTimeWindow().is_bound()) {
  single_value->field_pagingTimeWindow = other_value.pagingTimeWindow();
} else {
  single_value->field_pagingTimeWindow.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ExtendedDRXParametersTLV_template::copy_template(const ExtendedDRXParametersTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRXValue().get_selection()) {
single_value->field_eDRXValue = other_value.eDRXValue();
} else {
single_value->field_eDRXValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pagingTimeWindow().get_selection()) {
single_value->field_pagingTimeWindow = other_value.pagingTimeWindow();
} else {
single_value->field_pagingTimeWindow.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 ExtendedDRXParametersTLV_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 ExtendedDRXParametersTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new ExtendedDRXParametersTLV_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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
break;
}
set_selection(other_value);
}

ExtendedDRXParametersTLV_template::ExtendedDRXParametersTLV_template()
{
}

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

ExtendedDRXParametersTLV_template::ExtendedDRXParametersTLV_template(const ExtendedDRXParametersTLV& other_value)
{
copy_value(other_value);
}

ExtendedDRXParametersTLV_template::ExtendedDRXParametersTLV_template(const OPTIONAL<ExtendedDRXParametersTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ExtendedDRXParametersTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV from an unbound optional field.");
}
}

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

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

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

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

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

ExtendedDRXParametersTLV_template& ExtendedDRXParametersTLV_template::operator=(const ExtendedDRXParametersTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ExtendedDRXParametersTLV_template& ExtendedDRXParametersTLV_template::operator=(const OPTIONAL<ExtendedDRXParametersTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ExtendedDRXParametersTLV&)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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
}
return *this;
}

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

boolean ExtendedDRXParametersTLV_template::match(const ExtendedDRXParametersTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.eDRXValue().is_bound()) return FALSE;
if(!single_value->field_eDRXValue.match(other_value.eDRXValue(), legacy))return FALSE;
if(!other_value.pagingTimeWindow().is_bound()) return FALSE;
if(!single_value->field_pagingTimeWindow.match(other_value.pagingTimeWindow(), 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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
}
return FALSE;
}

boolean ExtendedDRXParametersTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_eDRXValue.is_bound()
 || single_value->field_pagingTimeWindow.is_bound();
}

boolean ExtendedDRXParametersTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_eDRXValue.is_value()
 && single_value->field_pagingTimeWindow.is_value();
}

void ExtendedDRXParametersTLV_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;
}

ExtendedDRXParametersTLV ExtendedDRXParametersTLV_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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
ExtendedDRXParametersTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_eDRXValue.is_bound()) {
ret_val.eDRXValue() = single_value->field_eDRXValue.valueof();
}
if (single_value->field_pagingTimeWindow.is_bound()) {
ret_val.pagingTimeWindow() = single_value->field_pagingTimeWindow.valueof();
}
return ret_val;
}

void ExtendedDRXParametersTLV_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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ExtendedDRXParametersTLV_template[list_length];
}

ExtendedDRXParametersTLV_template& ExtendedDRXParametersTLV_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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& ExtendedDRXParametersTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& ExtendedDRXParametersTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& ExtendedDRXParametersTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& ExtendedDRXParametersTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& ExtendedDRXParametersTLV_template::eDRXValue()
{
set_specific();
return single_value->field_eDRXValue;
}

const BITSTRING_template& ExtendedDRXParametersTLV_template::eDRXValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRXValue of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
return single_value->field_eDRXValue;
}

BITSTRING_template& ExtendedDRXParametersTLV_template::pagingTimeWindow()
{
set_specific();
return single_value->field_pagingTimeWindow;
}

const BITSTRING_template& ExtendedDRXParametersTLV_template::pagingTimeWindow() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pagingTimeWindow of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
return single_value->field_pagingTimeWindow;
}

int ExtendedDRXParametersTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV 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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
  }
  return 0;
}

void ExtendedDRXParametersTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", eDRXValue := ");
single_value->field_eDRXValue.log();
TTCN_Logger::log_event_str(", pagingTimeWindow := ");
single_value->field_pagingTimeWindow.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 ExtendedDRXParametersTLV_template::log_match(const ExtendedDRXParametersTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eDRXValue.match(match_value.eDRXValue(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRXValue");
single_value->field_eDRXValue.log_match(match_value.eDRXValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pagingTimeWindow.match(match_value.pagingTimeWindow(), legacy)){
TTCN_Logger::log_logmatch_info(".pagingTimeWindow");
single_value->field_pagingTimeWindow.log_match(match_value.pagingTimeWindow(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", eDRXValue := ");
single_value->field_eDRXValue.log_match(match_value.eDRXValue(), legacy);
TTCN_Logger::log_event_str(", pagingTimeWindow := ");
single_value->field_pagingTimeWindow.log_match(match_value.pagingTimeWindow(), 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 ExtendedDRXParametersTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_eDRXValue.encode_text(text_buf);
single_value->field_pagingTimeWindow.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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
}
}

void ExtendedDRXParametersTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_eDRXValue.decode_text(text_buf);
single_value->field_pagingTimeWindow.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 ExtendedDRXParametersTLV_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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV.");
}
}

void ExtendedDRXParametersTLV_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: {
    ExtendedDRXParametersTLV_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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV has 4 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eDRXValue().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pagingTimeWindow().set_param(*param.get_elem(3));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "eDRXValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRXValue().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(), "pagingTimeWindow")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pagingTimeWindow().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 @MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ExtendedDRXParametersTLV_template* precondition = new ExtendedDRXParametersTLV_template;
    precondition->set_param(*param.get_elem(0));
    ExtendedDRXParametersTLV_template* implied_template = new ExtendedDRXParametersTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ExtendedDRXParametersTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ExtendedDRXParametersTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
single_value->field_eDRXValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
single_value->field_pagingTimeWindow.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
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 : "@MobileL3_GMM_SM_Types.ExtendedDRXParametersTLV");
}

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

boolean ExtendedDRXParametersTLV_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;
}

AccessPointNameTLV::AccessPointNameTLV()
{
}

AccessPointNameTLV::AccessPointNameTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_accessPointNameValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_accessPointNameValue(par_accessPointNameValue)
{
}

AccessPointNameTLV::AccessPointNameTLV(const AccessPointNameTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.accessPointNameValue().is_bound()) field_accessPointNameValue = other_value.accessPointNameValue();
else field_accessPointNameValue.clean_up();
}

void AccessPointNameTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_accessPointNameValue.clean_up();
}

const TTCN_Typedescriptor_t* AccessPointNameTLV::get_descriptor() const { return &AccessPointNameTLV_descr_; }
AccessPointNameTLV& AccessPointNameTLV::operator=(const AccessPointNameTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.accessPointNameValue().is_bound()) field_accessPointNameValue = other_value.accessPointNameValue();
  else field_accessPointNameValue.clean_up();
}
return *this;
}

boolean AccessPointNameTLV::operator==(const AccessPointNameTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_accessPointNameValue==other_value.field_accessPointNameValue;
}

boolean AccessPointNameTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_accessPointNameValue.is_bound());
}
boolean AccessPointNameTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_accessPointNameValue.is_value();
}
void AccessPointNameTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessPointNameValue := ");
field_accessPointNameValue.log();
TTCN_Logger::log_event_str(" }");
}

void AccessPointNameTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (accessPointNameValue().is_bound()) accessPointNameValue().set_implicit_omit();
}

void AccessPointNameTLV::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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessPointNameTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) accessPointNameValue().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessPointNameValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointNameValue().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 @MobileL3_GMM_SM_Types.AccessPointNameTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
  }
}

void AccessPointNameTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_accessPointNameValue.encode_text(text_buf);
}

void AccessPointNameTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_accessPointNameValue.decode_text(text_buf);
}

void AccessPointNameTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessPointNameTLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessPointNameTLV::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;
  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_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_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());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessPointNameTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AccessPointNameTLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(AccessPointNameTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessPointNameV_descr_.raw->forceomit);
  decoded_field_length = field_accessPointNameValue.RAW_decode(AccessPointNameV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_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_field1 -= decoded_field_length;
  if (field_elementIdentifier !=  os_14) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessPointNameTLV::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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessPointNameTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessPointNameV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AccessPointNameTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_accessPointNameValue.RAW_encode(AccessPointNameV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_14) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct AccessPointNameTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_accessPointNameValue;
};

void AccessPointNameTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_accessPointNameValue = ANY_VALUE;
}
}
}

void AccessPointNameTLV_template::copy_value(const AccessPointNameTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.accessPointNameValue().is_bound()) {
  single_value->field_accessPointNameValue = other_value.accessPointNameValue();
} else {
  single_value->field_accessPointNameValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessPointNameTLV_template::copy_template(const AccessPointNameTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessPointNameValue().get_selection()) {
single_value->field_accessPointNameValue = other_value.accessPointNameValue();
} else {
single_value->field_accessPointNameValue.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 AccessPointNameTLV_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 AccessPointNameTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessPointNameTLV_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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
break;
}
set_selection(other_value);
}

AccessPointNameTLV_template::AccessPointNameTLV_template()
{
}

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

AccessPointNameTLV_template::AccessPointNameTLV_template(const AccessPointNameTLV& other_value)
{
copy_value(other_value);
}

AccessPointNameTLV_template::AccessPointNameTLV_template(const OPTIONAL<AccessPointNameTLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessPointNameTLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV from an unbound optional field.");
}
}

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

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

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

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

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

AccessPointNameTLV_template& AccessPointNameTLV_template::operator=(const AccessPointNameTLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessPointNameTLV_template& AccessPointNameTLV_template::operator=(const OPTIONAL<AccessPointNameTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessPointNameTLV&)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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
}
return *this;
}

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

boolean AccessPointNameTLV_template::match(const AccessPointNameTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.accessPointNameValue().is_bound()) return FALSE;
if(!single_value->field_accessPointNameValue.match(other_value.accessPointNameValue(), 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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
}
return FALSE;
}

boolean AccessPointNameTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_accessPointNameValue.is_bound();
}

boolean AccessPointNameTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_accessPointNameValue.is_value();
}

void AccessPointNameTLV_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;
}

AccessPointNameTLV AccessPointNameTLV_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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
AccessPointNameTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_accessPointNameValue.is_bound()) {
ret_val.accessPointNameValue() = single_value->field_accessPointNameValue.valueof();
}
return ret_val;
}

void AccessPointNameTLV_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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessPointNameTLV_template[list_length];
}

AccessPointNameTLV_template& AccessPointNameTLV_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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& AccessPointNameTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& AccessPointNameTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& AccessPointNameTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& AccessPointNameTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& AccessPointNameTLV_template::accessPointNameValue()
{
set_specific();
return single_value->field_accessPointNameValue;
}

const OCTETSTRING_template& AccessPointNameTLV_template::accessPointNameValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessPointNameValue of a non-specific template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
return single_value->field_accessPointNameValue;
}

int AccessPointNameTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV 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 @MobileL3_GMM_SM_Types.AccessPointNameTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
  }
  return 0;
}

void AccessPointNameTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessPointNameValue := ");
single_value->field_accessPointNameValue.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 AccessPointNameTLV_template::log_match(const AccessPointNameTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessPointNameValue.match(match_value.accessPointNameValue(), legacy)){
TTCN_Logger::log_logmatch_info(".accessPointNameValue");
single_value->field_accessPointNameValue.log_match(match_value.accessPointNameValue(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", accessPointNameValue := ");
single_value->field_accessPointNameValue.log_match(match_value.accessPointNameValue(), 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 AccessPointNameTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_accessPointNameValue.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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
}
}

void AccessPointNameTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_accessPointNameValue.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 AccessPointNameTLV_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 @MobileL3_GMM_SM_Types.AccessPointNameTLV.");
}
}

void AccessPointNameTLV_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: {
    AccessPointNameTLV_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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessPointNameTLV has 3 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) accessPointNameValue().set_param(*param.get_elem(2));
    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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessPointNameValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointNameValue().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 @MobileL3_GMM_SM_Types.AccessPointNameTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessPointNameTLV_template* precondition = new AccessPointNameTLV_template;
    precondition->set_param(*param.get_elem(0));
    AccessPointNameTLV_template* implied_template = new AccessPointNameTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessPointNameTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessPointNameTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
single_value->field_accessPointNameValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
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 : "@MobileL3_GMM_SM_Types.AccessPointNameTLV");
}

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

boolean AccessPointNameTLV_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;
}

AccessPointNameLV::AccessPointNameLV()
{
}

AccessPointNameLV::AccessPointNameLV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_accessPointNameValue)
  :   field_lengthIndicator(par_lengthIndicator),
  field_accessPointNameValue(par_accessPointNameValue)
{
}

AccessPointNameLV::AccessPointNameLV(const AccessPointNameLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.accessPointNameValue().is_bound()) field_accessPointNameValue = other_value.accessPointNameValue();
else field_accessPointNameValue.clean_up();
}

void AccessPointNameLV::clean_up()
{
field_lengthIndicator.clean_up();
field_accessPointNameValue.clean_up();
}

const TTCN_Typedescriptor_t* AccessPointNameLV::get_descriptor() const { return &AccessPointNameLV_descr_; }
AccessPointNameLV& AccessPointNameLV::operator=(const AccessPointNameLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.accessPointNameValue().is_bound()) field_accessPointNameValue = other_value.accessPointNameValue();
  else field_accessPointNameValue.clean_up();
}
return *this;
}

boolean AccessPointNameLV::operator==(const AccessPointNameLV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_accessPointNameValue==other_value.field_accessPointNameValue;
}

boolean AccessPointNameLV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_accessPointNameValue.is_bound());
}
boolean AccessPointNameLV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_accessPointNameValue.is_value();
}
void AccessPointNameLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessPointNameValue := ");
field_accessPointNameValue.log();
TTCN_Logger::log_event_str(" }");
}

void AccessPointNameLV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (accessPointNameValue().is_bound()) accessPointNameValue().set_implicit_omit();
}

void AccessPointNameLV::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 @MobileL3_GMM_SM_Types.AccessPointNameLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessPointNameValue().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessPointNameValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointNameValue().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 @MobileL3_GMM_SM_Types.AccessPointNameLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessPointNameLV");
  }
}

void AccessPointNameLV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_accessPointNameValue.encode_text(text_buf);
}

void AccessPointNameLV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_accessPointNameValue.decode_text(text_buf);
}

void AccessPointNameLV::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void AccessPointNameLV::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int AccessPointNameLV::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;
  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, AccessPointNameLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AccessPointNameLV_lengthIndicator_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 tmp0 = field_lengthIndicator.convert_to_Integer(AccessPointNameLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessPointNameV_descr_.raw->forceomit);
  decoded_field_length = field_accessPointNameValue.RAW_decode(AccessPointNameV_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, 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 AccessPointNameLV::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, AccessPointNameLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessPointNameV_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &AccessPointNameLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_accessPointNameValue.RAW_encode(AccessPointNameV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct AccessPointNameLV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_accessPointNameValue;
};

void AccessPointNameLV_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_lengthIndicator = ANY_VALUE;
single_value->field_accessPointNameValue = ANY_VALUE;
}
}
}

void AccessPointNameLV_template::copy_value(const AccessPointNameLV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.accessPointNameValue().is_bound()) {
  single_value->field_accessPointNameValue = other_value.accessPointNameValue();
} else {
  single_value->field_accessPointNameValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessPointNameLV_template::copy_template(const AccessPointNameLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessPointNameValue().get_selection()) {
single_value->field_accessPointNameValue = other_value.accessPointNameValue();
} else {
single_value->field_accessPointNameValue.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 AccessPointNameLV_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 AccessPointNameLV_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
break;
}
set_selection(other_value);
}

AccessPointNameLV_template::AccessPointNameLV_template()
{
}

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

AccessPointNameLV_template::AccessPointNameLV_template(const AccessPointNameLV& other_value)
{
copy_value(other_value);
}

AccessPointNameLV_template::AccessPointNameLV_template(const OPTIONAL<AccessPointNameLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessPointNameLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV from an unbound optional field.");
}
}

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

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

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

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

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

AccessPointNameLV_template& AccessPointNameLV_template::operator=(const AccessPointNameLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

AccessPointNameLV_template& AccessPointNameLV_template::operator=(const OPTIONAL<AccessPointNameLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const AccessPointNameLV&)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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
}
return *this;
}

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

boolean AccessPointNameLV_template::match(const AccessPointNameLV& 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.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.accessPointNameValue().is_bound()) return FALSE;
if(!single_value->field_accessPointNameValue.match(other_value.accessPointNameValue(), 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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
}
return FALSE;
}

boolean AccessPointNameLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_accessPointNameValue.is_bound();
}

boolean AccessPointNameLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_accessPointNameValue.is_value();
}

void AccessPointNameLV_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;
}

AccessPointNameLV AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
AccessPointNameLV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_accessPointNameValue.is_bound()) {
ret_val.accessPointNameValue() = single_value->field_accessPointNameValue.valueof();
}
return ret_val;
}

void AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessPointNameLV_template[list_length];
}

AccessPointNameLV_template& AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
return value_list.list_value[list_index];
}

INTEGER_template& AccessPointNameLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& AccessPointNameLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& AccessPointNameLV_template::accessPointNameValue()
{
set_specific();
return single_value->field_accessPointNameValue;
}

const OCTETSTRING_template& AccessPointNameLV_template::accessPointNameValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessPointNameValue of a non-specific template of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
return single_value->field_accessPointNameValue;
}

int AccessPointNameLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV 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 @MobileL3_GMM_SM_Types.AccessPointNameLV 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 @MobileL3_GMM_SM_Types.AccessPointNameLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.AccessPointNameLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.AccessPointNameLV.");
  }
  return 0;
}

void AccessPointNameLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", accessPointNameValue := ");
single_value->field_accessPointNameValue.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 AccessPointNameLV_template::log_match(const AccessPointNameLV& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_accessPointNameValue.match(match_value.accessPointNameValue(), legacy)){
TTCN_Logger::log_logmatch_info(".accessPointNameValue");
single_value->field_accessPointNameValue.log_match(match_value.accessPointNameValue(), 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("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", accessPointNameValue := ");
single_value->field_accessPointNameValue.log_match(match_value.accessPointNameValue(), 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 AccessPointNameLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_accessPointNameValue.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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
}
}

void AccessPointNameLV_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_lengthIndicator.decode_text(text_buf);
single_value->field_accessPointNameValue.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 AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV.");
}
}

void AccessPointNameLV_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: {
    AccessPointNameLV_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 @MobileL3_GMM_SM_Types.AccessPointNameLV 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) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessPointNameValue().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(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().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(), "accessPointNameValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointNameValue().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 @MobileL3_GMM_SM_Types.AccessPointNameLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessPointNameLV_template* precondition = new AccessPointNameLV_template;
    precondition->set_param(*param.get_elem(0));
    AccessPointNameLV_template* implied_template = new AccessPointNameLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessPointNameLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessPointNameLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessPointNameLV_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessPointNameLV");
single_value->field_accessPointNameValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessPointNameLV");
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 : "@MobileL3_GMM_SM_Types.AccessPointNameLV");
}

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

boolean AccessPointNameLV_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 */
