// 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 */

NBIFOM__Parameter::NBIFOM__Parameter()
{
}

NBIFOM__Parameter::NBIFOM__Parameter(const OCTETSTRING& par_parameterIdentifier,
    const INTEGER& par_lengthIndicator,
    const NBIFOM__ParameterContents& par_parameterContents)
  :   field_parameterIdentifier(par_parameterIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_parameterContents(par_parameterContents)
{
}

NBIFOM__Parameter::NBIFOM__Parameter(const NBIFOM__Parameter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
else field_parameterIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.parameterContents().is_bound()) field_parameterContents = other_value.parameterContents();
else field_parameterContents.clean_up();
}

void NBIFOM__Parameter::clean_up()
{
field_parameterIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_parameterContents.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__Parameter::get_descriptor() const { return &NBIFOM__Parameter_descr_; }
NBIFOM__Parameter& NBIFOM__Parameter::operator=(const NBIFOM__Parameter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
  if (other_value.parameterIdentifier().is_bound()) field_parameterIdentifier = other_value.parameterIdentifier();
  else field_parameterIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.parameterContents().is_bound()) field_parameterContents = other_value.parameterContents();
  else field_parameterContents.clean_up();
}
return *this;
}

boolean NBIFOM__Parameter::operator==(const NBIFOM__Parameter& other_value) const
{
return field_parameterIdentifier==other_value.field_parameterIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_parameterContents==other_value.field_parameterContents;
}

boolean NBIFOM__Parameter::is_bound() const
{
return (field_parameterIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_parameterContents.is_bound());
}
boolean NBIFOM__Parameter::is_value() const
{
return field_parameterIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_parameterContents.is_value();
}
void NBIFOM__Parameter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
field_parameterIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", parameterContents := ");
field_parameterContents.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__Parameter::set_implicit_omit()
{
if (parameterIdentifier().is_bound()) parameterIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (parameterContents().is_bound()) parameterContents().set_implicit_omit();
}

void NBIFOM__Parameter::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.NBIFOM_Parameter 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) parameterIdentifier().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) parameterContents().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(), "parameterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "parameterContents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterContents().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.NBIFOM_Parameter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
  }
}

void NBIFOM__Parameter::encode_text(Text_Buf& text_buf) const
{
field_parameterIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_parameterContents.encode_text(text_buf);
}

void NBIFOM__Parameter::decode_text(Text_Buf& text_buf)
{
field_parameterIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_parameterContents.decode_text(text_buf);
}

void NBIFOM__Parameter::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 NBIFOM__Parameter::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 NBIFOM__Parameter::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_parameterIdentifier.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, NBIFOM__Parameter_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NBIFOM__Parameter_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(NBIFOM__Parameter_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  if (field_parameterIdentifier ==  os_22) selected_field = 0;
  else if (field_parameterIdentifier ==  os_23) selected_field = 1;
  else if (field_parameterIdentifier ==  os_24) selected_field = 2;
  else if (field_parameterIdentifier ==  os_25) selected_field = 3;
  else if (field_parameterIdentifier ==  os_26) selected_field = 4;
  else if (field_parameterIdentifier ==  os_27) selected_field = 5;
  else if (field_parameterIdentifier ==  os_28) selected_field = 6;
  else if (field_parameterIdentifier ==  os_29) selected_field = 7;
  else selected_field = 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, NBIFOM__Parameter_parameterContents_descr_.raw->forceomit);
  decoded_field_length = field_parameterContents.RAW_decode(NBIFOM__Parameter_parameterContents_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, selected_field, 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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NBIFOM__Parameter::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, NBIFOM__Parameter_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NBIFOM__Parameter_parameterContents_descr_.raw);
  encoded_length += field_parameterIdentifier.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 = &NBIFOM__Parameter_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_parameterContents.RAW_encode(NBIFOM__Parameter_parameterContents_descr_, *myleaf.body.node.nodes[2]);
  switch (field_parameterContents.get_selection()) {
  case NBIFOM__ParameterContents::ALT_nBIFOM__Mode:
  if (field_parameterIdentifier !=  os_22) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_22.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__DefaultAccess:
  if (field_parameterIdentifier !=  os_23) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_23.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__Status:
  if (field_parameterIdentifier !=  os_24) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_24.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RoutingRules:
  if (field_parameterIdentifier !=  os_25) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_25.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__IPFlowMapping:
  if (field_parameterIdentifier !=  os_26) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_26.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesHandling:
  if (field_parameterIdentifier !=  os_27) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_27.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__RANRulesStatus:
  if (field_parameterIdentifier !=  os_28) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_28.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_pos.pos);
  }
  break;
  case NBIFOM__ParameterContents::ALT_nBIFOM__AccessUsabilityIndication:
  if (field_parameterIdentifier !=  os_29) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     os_29.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_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct NBIFOM__Parameter_template::single_value_struct {
OCTETSTRING_template field_parameterIdentifier;
INTEGER_template field_lengthIndicator;
NBIFOM__ParameterContents_template field_parameterContents;
};

void NBIFOM__Parameter_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_parameterIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_parameterContents = ANY_VALUE;
}
}
}

void NBIFOM__Parameter_template::copy_value(const NBIFOM__Parameter& other_value)
{
single_value = new single_value_struct;
if (other_value.parameterIdentifier().is_bound()) {
  single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
  single_value->field_parameterIdentifier.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.parameterContents().is_bound()) {
  single_value->field_parameterContents = other_value.parameterContents();
} else {
  single_value->field_parameterContents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__Parameter_template::copy_template(const NBIFOM__Parameter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.parameterIdentifier().get_selection()) {
single_value->field_parameterIdentifier = other_value.parameterIdentifier();
} else {
single_value->field_parameterIdentifier.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.parameterContents().get_selection()) {
single_value->field_parameterContents = other_value.parameterContents();
} else {
single_value->field_parameterContents.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 NBIFOM__Parameter_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 NBIFOM__Parameter_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__Parameter_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.NBIFOM_Parameter.");
break;
}
set_selection(other_value);
}

NBIFOM__Parameter_template::NBIFOM__Parameter_template()
{
}

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

NBIFOM__Parameter_template::NBIFOM__Parameter_template(const NBIFOM__Parameter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NBIFOM__Parameter_template::match(const NBIFOM__Parameter& 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.parameterIdentifier().is_bound()) return FALSE;
if(!single_value->field_parameterIdentifier.match(other_value.parameterIdentifier(), 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.parameterContents().is_bound()) return FALSE;
if(!single_value->field_parameterContents.match(other_value.parameterContents(), 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.NBIFOM_Parameter.");
}
return FALSE;
}

boolean NBIFOM__Parameter_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_parameterIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_parameterContents.is_bound();
}

boolean NBIFOM__Parameter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_parameterIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_parameterContents.is_value();
}

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

NBIFOM__Parameter NBIFOM__Parameter_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.NBIFOM_Parameter.");
NBIFOM__Parameter ret_val;
if (single_value->field_parameterIdentifier.is_bound()) {
ret_val.parameterIdentifier() = single_value->field_parameterIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_parameterContents.is_bound()) {
ret_val.parameterContents() = single_value->field_parameterContents.valueof();
}
return ret_val;
}

void NBIFOM__Parameter_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.NBIFOM_Parameter.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NBIFOM__Parameter_template[list_length];
}

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

OCTETSTRING_template& NBIFOM__Parameter_template::parameterIdentifier()
{
set_specific();
return single_value->field_parameterIdentifier;
}

const OCTETSTRING_template& NBIFOM__Parameter_template::parameterIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parameterIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_parameterIdentifier;
}

INTEGER_template& NBIFOM__Parameter_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NBIFOM__Parameter_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_lengthIndicator;
}

NBIFOM__ParameterContents_template& NBIFOM__Parameter_template::parameterContents()
{
set_specific();
return single_value->field_parameterContents;
}

const NBIFOM__ParameterContents_template& NBIFOM__Parameter_template::parameterContents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field parameterContents of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_Parameter.");
return single_value->field_parameterContents;
}

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

void NBIFOM__Parameter_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ parameterIdentifier := ");
single_value->field_parameterIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", parameterContents := ");
single_value->field_parameterContents.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 NBIFOM__Parameter_template::log_match(const NBIFOM__Parameter& 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_parameterIdentifier.match(match_value.parameterIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".parameterIdentifier");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), 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_parameterContents.match(match_value.parameterContents(), legacy)){
TTCN_Logger::log_logmatch_info(".parameterContents");
single_value->field_parameterContents.log_match(match_value.parameterContents(), 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("{ parameterIdentifier := ");
single_value->field_parameterIdentifier.log_match(match_value.parameterIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", parameterContents := ");
single_value->field_parameterContents.log_match(match_value.parameterContents(), 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 NBIFOM__Parameter_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_parameterIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_parameterContents.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.NBIFOM_Parameter.");
}
}

void NBIFOM__Parameter_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_parameterIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_parameterContents.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 NBIFOM__Parameter_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.NBIFOM_Parameter.");
}
}

void NBIFOM__Parameter_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: {
    NBIFOM__Parameter_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.NBIFOM_Parameter 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) parameterIdentifier().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) parameterContents().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(), "parameterIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "parameterContents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          parameterContents().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.NBIFOM_Parameter: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NBIFOM__Parameter_template* precondition = new NBIFOM__Parameter_template;
    precondition->set_param(*param.get_elem(0));
    NBIFOM__Parameter_template* implied_template = new NBIFOM__Parameter_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NBIFOM__Parameter_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
  }
  is_ifpresent = param.get_ifpresent();
}

void NBIFOM__Parameter_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_parameterIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
single_value->field_parameterContents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_Parameter");
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.NBIFOM_Parameter");
}

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

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

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV()
{
}

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const NBIFOM__ParameterList& par_contents)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_contents(par_contents)
{
}

NBIFOM__ContainerTLV::NBIFOM__ContainerTLV(const NBIFOM__ContainerTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
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.contents().is_bound()) field_contents = other_value.contents();
else field_contents.clean_up();
}

void NBIFOM__ContainerTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_contents.clean_up();
}

const TTCN_Typedescriptor_t* NBIFOM__ContainerTLV::get_descriptor() const { return &NBIFOM__ContainerTLV_descr_; }
NBIFOM__ContainerTLV& NBIFOM__ContainerTLV::operator=(const NBIFOM__ContainerTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
  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.contents().is_bound()) field_contents = other_value.contents();
  else field_contents.clean_up();
}
return *this;
}

boolean NBIFOM__ContainerTLV::operator==(const NBIFOM__ContainerTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_contents==other_value.field_contents;
}

boolean NBIFOM__ContainerTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_contents.is_bound());
}
boolean NBIFOM__ContainerTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_contents.is_value();
}
void NBIFOM__ContainerTLV::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(", contents := ");
field_contents.log();
TTCN_Logger::log_event_str(" }");
}

void NBIFOM__ContainerTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (contents().is_bound()) contents().set_implicit_omit();
}

void NBIFOM__ContainerTLV::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.NBIFOM_ContainerTLV 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) contents().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(), "contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          contents().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.NBIFOM_ContainerTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
  }
}

void NBIFOM__ContainerTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_contents.encode_text(text_buf);
}

void NBIFOM__ContainerTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_contents.decode_text(text_buf);
}

void NBIFOM__ContainerTLV::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 NBIFOM__ContainerTLV::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 NBIFOM__ContainerTLV::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, NBIFOM__ContainerTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NBIFOM__ContainerTLV_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(NBIFOM__ContainerTLV_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, NBIFOM__ParameterList_descr_.raw->forceomit);
  decoded_field_length = field_contents.RAW_decode(NBIFOM__ParameterList_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_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 NBIFOM__ContainerTLV::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, NBIFOM__ContainerTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NBIFOM__ParameterList_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 = &NBIFOM__ContainerTLV_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_contents.RAW_encode(NBIFOM__ParameterList_descr_, *myleaf.body.node.nodes[2]);
  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 NBIFOM__ContainerTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
NBIFOM__ParameterList_template field_contents;
};

void NBIFOM__ContainerTLV_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_contents = ANY_VALUE;
}
}
}

void NBIFOM__ContainerTLV_template::copy_value(const NBIFOM__ContainerTLV& 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.contents().is_bound()) {
  single_value->field_contents = other_value.contents();
} else {
  single_value->field_contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NBIFOM__ContainerTLV_template::copy_template(const NBIFOM__ContainerTLV_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.contents().get_selection()) {
single_value->field_contents = other_value.contents();
} else {
single_value->field_contents.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 NBIFOM__ContainerTLV_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 NBIFOM__ContainerTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new NBIFOM__ContainerTLV_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.NBIFOM_ContainerTLV.");
break;
}
set_selection(other_value);
}

NBIFOM__ContainerTLV_template::NBIFOM__ContainerTLV_template()
{
}

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

NBIFOM__ContainerTLV_template::NBIFOM__ContainerTLV_template(const NBIFOM__ContainerTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NBIFOM__ContainerTLV_template::match(const NBIFOM__ContainerTLV& 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.contents().is_bound()) return FALSE;
if(!single_value->field_contents.match(other_value.contents(), 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.NBIFOM_ContainerTLV.");
}
return FALSE;
}

boolean NBIFOM__ContainerTLV_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_contents.is_bound();
}

boolean NBIFOM__ContainerTLV_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_contents.is_value();
}

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

NBIFOM__ContainerTLV NBIFOM__ContainerTLV_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.NBIFOM_ContainerTLV.");
NBIFOM__ContainerTLV 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_contents.is_bound()) {
ret_val.contents() = single_value->field_contents.valueof();
}
return ret_val;
}

void NBIFOM__ContainerTLV_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.NBIFOM_ContainerTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NBIFOM__ContainerTLV_template[list_length];
}

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

OCTETSTRING_template& NBIFOM__ContainerTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& NBIFOM__ContainerTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& NBIFOM__ContainerTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& NBIFOM__ContainerTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_lengthIndicator;
}

NBIFOM__ParameterList_template& NBIFOM__ContainerTLV_template::contents()
{
set_specific();
return single_value->field_contents;
}

const NBIFOM__ParameterList_template& NBIFOM__ContainerTLV_template::contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field contents of a non-specific template of type @MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV.");
return single_value->field_contents;
}

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

void NBIFOM__ContainerTLV_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(", contents := ");
single_value->field_contents.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 NBIFOM__ContainerTLV_template::log_match(const NBIFOM__ContainerTLV& 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_contents.match(match_value.contents(), legacy)){
TTCN_Logger::log_logmatch_info(".contents");
single_value->field_contents.log_match(match_value.contents(), 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(", contents := ");
single_value->field_contents.log_match(match_value.contents(), 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 NBIFOM__ContainerTLV_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_contents.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.NBIFOM_ContainerTLV.");
}
}

void NBIFOM__ContainerTLV_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_contents.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 NBIFOM__ContainerTLV_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.NBIFOM_ContainerTLV.");
}
}

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

void NBIFOM__ContainerTLV_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.NBIFOM_ContainerTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
single_value->field_contents.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.NBIFOM_ContainerTLV");
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.NBIFOM_ContainerTLV");
}

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

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

PDPContextStatusTLV::PDPContextStatusTLV()
{
}

PDPContextStatusTLV::PDPContextStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

PDPContextStatusTLV::PDPContextStatusTLV(const PDPContextStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
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.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void PDPContextStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* PDPContextStatusTLV::get_descriptor() const { return &PDPContextStatusTLV_descr_; }
PDPContextStatusTLV& PDPContextStatusTLV::operator=(const PDPContextStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
  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.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean PDPContextStatusTLV::operator==(const PDPContextStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valueField==other_value.field_valueField;
}

boolean PDPContextStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean PDPContextStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void PDPContextStatusTLV::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(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void PDPContextStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void PDPContextStatusTLV::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.PDPContextStatusTLV 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) valueField().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(), "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.PDPContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
  }
}

void PDPContextStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void PDPContextStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

void PDPContextStatusTLV::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 PDPContextStatusTLV::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 PDPContextStatusTLV::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, PDPContextStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PDPContextStatusTLV_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(PDPContextStatusTLV_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::OCT2_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_18) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDPContextStatusTLV::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, PDPContextStatusTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT2_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 = &PDPContextStatusTLV_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_valueField.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_18) {
  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_18.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 PDPContextStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

void PDPContextStatusTLV_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_valueField = ANY_VALUE;
}
}
}

void PDPContextStatusTLV_template::copy_value(const PDPContextStatusTLV& 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.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDPContextStatusTLV_template::copy_template(const PDPContextStatusTLV_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.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 PDPContextStatusTLV_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 PDPContextStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new PDPContextStatusTLV_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.PDPContextStatusTLV.");
break;
}
set_selection(other_value);
}

PDPContextStatusTLV_template::PDPContextStatusTLV_template()
{
}

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

PDPContextStatusTLV_template::PDPContextStatusTLV_template(const PDPContextStatusTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDPContextStatusTLV_template::match(const PDPContextStatusTLV& 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.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.PDPContextStatusTLV.");
}
return FALSE;
}

boolean PDPContextStatusTLV_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_valueField.is_bound();
}

boolean PDPContextStatusTLV_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_valueField.is_value();
}

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

PDPContextStatusTLV PDPContextStatusTLV_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.PDPContextStatusTLV.");
PDPContextStatusTLV 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_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void PDPContextStatusTLV_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.PDPContextStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDPContextStatusTLV_template[list_length];
}

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

OCTETSTRING_template& PDPContextStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& PDPContextStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& PDPContextStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& PDPContextStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& PDPContextStatusTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const OCTETSTRING_template& PDPContextStatusTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.PDPContextStatusTLV.");
return single_value->field_valueField;
}

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

void PDPContextStatusTLV_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(", 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 PDPContextStatusTLV_template::log_match(const PDPContextStatusTLV& 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_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("{ 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(", 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 PDPContextStatusTLV_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_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.PDPContextStatusTLV.");
}
}

void PDPContextStatusTLV_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_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 PDPContextStatusTLV_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.PDPContextStatusTLV.");
}
}

void PDPContextStatusTLV_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: {
    PDPContextStatusTLV_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.PDPContextStatusTLV 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) valueField().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(), "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.PDPContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDPContextStatusTLV_template* precondition = new PDPContextStatusTLV_template;
    precondition->set_param(*param.get_elem(0));
    PDPContextStatusTLV_template* implied_template = new PDPContextStatusTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDPContextStatusTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDPContextStatusTLV_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.PDPContextStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDPContextStatusTLV");
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.PDPContextStatusTLV");
}

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

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

RadioPriorityV::RadioPriorityV()
{
}

RadioPriorityV::RadioPriorityV(const BITSTRING& par_priorityLevelValue,
    const BITSTRING& par_spare)
  :   field_priorityLevelValue(par_priorityLevelValue),
  field_spare(par_spare)
{
}

RadioPriorityV::RadioPriorityV(const RadioPriorityV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
else field_priorityLevelValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void RadioPriorityV::clean_up()
{
field_priorityLevelValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriorityV::get_descriptor() const { return &RadioPriorityV_descr_; }
RadioPriorityV& RadioPriorityV::operator=(const RadioPriorityV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
  if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
  else field_priorityLevelValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean RadioPriorityV::operator==(const RadioPriorityV& other_value) const
{
return field_priorityLevelValue==other_value.field_priorityLevelValue
  && field_spare==other_value.field_spare;
}

boolean RadioPriorityV::is_bound() const
{
return (field_priorityLevelValue.is_bound())
  || (field_spare.is_bound());
}
boolean RadioPriorityV::is_value() const
{
return field_priorityLevelValue.is_value()
  && field_spare.is_value();
}
void RadioPriorityV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
field_priorityLevelValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriorityV::set_implicit_omit()
{
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriorityV::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.RadioPriorityV 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) priorityLevelValue().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(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.RadioPriorityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriorityV");
  }
}

void RadioPriorityV::encode_text(Text_Buf& text_buf) const
{
field_priorityLevelValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void RadioPriorityV::decode_text(Text_Buf& text_buf)
{
field_priorityLevelValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void RadioPriorityV::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 RadioPriorityV::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 RadioPriorityV::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_priorityLevelValue.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 RadioPriorityV::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_priorityLevelValue.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 RadioPriorityV_template::single_value_struct {
BITSTRING_template field_priorityLevelValue;
BITSTRING_template field_spare;
};

void RadioPriorityV_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_priorityLevelValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void RadioPriorityV_template::copy_value(const RadioPriorityV& other_value)
{
single_value = new single_value_struct;
if (other_value.priorityLevelValue().is_bound()) {
  single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
  single_value->field_priorityLevelValue.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 RadioPriorityV_template::copy_template(const RadioPriorityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.priorityLevelValue().get_selection()) {
single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
single_value->field_priorityLevelValue.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 RadioPriorityV_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 RadioPriorityV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriorityV_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.RadioPriorityV.");
break;
}
set_selection(other_value);
}

RadioPriorityV_template::RadioPriorityV_template()
{
}

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

RadioPriorityV_template::RadioPriorityV_template(const RadioPriorityV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RadioPriorityV_template::match(const RadioPriorityV& 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.priorityLevelValue().is_bound()) return FALSE;
if(!single_value->field_priorityLevelValue.match(other_value.priorityLevelValue(), 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.RadioPriorityV.");
}
return FALSE;
}

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

boolean RadioPriorityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_priorityLevelValue.is_value()
 && single_value->field_spare.is_value();
}

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

RadioPriorityV RadioPriorityV_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.RadioPriorityV.");
RadioPriorityV ret_val;
if (single_value->field_priorityLevelValue.is_bound()) {
ret_val.priorityLevelValue() = single_value->field_priorityLevelValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void RadioPriorityV_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.RadioPriorityV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriorityV_template[list_length];
}

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

BITSTRING_template& RadioPriorityV_template::priorityLevelValue()
{
set_specific();
return single_value->field_priorityLevelValue;
}

const BITSTRING_template& RadioPriorityV_template::priorityLevelValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityLevelValue of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
return single_value->field_priorityLevelValue;
}

BITSTRING_template& RadioPriorityV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& RadioPriorityV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityV.");
return single_value->field_spare;
}

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

void RadioPriorityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.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 RadioPriorityV_template::log_match(const RadioPriorityV& 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_priorityLevelValue.match(match_value.priorityLevelValue(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityLevelValue");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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 RadioPriorityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_priorityLevelValue.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.RadioPriorityV.");
}
}

void RadioPriorityV_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_priorityLevelValue.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 RadioPriorityV_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.RadioPriorityV.");
}
}

void RadioPriorityV_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: {
    RadioPriorityV_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.RadioPriorityV 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) priorityLevelValue().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(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.RadioPriorityV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriorityV_template* precondition = new RadioPriorityV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriorityV_template* implied_template = new RadioPriorityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriorityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriorityV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriorityV_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_priorityLevelValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityV");
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.RadioPriorityV");
}

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

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

RadioPriorityTV::RadioPriorityTV()
{
}

RadioPriorityTV::RadioPriorityTV(const RadioPriorityV& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

RadioPriorityTV::RadioPriorityTV(const RadioPriorityTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
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 RadioPriorityTV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriorityTV::get_descriptor() const { return &RadioPriorityTV_descr_; }
RadioPriorityTV& RadioPriorityTV::operator=(const RadioPriorityTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
  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 RadioPriorityTV::operator==(const RadioPriorityTV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RadioPriorityTV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RadioPriorityTV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void RadioPriorityTV::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 RadioPriorityTV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriorityTV::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.RadioPriorityTV 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.RadioPriorityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriorityTV");
  }
}

void RadioPriorityTV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RadioPriorityTV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void RadioPriorityTV::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 RadioPriorityTV::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 RadioPriorityTV::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, RadioPriorityV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(RadioPriorityV_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_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 RadioPriorityTV::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, RadioPriorityV_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(RadioPriorityV_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_10) {
  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_10.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 RadioPriorityTV_template::single_value_struct {
RadioPriorityV_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void RadioPriorityTV_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 RadioPriorityTV_template::copy_value(const RadioPriorityTV& 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 RadioPriorityTV_template::copy_template(const RadioPriorityTV_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 RadioPriorityTV_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 RadioPriorityTV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriorityTV_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.RadioPriorityTV.");
break;
}
set_selection(other_value);
}

RadioPriorityTV_template::RadioPriorityTV_template()
{
}

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

RadioPriorityTV_template::RadioPriorityTV_template(const RadioPriorityTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RadioPriorityTV_template::match(const RadioPriorityTV& 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.RadioPriorityTV.");
}
return FALSE;
}

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

RadioPriorityTV RadioPriorityTV_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.RadioPriorityTV.");
RadioPriorityTV 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 RadioPriorityTV_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.RadioPriorityTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriorityTV_template[list_length];
}

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

RadioPriorityV_template& RadioPriorityTV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const RadioPriorityV_template& RadioPriorityTV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
return single_value->field_valueField;
}

BITSTRING_template& RadioPriorityTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& RadioPriorityTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriorityTV.");
return single_value->field_elementIdentifier;
}

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

void RadioPriorityTV_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 RadioPriorityTV_template::log_match(const RadioPriorityTV& 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 RadioPriorityTV_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.RadioPriorityTV.");
}
}

void RadioPriorityTV_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 RadioPriorityTV_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.RadioPriorityTV.");
}
}

void RadioPriorityTV_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: {
    RadioPriorityTV_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.RadioPriorityTV 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.RadioPriorityTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriorityTV_template* precondition = new RadioPriorityTV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriorityTV_template* implied_template = new RadioPriorityTV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriorityTV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriorityTV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriorityTV_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.RadioPriorityTV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriorityTV");
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.RadioPriorityTV");
}

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

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

GPRSTimerV::GPRSTimerV()
{
}

GPRSTimerV::GPRSTimerV(const BITSTRING& par_timerValue,
    const BITSTRING& par_unit)
  :   field_timerValue(par_timerValue),
  field_unit(par_unit)
{
}

GPRSTimerV::GPRSTimerV(const GPRSTimerV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
else field_timerValue.clean_up();
if (other_value.unit().is_bound()) field_unit = other_value.unit();
else field_unit.clean_up();
}

void GPRSTimerV::clean_up()
{
field_timerValue.clean_up();
field_unit.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimerV::get_descriptor() const { return &GPRSTimerV_descr_; }
GPRSTimerV& GPRSTimerV::operator=(const GPRSTimerV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
  if (other_value.timerValue().is_bound()) field_timerValue = other_value.timerValue();
  else field_timerValue.clean_up();
  if (other_value.unit().is_bound()) field_unit = other_value.unit();
  else field_unit.clean_up();
}
return *this;
}

boolean GPRSTimerV::operator==(const GPRSTimerV& other_value) const
{
return field_timerValue==other_value.field_timerValue
  && field_unit==other_value.field_unit;
}

boolean GPRSTimerV::is_bound() const
{
return (field_timerValue.is_bound())
  || (field_unit.is_bound());
}
boolean GPRSTimerV::is_value() const
{
return field_timerValue.is_value()
  && field_unit.is_value();
}
void GPRSTimerV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ timerValue := ");
field_timerValue.log();
TTCN_Logger::log_event_str(", unit := ");
field_unit.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimerV::set_implicit_omit()
{
if (timerValue().is_bound()) timerValue().set_implicit_omit();
if (unit().is_bound()) unit().set_implicit_omit();
}

void GPRSTimerV::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.GPRSTimerV 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) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().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(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().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.GPRSTimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimerV");
  }
}

void GPRSTimerV::encode_text(Text_Buf& text_buf) const
{
field_timerValue.encode_text(text_buf);
field_unit.encode_text(text_buf);
}

void GPRSTimerV::decode_text(Text_Buf& text_buf)
{
field_timerValue.decode_text(text_buf);
field_unit.decode_text(text_buf);
}

void GPRSTimerV::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 GPRSTimerV::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 GPRSTimerV::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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_timerValue.RAW_decode(General__Types::BIT5_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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_unit.RAW_decode(General__Types::BIT3_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 GPRSTimerV::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::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  encoded_length += field_timerValue.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_unit.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct GPRSTimerV_template::single_value_struct {
BITSTRING_template field_timerValue;
BITSTRING_template field_unit;
};

void GPRSTimerV_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_timerValue = ANY_VALUE;
single_value->field_unit = ANY_VALUE;
}
}
}

void GPRSTimerV_template::copy_value(const GPRSTimerV& other_value)
{
single_value = new single_value_struct;
if (other_value.timerValue().is_bound()) {
  single_value->field_timerValue = other_value.timerValue();
} else {
  single_value->field_timerValue.clean_up();
}
if (other_value.unit().is_bound()) {
  single_value->field_unit = other_value.unit();
} else {
  single_value->field_unit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimerV_template::copy_template(const GPRSTimerV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.timerValue().get_selection()) {
single_value->field_timerValue = other_value.timerValue();
} else {
single_value->field_timerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unit().get_selection()) {
single_value->field_unit = other_value.unit();
} else {
single_value->field_unit.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 GPRSTimerV_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 GPRSTimerV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimerV_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.GPRSTimerV.");
break;
}
set_selection(other_value);
}

GPRSTimerV_template::GPRSTimerV_template()
{
}

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

GPRSTimerV_template::GPRSTimerV_template(const GPRSTimerV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean GPRSTimerV_template::match(const GPRSTimerV& 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.timerValue().is_bound()) return FALSE;
if(!single_value->field_timerValue.match(other_value.timerValue(), legacy))return FALSE;
if(!other_value.unit().is_bound()) return FALSE;
if(!single_value->field_unit.match(other_value.unit(), 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.GPRSTimerV.");
}
return FALSE;
}

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

boolean GPRSTimerV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_timerValue.is_value()
 && single_value->field_unit.is_value();
}

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

GPRSTimerV GPRSTimerV_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.GPRSTimerV.");
GPRSTimerV ret_val;
if (single_value->field_timerValue.is_bound()) {
ret_val.timerValue() = single_value->field_timerValue.valueof();
}
if (single_value->field_unit.is_bound()) {
ret_val.unit() = single_value->field_unit.valueof();
}
return ret_val;
}

void GPRSTimerV_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.GPRSTimerV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimerV_template[list_length];
}

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

BITSTRING_template& GPRSTimerV_template::timerValue()
{
set_specific();
return single_value->field_timerValue;
}

const BITSTRING_template& GPRSTimerV_template::timerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timerValue of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
return single_value->field_timerValue;
}

BITSTRING_template& GPRSTimerV_template::unit()
{
set_specific();
return single_value->field_unit;
}

const BITSTRING_template& GPRSTimerV_template::unit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unit of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerV.");
return single_value->field_unit;
}

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

void GPRSTimerV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ timerValue := ");
single_value->field_timerValue.log();
TTCN_Logger::log_event_str(", unit := ");
single_value->field_unit.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 GPRSTimerV_template::log_match(const GPRSTimerV& 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_timerValue.match(match_value.timerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".timerValue");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_unit.match(match_value.unit(), legacy)){
TTCN_Logger::log_logmatch_info(".unit");
single_value->field_unit.log_match(match_value.unit(), 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("{ timerValue := ");
single_value->field_timerValue.log_match(match_value.timerValue(), legacy);
TTCN_Logger::log_event_str(", unit := ");
single_value->field_unit.log_match(match_value.unit(), 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 GPRSTimerV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_timerValue.encode_text(text_buf);
single_value->field_unit.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.GPRSTimerV.");
}
}

void GPRSTimerV_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_timerValue.decode_text(text_buf);
single_value->field_unit.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 GPRSTimerV_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.GPRSTimerV.");
}
}

void GPRSTimerV_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: {
    GPRSTimerV_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.GPRSTimerV 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) timerValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unit().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(), "timerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unit().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.GPRSTimerV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    GPRSTimerV_template* precondition = new GPRSTimerV_template;
    precondition->set_param(*param.get_elem(0));
    GPRSTimerV_template* implied_template = new GPRSTimerV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GPRSTimerV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.GPRSTimerV");
  }
  is_ifpresent = param.get_ifpresent();
}

void GPRSTimerV_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_timerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerV");
single_value->field_unit.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerV");
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.GPRSTimerV");
}

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

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

GPRSTimerTV::GPRSTimerTV()
{
}

GPRSTimerTV::GPRSTimerTV(const OCTETSTRING& par_elementIdentifier,
    const GPRSTimerV& par_gprsTimerV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_gprsTimerV(par_gprsTimerV)
{
}

GPRSTimerTV::GPRSTimerTV(const GPRSTimerTV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.gprsTimerV().is_bound()) field_gprsTimerV = other_value.gprsTimerV();
else field_gprsTimerV.clean_up();
}

void GPRSTimerTV::clean_up()
{
field_elementIdentifier.clean_up();
field_gprsTimerV.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimerTV::get_descriptor() const { return &GPRSTimerTV_descr_; }
GPRSTimerTV& GPRSTimerTV::operator=(const GPRSTimerTV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.gprsTimerV().is_bound()) field_gprsTimerV = other_value.gprsTimerV();
  else field_gprsTimerV.clean_up();
}
return *this;
}

boolean GPRSTimerTV::operator==(const GPRSTimerTV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_gprsTimerV==other_value.field_gprsTimerV;
}

boolean GPRSTimerTV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_gprsTimerV.is_bound());
}
boolean GPRSTimerTV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_gprsTimerV.is_value();
}
void GPRSTimerTV::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(", gprsTimerV := ");
field_gprsTimerV.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimerTV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (gprsTimerV().is_bound()) gprsTimerV().set_implicit_omit();
}

void GPRSTimerTV::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.GPRSTimerTV 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) gprsTimerV().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(), "gprsTimerV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimerV().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.GPRSTimerTV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimerTV");
  }
}

void GPRSTimerTV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_gprsTimerV.encode_text(text_buf);
}

void GPRSTimerTV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_gprsTimerV.decode_text(text_buf);
}

void GPRSTimerTV::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 GPRSTimerTV::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 GPRSTimerTV::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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_gprsTimerV.RAW_decode(GPRSTimerV_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_30) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GPRSTimerTV::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, GPRSTimerV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gprsTimerV.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_30) {
  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_30.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 GPRSTimerTV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
GPRSTimerV_template field_gprsTimerV;
};

void GPRSTimerTV_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_gprsTimerV = ANY_VALUE;
}
}
}

void GPRSTimerTV_template::copy_value(const GPRSTimerTV& 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.gprsTimerV().is_bound()) {
  single_value->field_gprsTimerV = other_value.gprsTimerV();
} else {
  single_value->field_gprsTimerV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimerTV_template::copy_template(const GPRSTimerTV_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.gprsTimerV().get_selection()) {
single_value->field_gprsTimerV = other_value.gprsTimerV();
} else {
single_value->field_gprsTimerV.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 GPRSTimerTV_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 GPRSTimerTV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimerTV_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.GPRSTimerTV.");
break;
}
set_selection(other_value);
}

GPRSTimerTV_template::GPRSTimerTV_template()
{
}

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

GPRSTimerTV_template::GPRSTimerTV_template(const GPRSTimerTV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean GPRSTimerTV_template::match(const GPRSTimerTV& 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.gprsTimerV().is_bound()) return FALSE;
if(!single_value->field_gprsTimerV.match(other_value.gprsTimerV(), 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.GPRSTimerTV.");
}
return FALSE;
}

boolean GPRSTimerTV_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_gprsTimerV.is_bound();
}

boolean GPRSTimerTV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_gprsTimerV.is_value();
}

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

GPRSTimerTV GPRSTimerTV_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.GPRSTimerTV.");
GPRSTimerTV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_gprsTimerV.is_bound()) {
ret_val.gprsTimerV() = single_value->field_gprsTimerV.valueof();
}
return ret_val;
}

void GPRSTimerTV_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.GPRSTimerTV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimerTV_template[list_length];
}

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

OCTETSTRING_template& GPRSTimerTV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& GPRSTimerTV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
return single_value->field_elementIdentifier;
}

GPRSTimerV_template& GPRSTimerTV_template::gprsTimerV()
{
set_specific();
return single_value->field_gprsTimerV;
}

const GPRSTimerV_template& GPRSTimerTV_template::gprsTimerV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsTimerV of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimerTV.");
return single_value->field_gprsTimerV;
}

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

void GPRSTimerTV_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(", gprsTimerV := ");
single_value->field_gprsTimerV.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 GPRSTimerTV_template::log_match(const GPRSTimerTV& 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_gprsTimerV.match(match_value.gprsTimerV(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsTimerV");
single_value->field_gprsTimerV.log_match(match_value.gprsTimerV(), 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(", gprsTimerV := ");
single_value->field_gprsTimerV.log_match(match_value.gprsTimerV(), 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 GPRSTimerTV_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_gprsTimerV.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.GPRSTimerTV.");
}
}

void GPRSTimerTV_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_gprsTimerV.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 GPRSTimerTV_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.GPRSTimerTV.");
}
}

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

void GPRSTimerTV_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.GPRSTimerTV");
single_value->field_gprsTimerV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimerTV");
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.GPRSTimerTV");
}

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

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

GPRSTimer2TLV::GPRSTimer2TLV()
{
}

GPRSTimer2TLV::GPRSTimer2TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const GPRSTimerV& par_gprsTimer2V)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_gprsTimer2V(par_gprsTimer2V)
{
}

GPRSTimer2TLV::GPRSTimer2TLV(const GPRSTimer2TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
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.gprsTimer2V().is_bound()) field_gprsTimer2V = other_value.gprsTimer2V();
else field_gprsTimer2V.clean_up();
}

void GPRSTimer2TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_gprsTimer2V.clean_up();
}

const TTCN_Typedescriptor_t* GPRSTimer2TLV::get_descriptor() const { return &GPRSTimer2TLV_descr_; }
GPRSTimer2TLV& GPRSTimer2TLV::operator=(const GPRSTimer2TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
  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.gprsTimer2V().is_bound()) field_gprsTimer2V = other_value.gprsTimer2V();
  else field_gprsTimer2V.clean_up();
}
return *this;
}

boolean GPRSTimer2TLV::operator==(const GPRSTimer2TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_gprsTimer2V==other_value.field_gprsTimer2V;
}

boolean GPRSTimer2TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_gprsTimer2V.is_bound());
}
boolean GPRSTimer2TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_gprsTimer2V.is_value();
}
void GPRSTimer2TLV::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(", gprsTimer2V := ");
field_gprsTimer2V.log();
TTCN_Logger::log_event_str(" }");
}

void GPRSTimer2TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (gprsTimer2V().is_bound()) gprsTimer2V().set_implicit_omit();
}

void GPRSTimer2TLV::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.GPRSTimer2TLV 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) gprsTimer2V().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(), "gprsTimer2V")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsTimer2V().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.GPRSTimer2TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
  }
}

void GPRSTimer2TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_gprsTimer2V.encode_text(text_buf);
}

void GPRSTimer2TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_gprsTimer2V.decode_text(text_buf);
}

void GPRSTimer2TLV::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 GPRSTimer2TLV::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 GPRSTimer2TLV::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, GPRSTimer2TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(GPRSTimer2TLV_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(GPRSTimer2TLV_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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_gprsTimer2V.RAW_decode(GPRSTimerV_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GPRSTimer2TLV::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, GPRSTimer2TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GPRSTimerV_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 = &GPRSTimer2TLV_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_gprsTimer2V.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct GPRSTimer2TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
GPRSTimerV_template field_gprsTimer2V;
};

void GPRSTimer2TLV_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_gprsTimer2V = ANY_VALUE;
}
}
}

void GPRSTimer2TLV_template::copy_value(const GPRSTimer2TLV& 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.gprsTimer2V().is_bound()) {
  single_value->field_gprsTimer2V = other_value.gprsTimer2V();
} else {
  single_value->field_gprsTimer2V.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GPRSTimer2TLV_template::copy_template(const GPRSTimer2TLV_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.gprsTimer2V().get_selection()) {
single_value->field_gprsTimer2V = other_value.gprsTimer2V();
} else {
single_value->field_gprsTimer2V.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 GPRSTimer2TLV_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 GPRSTimer2TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new GPRSTimer2TLV_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.GPRSTimer2TLV.");
break;
}
set_selection(other_value);
}

GPRSTimer2TLV_template::GPRSTimer2TLV_template()
{
}

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

GPRSTimer2TLV_template::GPRSTimer2TLV_template(const GPRSTimer2TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean GPRSTimer2TLV_template::match(const GPRSTimer2TLV& 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.gprsTimer2V().is_bound()) return FALSE;
if(!single_value->field_gprsTimer2V.match(other_value.gprsTimer2V(), 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.GPRSTimer2TLV.");
}
return FALSE;
}

boolean GPRSTimer2TLV_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_gprsTimer2V.is_bound();
}

boolean GPRSTimer2TLV_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_gprsTimer2V.is_value();
}

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

GPRSTimer2TLV GPRSTimer2TLV_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.GPRSTimer2TLV.");
GPRSTimer2TLV 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_gprsTimer2V.is_bound()) {
ret_val.gprsTimer2V() = single_value->field_gprsTimer2V.valueof();
}
return ret_val;
}

void GPRSTimer2TLV_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.GPRSTimer2TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GPRSTimer2TLV_template[list_length];
}

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

OCTETSTRING_template& GPRSTimer2TLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& GPRSTimer2TLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& GPRSTimer2TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& GPRSTimer2TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_lengthIndicator;
}

GPRSTimerV_template& GPRSTimer2TLV_template::gprsTimer2V()
{
set_specific();
return single_value->field_gprsTimer2V;
}

const GPRSTimerV_template& GPRSTimer2TLV_template::gprsTimer2V() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsTimer2V of a non-specific template of type @MobileL3_GMM_SM_Types.GPRSTimer2TLV.");
return single_value->field_gprsTimer2V;
}

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

void GPRSTimer2TLV_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(", gprsTimer2V := ");
single_value->field_gprsTimer2V.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 GPRSTimer2TLV_template::log_match(const GPRSTimer2TLV& 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_gprsTimer2V.match(match_value.gprsTimer2V(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsTimer2V");
single_value->field_gprsTimer2V.log_match(match_value.gprsTimer2V(), 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(", gprsTimer2V := ");
single_value->field_gprsTimer2V.log_match(match_value.gprsTimer2V(), 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 GPRSTimer2TLV_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_gprsTimer2V.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.GPRSTimer2TLV.");
}
}

void GPRSTimer2TLV_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_gprsTimer2V.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 GPRSTimer2TLV_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.GPRSTimer2TLV.");
}
}

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

void GPRSTimer2TLV_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.GPRSTimer2TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
single_value->field_gprsTimer2V.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.GPRSTimer2TLV");
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.GPRSTimer2TLV");
}

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

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

RadioPriority2V::RadioPriority2V()
{
}

RadioPriority2V::RadioPriority2V(const BITSTRING& par_priorityLevelValue,
    const BITSTRING& par_spare)
  :   field_priorityLevelValue(par_priorityLevelValue),
  field_spare(par_spare)
{
}

RadioPriority2V::RadioPriority2V(const RadioPriority2V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
else field_priorityLevelValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void RadioPriority2V::clean_up()
{
field_priorityLevelValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriority2V::get_descriptor() const { return &RadioPriority2V_descr_; }
RadioPriority2V& RadioPriority2V::operator=(const RadioPriority2V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
  if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
  else field_priorityLevelValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean RadioPriority2V::operator==(const RadioPriority2V& other_value) const
{
return field_priorityLevelValue==other_value.field_priorityLevelValue
  && field_spare==other_value.field_spare;
}

boolean RadioPriority2V::is_bound() const
{
return (field_priorityLevelValue.is_bound())
  || (field_spare.is_bound());
}
boolean RadioPriority2V::is_value() const
{
return field_priorityLevelValue.is_value()
  && field_spare.is_value();
}
void RadioPriority2V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
field_priorityLevelValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriority2V::set_implicit_omit()
{
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriority2V::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.RadioPriority2V 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) priorityLevelValue().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(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.RadioPriority2V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriority2V");
  }
}

void RadioPriority2V::encode_text(Text_Buf& text_buf) const
{
field_priorityLevelValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void RadioPriority2V::decode_text(Text_Buf& text_buf)
{
field_priorityLevelValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void RadioPriority2V::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 RadioPriority2V::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 RadioPriority2V::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_priorityLevelValue.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 RadioPriority2V::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_priorityLevelValue.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 RadioPriority2V_template::single_value_struct {
BITSTRING_template field_priorityLevelValue;
BITSTRING_template field_spare;
};

void RadioPriority2V_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_priorityLevelValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void RadioPriority2V_template::copy_value(const RadioPriority2V& other_value)
{
single_value = new single_value_struct;
if (other_value.priorityLevelValue().is_bound()) {
  single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
  single_value->field_priorityLevelValue.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 RadioPriority2V_template::copy_template(const RadioPriority2V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.priorityLevelValue().get_selection()) {
single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
single_value->field_priorityLevelValue.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 RadioPriority2V_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 RadioPriority2V_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriority2V_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.RadioPriority2V.");
break;
}
set_selection(other_value);
}

RadioPriority2V_template::RadioPriority2V_template()
{
}

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

RadioPriority2V_template::RadioPriority2V_template(const RadioPriority2V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RadioPriority2V_template::match(const RadioPriority2V& 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.priorityLevelValue().is_bound()) return FALSE;
if(!single_value->field_priorityLevelValue.match(other_value.priorityLevelValue(), 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.RadioPriority2V.");
}
return FALSE;
}

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

boolean RadioPriority2V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_priorityLevelValue.is_value()
 && single_value->field_spare.is_value();
}

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

RadioPriority2V RadioPriority2V_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.RadioPriority2V.");
RadioPriority2V ret_val;
if (single_value->field_priorityLevelValue.is_bound()) {
ret_val.priorityLevelValue() = single_value->field_priorityLevelValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void RadioPriority2V_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.RadioPriority2V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriority2V_template[list_length];
}

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

BITSTRING_template& RadioPriority2V_template::priorityLevelValue()
{
set_specific();
return single_value->field_priorityLevelValue;
}

const BITSTRING_template& RadioPriority2V_template::priorityLevelValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityLevelValue of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
return single_value->field_priorityLevelValue;
}

BITSTRING_template& RadioPriority2V_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& RadioPriority2V_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
return single_value->field_spare;
}

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

void RadioPriority2V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.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 RadioPriority2V_template::log_match(const RadioPriority2V& 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_priorityLevelValue.match(match_value.priorityLevelValue(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityLevelValue");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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 RadioPriority2V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_priorityLevelValue.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.RadioPriority2V.");
}
}

void RadioPriority2V_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_priorityLevelValue.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 RadioPriority2V_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.RadioPriority2V.");
}
}

void RadioPriority2V_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: {
    RadioPriority2V_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.RadioPriority2V 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) priorityLevelValue().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(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.RadioPriority2V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriority2V_template* precondition = new RadioPriority2V_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriority2V_template* implied_template = new RadioPriority2V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriority2V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriority2V");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriority2V_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_priorityLevelValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2V");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2V");
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.RadioPriority2V");
}

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

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

RadioPriority2TV::RadioPriority2TV()
{
}

RadioPriority2TV::RadioPriority2TV(const RadioPriority2V& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

RadioPriority2TV::RadioPriority2TV(const RadioPriority2TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
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 RadioPriority2TV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriority2TV::get_descriptor() const { return &RadioPriority2TV_descr_; }
RadioPriority2TV& RadioPriority2TV::operator=(const RadioPriority2TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
  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 RadioPriority2TV::operator==(const RadioPriority2TV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RadioPriority2TV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RadioPriority2TV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void RadioPriority2TV::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 RadioPriority2TV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriority2TV::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.RadioPriority2TV 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.RadioPriority2TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriority2TV");
  }
}

void RadioPriority2TV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RadioPriority2TV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void RadioPriority2TV::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 RadioPriority2TV::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 RadioPriority2TV::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, RadioPriority2V_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(RadioPriority2V_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 RadioPriority2TV::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, RadioPriority2V_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(RadioPriority2V_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 RadioPriority2TV_template::single_value_struct {
RadioPriority2V_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void RadioPriority2TV_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 RadioPriority2TV_template::copy_value(const RadioPriority2TV& 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 RadioPriority2TV_template::copy_template(const RadioPriority2TV_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 RadioPriority2TV_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 RadioPriority2TV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriority2TV_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.RadioPriority2TV.");
break;
}
set_selection(other_value);
}

RadioPriority2TV_template::RadioPriority2TV_template()
{
}

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

RadioPriority2TV_template::RadioPriority2TV_template(const RadioPriority2TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RadioPriority2TV_template::match(const RadioPriority2TV& 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.RadioPriority2TV.");
}
return FALSE;
}

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

RadioPriority2TV RadioPriority2TV_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.RadioPriority2TV.");
RadioPriority2TV 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 RadioPriority2TV_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.RadioPriority2TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriority2TV_template[list_length];
}

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

RadioPriority2V_template& RadioPriority2TV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const RadioPriority2V_template& RadioPriority2TV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
return single_value->field_valueField;
}

BITSTRING_template& RadioPriority2TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& RadioPriority2TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
return single_value->field_elementIdentifier;
}

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

void RadioPriority2TV_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 RadioPriority2TV_template::log_match(const RadioPriority2TV& 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 RadioPriority2TV_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.RadioPriority2TV.");
}
}

void RadioPriority2TV_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 RadioPriority2TV_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.RadioPriority2TV.");
}
}

void RadioPriority2TV_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: {
    RadioPriority2TV_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.RadioPriority2TV 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.RadioPriority2TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriority2TV_template* precondition = new RadioPriority2TV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriority2TV_template* implied_template = new RadioPriority2TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriority2TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriority2TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriority2TV_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.RadioPriority2TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2TV");
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.RadioPriority2TV");
}

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

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

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV()
{
}

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mBMSContextStatusInformation)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMSContextStatusInformation(par_mBMSContextStatusInformation)
{
}

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV(const MBMS__ContextStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
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.mBMSContextStatusInformation().is_bound()) field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
else field_mBMSContextStatusInformation.clean_up();
}

void MBMS__ContextStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mBMSContextStatusInformation.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__ContextStatusTLV::get_descriptor() const { return &MBMS__ContextStatusTLV_descr_; }
MBMS__ContextStatusTLV& MBMS__ContextStatusTLV::operator=(const MBMS__ContextStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
  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.mBMSContextStatusInformation().is_bound()) field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
  else field_mBMSContextStatusInformation.clean_up();
}
return *this;
}

boolean MBMS__ContextStatusTLV::operator==(const MBMS__ContextStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mBMSContextStatusInformation==other_value.field_mBMSContextStatusInformation;
}

boolean MBMS__ContextStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMSContextStatusInformation.is_bound());
}
boolean MBMS__ContextStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMSContextStatusInformation.is_value();
}
void MBMS__ContextStatusTLV::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(", mBMSContextStatusInformation := ");
field_mBMSContextStatusInformation.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__ContextStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMSContextStatusInformation().is_bound()) mBMSContextStatusInformation().set_implicit_omit();
}

void MBMS__ContextStatusTLV::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.MBMS_ContextStatusTLV 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) mBMSContextStatusInformation().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(), "mBMSContextStatusInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMSContextStatusInformation().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.MBMS_ContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
  }
}

void MBMS__ContextStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mBMSContextStatusInformation.encode_text(text_buf);
}

void MBMS__ContextStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mBMSContextStatusInformation.decode_text(text_buf);
}

void MBMS__ContextStatusTLV::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 MBMS__ContextStatusTLV::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 MBMS__ContextStatusTLV::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, MBMS__ContextStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__ContextStatusTLV_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(MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.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_21) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__ContextStatusTLV::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, MBMS__ContextStatusTLV_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 = &MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_21) {
  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_21.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 MBMS__ContextStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mBMSContextStatusInformation;
};

void MBMS__ContextStatusTLV_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_mBMSContextStatusInformation = ANY_VALUE;
}
}
}

void MBMS__ContextStatusTLV_template::copy_value(const MBMS__ContextStatusTLV& 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.mBMSContextStatusInformation().is_bound()) {
  single_value->field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
} else {
  single_value->field_mBMSContextStatusInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__ContextStatusTLV_template::copy_template(const MBMS__ContextStatusTLV_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.mBMSContextStatusInformation().get_selection()) {
single_value->field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
} else {
single_value->field_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_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 MBMS__ContextStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__ContextStatusTLV_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.MBMS_ContextStatusTLV.");
break;
}
set_selection(other_value);
}

MBMS__ContextStatusTLV_template::MBMS__ContextStatusTLV_template()
{
}

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

MBMS__ContextStatusTLV_template::MBMS__ContextStatusTLV_template(const MBMS__ContextStatusTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__ContextStatusTLV_template::match(const MBMS__ContextStatusTLV& 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.mBMSContextStatusInformation().is_bound()) return FALSE;
if(!single_value->field_mBMSContextStatusInformation.match(other_value.mBMSContextStatusInformation(), 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.MBMS_ContextStatusTLV.");
}
return FALSE;
}

boolean MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.is_bound();
}

boolean MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.is_value();
}

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

MBMS__ContextStatusTLV MBMS__ContextStatusTLV_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.MBMS_ContextStatusTLV.");
MBMS__ContextStatusTLV 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_mBMSContextStatusInformation.is_bound()) {
ret_val.mBMSContextStatusInformation() = single_value->field_mBMSContextStatusInformation.valueof();
}
return ret_val;
}

void MBMS__ContextStatusTLV_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.MBMS_ContextStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MBMS__ContextStatusTLV_template[list_length];
}

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

OCTETSTRING_template& MBMS__ContextStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& MBMS__ContextStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& MBMS__ContextStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MBMS__ContextStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MBMS__ContextStatusTLV_template::mBMSContextStatusInformation()
{
set_specific();
return single_value->field_mBMSContextStatusInformation;
}

const OCTETSTRING_template& MBMS__ContextStatusTLV_template::mBMSContextStatusInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMSContextStatusInformation of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_mBMSContextStatusInformation;
}

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

void MBMS__ContextStatusTLV_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(", mBMSContextStatusInformation := ");
single_value->field_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_template::log_match(const MBMS__ContextStatusTLV& 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_mBMSContextStatusInformation.match(match_value.mBMSContextStatusInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMSContextStatusInformation");
single_value->field_mBMSContextStatusInformation.log_match(match_value.mBMSContextStatusInformation(), 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(", mBMSContextStatusInformation := ");
single_value->field_mBMSContextStatusInformation.log_match(match_value.mBMSContextStatusInformation(), 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 MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.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.MBMS_ContextStatusTLV.");
}
}

void MBMS__ContextStatusTLV_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_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_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.MBMS_ContextStatusTLV.");
}
}

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

void MBMS__ContextStatusTLV_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.MBMS_ContextStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
single_value->field_mBMSContextStatusInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
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.MBMS_ContextStatusTLV");
}

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

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

UplinkDataStatusV::UplinkDataStatusV()
{
}

UplinkDataStatusV::UplinkDataStatusV(const BITSTRING& par_spare,
    const BITSTRING& par_nSAPI__5__to__7,
    const BITSTRING& par_nSAPI__8__to__15)
  :   field_spare(par_spare),
  field_nSAPI__5__to__7(par_nSAPI__5__to__7),
  field_nSAPI__8__to__15(par_nSAPI__8__to__15)
{
}

UplinkDataStatusV::UplinkDataStatusV(const UplinkDataStatusV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.nSAPI__5__to__7().is_bound()) field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
else field_nSAPI__5__to__7.clean_up();
if (other_value.nSAPI__8__to__15().is_bound()) field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
else field_nSAPI__8__to__15.clean_up();
}

void UplinkDataStatusV::clean_up()
{
field_spare.clean_up();
field_nSAPI__5__to__7.clean_up();
field_nSAPI__8__to__15.clean_up();
}

const TTCN_Typedescriptor_t* UplinkDataStatusV::get_descriptor() const { return &UplinkDataStatusV_descr_; }
UplinkDataStatusV& UplinkDataStatusV::operator=(const UplinkDataStatusV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.nSAPI__5__to__7().is_bound()) field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
  else field_nSAPI__5__to__7.clean_up();
  if (other_value.nSAPI__8__to__15().is_bound()) field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
  else field_nSAPI__8__to__15.clean_up();
}
return *this;
}

boolean UplinkDataStatusV::operator==(const UplinkDataStatusV& other_value) const
{
return field_spare==other_value.field_spare
  && field_nSAPI__5__to__7==other_value.field_nSAPI__5__to__7
  && field_nSAPI__8__to__15==other_value.field_nSAPI__8__to__15;
}

boolean UplinkDataStatusV::is_bound() const
{
return (field_spare.is_bound())
  || (field_nSAPI__5__to__7.is_bound())
  || (field_nSAPI__8__to__15.is_bound());
}
boolean UplinkDataStatusV::is_value() const
{
return field_spare.is_value()
  && field_nSAPI__5__to__7.is_value()
  && field_nSAPI__8__to__15.is_value();
}
void UplinkDataStatusV::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(", nSAPI_5_to_7 := ");
field_nSAPI__5__to__7.log();
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
field_nSAPI__8__to__15.log();
TTCN_Logger::log_event_str(" }");
}

void UplinkDataStatusV::set_implicit_omit()
{
if (spare().is_bound()) spare().set_implicit_omit();
if (nSAPI__5__to__7().is_bound()) nSAPI__5__to__7().set_implicit_omit();
if (nSAPI__8__to__15().is_bound()) nSAPI__8__to__15().set_implicit_omit();
}

void UplinkDataStatusV::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.UplinkDataStatusV 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) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nSAPI__5__to__7().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) nSAPI__8__to__15().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(), "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(), "nSAPI_5_to_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__5__to__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_8_to_15")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__8__to__15().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.UplinkDataStatusV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
  }
}

void UplinkDataStatusV::encode_text(Text_Buf& text_buf) const
{
field_spare.encode_text(text_buf);
field_nSAPI__5__to__7.encode_text(text_buf);
field_nSAPI__8__to__15.encode_text(text_buf);
}

void UplinkDataStatusV::decode_text(Text_Buf& text_buf)
{
field_spare.decode_text(text_buf);
field_nSAPI__5__to__7.decode_text(text_buf);
field_nSAPI__8__to__15.decode_text(text_buf);
}

void UplinkDataStatusV::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 UplinkDataStatusV::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 UplinkDataStatusV::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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_nSAPI__5__to__7.RAW_decode(General__Types::BIT3_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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_nSAPI__8__to__15.RAW_decode(General__Types::BIT8_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 UplinkDataStatusV::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::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT8_descr_.raw);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nSAPI__5__to__7.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_nSAPI__8__to__15.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct UplinkDataStatusV_template::single_value_struct {
BITSTRING_template field_spare;
BITSTRING_template field_nSAPI__5__to__7;
BITSTRING_template field_nSAPI__8__to__15;
};

void UplinkDataStatusV_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_nSAPI__5__to__7 = ANY_VALUE;
single_value->field_nSAPI__8__to__15 = ANY_VALUE;
}
}
}

void UplinkDataStatusV_template::copy_value(const UplinkDataStatusV& 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.nSAPI__5__to__7().is_bound()) {
  single_value->field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
} else {
  single_value->field_nSAPI__5__to__7.clean_up();
}
if (other_value.nSAPI__8__to__15().is_bound()) {
  single_value->field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
} else {
  single_value->field_nSAPI__8__to__15.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UplinkDataStatusV_template::copy_template(const UplinkDataStatusV_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.nSAPI__5__to__7().get_selection()) {
single_value->field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
} else {
single_value->field_nSAPI__5__to__7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSAPI__8__to__15().get_selection()) {
single_value->field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
} else {
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_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 UplinkDataStatusV_template(*other_value.implication_.precondition);
implication_.implied_template = new UplinkDataStatusV_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.UplinkDataStatusV.");
break;
}
set_selection(other_value);
}

UplinkDataStatusV_template::UplinkDataStatusV_template()
{
}

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

UplinkDataStatusV_template::UplinkDataStatusV_template(const UplinkDataStatusV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean UplinkDataStatusV_template::match(const UplinkDataStatusV& 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.nSAPI__5__to__7().is_bound()) return FALSE;
if(!single_value->field_nSAPI__5__to__7.match(other_value.nSAPI__5__to__7(), legacy))return FALSE;
if(!other_value.nSAPI__8__to__15().is_bound()) return FALSE;
if(!single_value->field_nSAPI__8__to__15.match(other_value.nSAPI__8__to__15(), 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.UplinkDataStatusV.");
}
return FALSE;
}

boolean UplinkDataStatusV_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_nSAPI__5__to__7.is_bound()
 || single_value->field_nSAPI__8__to__15.is_bound();
}

boolean UplinkDataStatusV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_spare.is_value()
 && single_value->field_nSAPI__5__to__7.is_value()
 && single_value->field_nSAPI__8__to__15.is_value();
}

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

UplinkDataStatusV UplinkDataStatusV_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.UplinkDataStatusV.");
UplinkDataStatusV ret_val;
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_nSAPI__5__to__7.is_bound()) {
ret_val.nSAPI__5__to__7() = single_value->field_nSAPI__5__to__7.valueof();
}
if (single_value->field_nSAPI__8__to__15.is_bound()) {
ret_val.nSAPI__8__to__15() = single_value->field_nSAPI__8__to__15.valueof();
}
return ret_val;
}

void UplinkDataStatusV_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.UplinkDataStatusV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UplinkDataStatusV_template[list_length];
}

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

BITSTRING_template& UplinkDataStatusV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& UplinkDataStatusV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_spare;
}

BITSTRING_template& UplinkDataStatusV_template::nSAPI__5__to__7()
{
set_specific();
return single_value->field_nSAPI__5__to__7;
}

const BITSTRING_template& UplinkDataStatusV_template::nSAPI__5__to__7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSAPI_5_to_7 of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_nSAPI__5__to__7;
}

BITSTRING_template& UplinkDataStatusV_template::nSAPI__8__to__15()
{
set_specific();
return single_value->field_nSAPI__8__to__15;
}

const BITSTRING_template& UplinkDataStatusV_template::nSAPI__8__to__15() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSAPI_8_to_15 of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_nSAPI__8__to__15;
}

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

void UplinkDataStatusV_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(", nSAPI_5_to_7 := ");
single_value->field_nSAPI__5__to__7.log();
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_template::log_match(const UplinkDataStatusV& 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_nSAPI__5__to__7.match(match_value.nSAPI__5__to__7(), legacy)){
TTCN_Logger::log_logmatch_info(".nSAPI_5_to_7");
single_value->field_nSAPI__5__to__7.log_match(match_value.nSAPI__5__to__7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nSAPI__8__to__15.match(match_value.nSAPI__8__to__15(), legacy)){
TTCN_Logger::log_logmatch_info(".nSAPI_8_to_15");
single_value->field_nSAPI__8__to__15.log_match(match_value.nSAPI__8__to__15(), 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(", nSAPI_5_to_7 := ");
single_value->field_nSAPI__5__to__7.log_match(match_value.nSAPI__5__to__7(), legacy);
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
single_value->field_nSAPI__8__to__15.log_match(match_value.nSAPI__8__to__15(), 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 UplinkDataStatusV_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_nSAPI__5__to__7.encode_text(text_buf);
single_value->field_nSAPI__8__to__15.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.UplinkDataStatusV.");
}
}

void UplinkDataStatusV_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_nSAPI__5__to__7.decode_text(text_buf);
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_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.UplinkDataStatusV.");
}
}

void UplinkDataStatusV_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: {
    UplinkDataStatusV_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.UplinkDataStatusV 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) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nSAPI__5__to__7().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) nSAPI__8__to__15().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(), "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(), "nSAPI_5_to_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__5__to__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_8_to_15")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__8__to__15().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.UplinkDataStatusV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UplinkDataStatusV_template* precondition = new UplinkDataStatusV_template;
    precondition->set_param(*param.get_elem(0));
    UplinkDataStatusV_template* implied_template = new UplinkDataStatusV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UplinkDataStatusV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UplinkDataStatusV_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.UplinkDataStatusV");
single_value->field_nSAPI__5__to__7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
single_value->field_nSAPI__8__to__15.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
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.UplinkDataStatusV");
}

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

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

UplinkDataStatusTLV::UplinkDataStatusTLV()
{
}

UplinkDataStatusTLV::UplinkDataStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const UplinkDataStatusV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

UplinkDataStatusTLV::UplinkDataStatusTLV(const UplinkDataStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
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.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void UplinkDataStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* UplinkDataStatusTLV::get_descriptor() const { return &UplinkDataStatusTLV_descr_; }
UplinkDataStatusTLV& UplinkDataStatusTLV::operator=(const UplinkDataStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
  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.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean UplinkDataStatusTLV::operator==(const UplinkDataStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valueField==other_value.field_valueField;
}

boolean UplinkDataStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean UplinkDataStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void UplinkDataStatusTLV::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(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void UplinkDataStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void UplinkDataStatusTLV::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.UplinkDataStatusTLV 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) valueField().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(), "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.UplinkDataStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
  }
}

void UplinkDataStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void UplinkDataStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

void UplinkDataStatusTLV::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 UplinkDataStatusTLV::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 UplinkDataStatusTLV::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, UplinkDataStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(UplinkDataStatusTLV_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(UplinkDataStatusTLV_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, UplinkDataStatusV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(UplinkDataStatusV_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_20) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UplinkDataStatusTLV::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, UplinkDataStatusTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, UplinkDataStatusV_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 = &UplinkDataStatusTLV_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_valueField.RAW_encode(UplinkDataStatusV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_20) {
  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_20.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 UplinkDataStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
UplinkDataStatusV_template field_valueField;
};

void UplinkDataStatusTLV_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_valueField = ANY_VALUE;
}
}
}

void UplinkDataStatusTLV_template::copy_value(const UplinkDataStatusTLV& 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.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UplinkDataStatusTLV_template::copy_template(const UplinkDataStatusTLV_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.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 UplinkDataStatusTLV_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 UplinkDataStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new UplinkDataStatusTLV_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.UplinkDataStatusTLV.");
break;
}
set_selection(other_value);
}

UplinkDataStatusTLV_template::UplinkDataStatusTLV_template()
{
}

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

UplinkDataStatusTLV_template::UplinkDataStatusTLV_template(const UplinkDataStatusTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean UplinkDataStatusTLV_template::match(const UplinkDataStatusTLV& 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.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.UplinkDataStatusTLV.");
}
return FALSE;
}

boolean UplinkDataStatusTLV_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_valueField.is_bound();
}

boolean UplinkDataStatusTLV_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_valueField.is_value();
}

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

UplinkDataStatusTLV UplinkDataStatusTLV_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.UplinkDataStatusTLV.");
UplinkDataStatusTLV 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_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void UplinkDataStatusTLV_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.UplinkDataStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UplinkDataStatusTLV_template[list_length];
}

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

OCTETSTRING_template& UplinkDataStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& UplinkDataStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& UplinkDataStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& UplinkDataStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_lengthIndicator;
}

UplinkDataStatusV_template& UplinkDataStatusTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const UplinkDataStatusV_template& UplinkDataStatusTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_valueField;
}

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

void UplinkDataStatusTLV_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(", 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 UplinkDataStatusTLV_template::log_match(const UplinkDataStatusTLV& 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_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("{ 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(", 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 UplinkDataStatusTLV_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_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.UplinkDataStatusTLV.");
}
}

void UplinkDataStatusTLV_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_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 UplinkDataStatusTLV_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.UplinkDataStatusTLV.");
}
}

void UplinkDataStatusTLV_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: {
    UplinkDataStatusTLV_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.UplinkDataStatusTLV 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) valueField().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(), "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.UplinkDataStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UplinkDataStatusTLV_template* precondition = new UplinkDataStatusTLV_template;
    precondition->set_param(*param.get_elem(0));
    UplinkDataStatusTLV_template* implied_template = new UplinkDataStatusTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UplinkDataStatusTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UplinkDataStatusTLV_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.UplinkDataStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
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.UplinkDataStatusTLV");
}

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

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

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest()
{
}

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest(const BITSTRING& par_messageType,
    const MSNetworkCapabilityLV& par_msNetworkCapability,
    const AttachTypeV& par_attachType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_gprsCKSN,
    const DRXParameterV& par_drxParam,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const RoutingAreaIdentificationV& par_oldRoutingAreaID,
    const MSRadioAccessCapabilityLV& par_msRACap,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< GPRSTimerTV >& par_reqGPRStimer,
    const OPTIONAL< TMSIStatusTV >& par_tmsiStatus,
    const OPTIONAL< PC__LCSCapability >& par_pC__LCSCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark2__TLV >& par_mobileStationClassmark2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark3__TLV >& par_mobileStationClassmark3,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< UENetworkCapabilityTLV >& par_uENetworkCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_additionalMobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV >& par_routingAreaIdentification2,
    const OPTIONAL< VoiceDomainPreferenceandUEsUsageSettingTLV >& par_voiceDomainandUEsUsageSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSI__TypeTV >& par_p__TMSI__Type,
    const OPTIONAL< MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV >& par_mS__NetworkFeatureSupport,
    const OPTIONAL< LocationAreaIdentification2__TLV >& par_oldLocationAreaIdentification,
    const OPTIONAL< AdditionalUpdateTypeTV >& par_additionalUpdateType,
    const OPTIONAL< NetworkResourceIdentifierContainerTLV >& par_tMSIBasedNRIcontainer,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_msNetworkCapability(par_msNetworkCapability),
  field_attachType(par_attachType),
  field_gprsCKSN(par_gprsCKSN),
  field_drxParam(par_drxParam),
  field_mobileIdentity(par_mobileIdentity),
  field_oldRoutingAreaID(par_oldRoutingAreaID),
  field_msRACap(par_msRACap),
  field_ptmsiSignature(par_ptmsiSignature),
  field_reqGPRStimer(par_reqGPRStimer),
  field_tmsiStatus(par_tmsiStatus),
  field_pC__LCSCapability(par_pC__LCSCapability),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileStationClassmark3(par_mobileStationClassmark3),
  field_supportedCodecs(par_supportedCodecs),
  field_uENetworkCapability(par_uENetworkCapability),
  field_additionalMobileIdentity(par_additionalMobileIdentity),
  field_routingAreaIdentification2(par_routingAreaIdentification2),
  field_voiceDomainandUEsUsageSetting(par_voiceDomainandUEsUsageSetting),
  field_deviceProperties(par_deviceProperties),
  field_p__TMSI__Type(par_p__TMSI__Type),
  field_mS__NetworkFeatureSupport(par_mS__NetworkFeatureSupport),
  field_oldLocationAreaIdentification(par_oldLocationAreaIdentification),
  field_additionalUpdateType(par_additionalUpdateType),
  field_tMSIBasedNRIcontainer(par_tMSIBasedNRIcontainer),
  field_t3324(par_t3324),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest(const PDU__GMM__AttachRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.msNetworkCapability().is_bound()) field_msNetworkCapability = other_value.msNetworkCapability();
else field_msNetworkCapability.clean_up();
if (other_value.attachType().is_bound()) field_attachType = other_value.attachType();
else field_attachType.clean_up();
if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
else field_gprsCKSN.clean_up();
if (other_value.drxParam().is_bound()) field_drxParam = other_value.drxParam();
else field_drxParam.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
if (other_value.oldRoutingAreaID().is_bound()) field_oldRoutingAreaID = other_value.oldRoutingAreaID();
else field_oldRoutingAreaID.clean_up();
if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
else field_msRACap.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.reqGPRStimer().is_bound()) field_reqGPRStimer = other_value.reqGPRStimer();
else field_reqGPRStimer.clean_up();
if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
else field_tmsiStatus.clean_up();
if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
else field_pC__LCSCapability.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
else field_mobileStationClassmark3.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
else field_uENetworkCapability.clean_up();
if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
else field_additionalMobileIdentity.clean_up();
if (other_value.routingAreaIdentification2().is_bound()) field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
else field_routingAreaIdentification2.clean_up();
if (other_value.voiceDomainandUEsUsageSetting().is_bound()) field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
else field_voiceDomainandUEsUsageSetting.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
else field_p__TMSI__Type.clean_up();
if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
else field_mS__NetworkFeatureSupport.clean_up();
if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
else field_oldLocationAreaIdentification.clean_up();
if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
else field_additionalUpdateType.clean_up();
if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
else field_tMSIBasedNRIcontainer.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__AttachRequest::clean_up()
{
field_messageType.clean_up();
field_msNetworkCapability.clean_up();
field_attachType.clean_up();
field_gprsCKSN.clean_up();
field_drxParam.clean_up();
field_mobileIdentity.clean_up();
field_oldRoutingAreaID.clean_up();
field_msRACap.clean_up();
field_ptmsiSignature.clean_up();
field_reqGPRStimer.clean_up();
field_tmsiStatus.clean_up();
field_pC__LCSCapability.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileStationClassmark3.clean_up();
field_supportedCodecs.clean_up();
field_uENetworkCapability.clean_up();
field_additionalMobileIdentity.clean_up();
field_routingAreaIdentification2.clean_up();
field_voiceDomainandUEsUsageSetting.clean_up();
field_deviceProperties.clean_up();
field_p__TMSI__Type.clean_up();
field_mS__NetworkFeatureSupport.clean_up();
field_oldLocationAreaIdentification.clean_up();
field_additionalUpdateType.clean_up();
field_tMSIBasedNRIcontainer.clean_up();
field_t3324.clean_up();
field_t3312__ExtendedValue.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachRequest::get_descriptor() const { return &PDU__GMM__AttachRequest_descr_; }
PDU__GMM__AttachRequest& PDU__GMM__AttachRequest::operator=(const PDU__GMM__AttachRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.msNetworkCapability().is_bound()) field_msNetworkCapability = other_value.msNetworkCapability();
  else field_msNetworkCapability.clean_up();
  if (other_value.attachType().is_bound()) field_attachType = other_value.attachType();
  else field_attachType.clean_up();
  if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
  else field_gprsCKSN.clean_up();
  if (other_value.drxParam().is_bound()) field_drxParam = other_value.drxParam();
  else field_drxParam.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
  if (other_value.oldRoutingAreaID().is_bound()) field_oldRoutingAreaID = other_value.oldRoutingAreaID();
  else field_oldRoutingAreaID.clean_up();
  if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
  else field_msRACap.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.reqGPRStimer().is_bound()) field_reqGPRStimer = other_value.reqGPRStimer();
  else field_reqGPRStimer.clean_up();
  if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
  else field_tmsiStatus.clean_up();
  if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
  else field_pC__LCSCapability.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
  else field_mobileStationClassmark3.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
  else field_uENetworkCapability.clean_up();
  if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
  else field_additionalMobileIdentity.clean_up();
  if (other_value.routingAreaIdentification2().is_bound()) field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
  else field_routingAreaIdentification2.clean_up();
  if (other_value.voiceDomainandUEsUsageSetting().is_bound()) field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
  else field_voiceDomainandUEsUsageSetting.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
  else field_p__TMSI__Type.clean_up();
  if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
  else field_mS__NetworkFeatureSupport.clean_up();
  if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
  else field_oldLocationAreaIdentification.clean_up();
  if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
  else field_additionalUpdateType.clean_up();
  if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
  else field_tMSIBasedNRIcontainer.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachRequest::operator==(const PDU__GMM__AttachRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_msNetworkCapability==other_value.field_msNetworkCapability
  && field_attachType==other_value.field_attachType
  && field_gprsCKSN==other_value.field_gprsCKSN
  && field_drxParam==other_value.field_drxParam
  && field_mobileIdentity==other_value.field_mobileIdentity
  && field_oldRoutingAreaID==other_value.field_oldRoutingAreaID
  && field_msRACap==other_value.field_msRACap
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_reqGPRStimer==other_value.field_reqGPRStimer
  && field_tmsiStatus==other_value.field_tmsiStatus
  && field_pC__LCSCapability==other_value.field_pC__LCSCapability
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileStationClassmark3==other_value.field_mobileStationClassmark3
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_uENetworkCapability==other_value.field_uENetworkCapability
  && field_additionalMobileIdentity==other_value.field_additionalMobileIdentity
  && field_routingAreaIdentification2==other_value.field_routingAreaIdentification2
  && field_voiceDomainandUEsUsageSetting==other_value.field_voiceDomainandUEsUsageSetting
  && field_deviceProperties==other_value.field_deviceProperties
  && field_p__TMSI__Type==other_value.field_p__TMSI__Type
  && field_mS__NetworkFeatureSupport==other_value.field_mS__NetworkFeatureSupport
  && field_oldLocationAreaIdentification==other_value.field_oldLocationAreaIdentification
  && field_additionalUpdateType==other_value.field_additionalUpdateType
  && field_tMSIBasedNRIcontainer==other_value.field_tMSIBasedNRIcontainer
  && field_t3324==other_value.field_t3324
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__AttachRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_msNetworkCapability.is_bound())
  || (field_attachType.is_bound())
  || (field_gprsCKSN.is_bound())
  || (field_drxParam.is_bound())
  || (field_mobileIdentity.is_bound())
  || (field_oldRoutingAreaID.is_bound())
  || (field_msRACap.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_reqGPRStimer.get_selection() || field_reqGPRStimer.is_bound())
  || (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_bound())
  || (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_routingAreaIdentification2.get_selection() || field_routingAreaIdentification2.is_bound())
  || (OPTIONAL_OMIT == field_voiceDomainandUEsUsageSetting.get_selection() || field_voiceDomainandUEsUsageSetting.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_bound())
  || (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_bound())
  || (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__AttachRequest::is_value() const
{
return field_messageType.is_value()
  && field_msNetworkCapability.is_value()
  && field_attachType.is_value()
  && field_gprsCKSN.is_value()
  && field_drxParam.is_value()
  && field_mobileIdentity.is_value()
  && field_oldRoutingAreaID.is_value()
  && field_msRACap.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_reqGPRStimer.get_selection() || field_reqGPRStimer.is_value())
  && (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_value())
  && (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_value())
  && (OPTIONAL_OMIT == field_routingAreaIdentification2.get_selection() || field_routingAreaIdentification2.is_value())
  && (OPTIONAL_OMIT == field_voiceDomainandUEsUsageSetting.get_selection() || field_voiceDomainandUEsUsageSetting.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_value())
  && (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_value())
  && (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__AttachRequest::size_of() const
{
  int ret_val = 8;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_reqGPRStimer.ispresent()) ret_val++;
  if (field_tmsiStatus.ispresent()) ret_val++;
  if (field_pC__LCSCapability.ispresent()) ret_val++;
  if (field_mobileStationClassmark2.ispresent()) ret_val++;
  if (field_mobileStationClassmark3.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_uENetworkCapability.ispresent()) ret_val++;
  if (field_additionalMobileIdentity.ispresent()) ret_val++;
  if (field_routingAreaIdentification2.ispresent()) ret_val++;
  if (field_voiceDomainandUEsUsageSetting.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_p__TMSI__Type.ispresent()) ret_val++;
  if (field_mS__NetworkFeatureSupport.ispresent()) ret_val++;
  if (field_oldLocationAreaIdentification.ispresent()) ret_val++;
  if (field_additionalUpdateType.ispresent()) ret_val++;
  if (field_tMSIBasedNRIcontainer.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", msNetworkCapability := ");
field_msNetworkCapability.log();
TTCN_Logger::log_event_str(", attachType := ");
field_attachType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
field_gprsCKSN.log();
TTCN_Logger::log_event_str(", drxParam := ");
field_drxParam.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
field_oldRoutingAreaID.log();
TTCN_Logger::log_event_str(", msRACap := ");
field_msRACap.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", reqGPRStimer := ");
field_reqGPRStimer.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
field_tmsiStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (msNetworkCapability().is_bound()) msNetworkCapability().set_implicit_omit();
if (attachType().is_bound()) attachType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (drxParam().is_bound()) drxParam().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (oldRoutingAreaID().is_bound()) oldRoutingAreaID().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!reqGPRStimer().is_bound()) reqGPRStimer() = OMIT_VALUE;
else reqGPRStimer().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!routingAreaIdentification2().is_bound()) routingAreaIdentification2() = OMIT_VALUE;
else routingAreaIdentification2().set_implicit_omit();
if (!voiceDomainandUEsUsageSetting().is_bound()) voiceDomainandUEsUsageSetting() = OMIT_VALUE;
else voiceDomainandUEsUsageSetting().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachRequest::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 (28<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest has 28 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msNetworkCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) attachType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) drxParam().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) reqGPRStimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) voiceDomainandUEsUsageSetting().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(27));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParam().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reqGPRStimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reqGPRStimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainandUEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainandUEsUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_AttachRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
  }
}

void PDU__GMM__AttachRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_msNetworkCapability.encode_text(text_buf);
field_attachType.encode_text(text_buf);
field_gprsCKSN.encode_text(text_buf);
field_drxParam.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
field_oldRoutingAreaID.encode_text(text_buf);
field_msRACap.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_reqGPRStimer.encode_text(text_buf);
field_tmsiStatus.encode_text(text_buf);
field_pC__LCSCapability.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileStationClassmark3.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_uENetworkCapability.encode_text(text_buf);
field_additionalMobileIdentity.encode_text(text_buf);
field_routingAreaIdentification2.encode_text(text_buf);
field_voiceDomainandUEsUsageSetting.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_p__TMSI__Type.encode_text(text_buf);
field_mS__NetworkFeatureSupport.encode_text(text_buf);
field_oldLocationAreaIdentification.encode_text(text_buf);
field_additionalUpdateType.encode_text(text_buf);
field_tMSIBasedNRIcontainer.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__AttachRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_msNetworkCapability.decode_text(text_buf);
field_attachType.decode_text(text_buf);
field_gprsCKSN.decode_text(text_buf);
field_drxParam.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
field_oldRoutingAreaID.decode_text(text_buf);
field_msRACap.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_reqGPRStimer.decode_text(text_buf);
field_tmsiStatus.decode_text(text_buf);
field_pC__LCSCapability.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileStationClassmark3.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_uENetworkCapability.decode_text(text_buf);
field_additionalMobileIdentity.decode_text(text_buf);
field_routingAreaIdentification2.decode_text(text_buf);
field_voiceDomainandUEsUsageSetting.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_p__TMSI__Type.decode_text(text_buf);
field_mS__NetworkFeatureSupport.decode_text(text_buf);
field_oldLocationAreaIdentification.decode_text(text_buf);
field_additionalUpdateType.decode_text(text_buf);
field_tMSIBasedNRIcontainer.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__AttachRequest::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 PDU__GMM__AttachRequest::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 PDU__GMM__AttachRequest::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_messageType.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, MSNetworkCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msNetworkCapability.RAW_decode(MSNetworkCapabilityLV_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, AttachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_attachType.RAW_decode(AttachTypeV_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, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_gprsCKSN.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, DRXParameterV_descr_.raw->forceomit);
  decoded_field_length = field_drxParam.RAW_decode(DRXParameterV_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaID.RAW_decode(RoutingAreaIdentificationV_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, MSRadioAccessCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msRACap.RAW_decode(MSRadioAccessCapabilityLV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_reqGPRStimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_reqGPRStimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_reqGPRStimer = 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_reqGPRStimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_tmsiStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, TMSIStatusTV_descr_.raw->forceomit);
  decoded_field_length = field_tmsiStatus().RAW_decode(TMSIStatusTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_tmsiStatus = 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_tmsiStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_pC__LCSCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, PC__LCSCapability_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapability().RAW_decode(PC__LCSCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_pC__LCSCapability = 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_pC__LCSCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_mobileStationClassmark2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2 = 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_mobileStationClassmark2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_mobileStationClassmark3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark3().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark3 = 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_mobileStationClassmark3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_supportedCodecs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = 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_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_uENetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, UENetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapability().RAW_decode(UENetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_uENetworkCapability = 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_uENetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_additionalMobileIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalMobileIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_additionalMobileIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23){
  field_additionalMobileIdentity=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_additionalMobileIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_routingAreaIdentification2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification2().RAW_decode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_routingAreaIdentification2 = 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_routingAreaIdentification2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_voiceDomainandUEsUsageSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw->forceomit);
  decoded_field_length = field_voiceDomainandUEsUsageSetting().RAW_decode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_voiceDomainandUEsUsageSetting = 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_voiceDomainandUEsUsageSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_p__TMSI__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI__Type().RAW_decode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI__Type = 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_p__TMSI__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_mS__NetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_mS__NetworkFeatureSupport().RAW_decode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_mS__NetworkFeatureSupport = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21){
  field_mS__NetworkFeatureSupport=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_mS__NetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_oldLocationAreaIdentification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, LocationAreaIdentification2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldLocationAreaIdentification().RAW_decode(LocationAreaIdentification2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_oldLocationAreaIdentification = 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_oldLocationAreaIdentification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_additionalUpdateType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, AdditionalUpdateTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateType().RAW_decode(AdditionalUpdateTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateType = 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_additionalUpdateType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_tMSIBasedNRIcontainer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, NetworkResourceIdentifierContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_tMSIBasedNRIcontainer().RAW_decode(NetworkResourceIdentifierContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_tMSIBasedNRIcontainer = 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_tMSIBasedNRIcontainer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_22) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AttachRequest::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 = 28;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(28);
  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, MSNetworkCapabilityLV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AttachTypeV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, DRXParameterV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MSRadioAccessCapabilityLV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_reqGPRStimer.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_tmsiStatus.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, TMSIStatusTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_pC__LCSCapability.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PC__LCSCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_mobileStationClassmark2.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_mobileStationClassmark3.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_uENetworkCapability.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, UENetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_additionalMobileIdentity.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_routingAreaIdentification2.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_voiceDomainandUEsUsageSetting.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_p__TMSI__Type.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_oldLocationAreaIdentification.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, LocationAreaIdentification2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_additionalUpdateType.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, AdditionalUpdateTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, NetworkResourceIdentifierContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_msNetworkCapability.RAW_encode(MSNetworkCapabilityLV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_attachType.RAW_encode(AttachTypeV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gprsCKSN.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_drxParam.RAW_encode(DRXParameterV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_oldRoutingAreaID.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_msRACap.RAW_encode(MSRadioAccessCapabilityLV_descr_, *myleaf.body.node.nodes[7]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_reqGPRStimer.ispresent()) {
  encoded_length += field_reqGPRStimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_tmsiStatus.ispresent()) {
  encoded_length += field_tmsiStatus().RAW_encode(TMSIStatusTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_pC__LCSCapability.ispresent()) {
  encoded_length += field_pC__LCSCapability().RAW_encode(PC__LCSCapability_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_mobileStationClassmark2.ispresent()) {
  encoded_length += field_mobileStationClassmark2().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_mobileStationClassmark3.ispresent()) {
  encoded_length += field_mobileStationClassmark3().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_uENetworkCapability.ispresent()) {
  encoded_length += field_uENetworkCapability().RAW_encode(UENetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_additionalMobileIdentity.ispresent()) {
  encoded_length += field_additionalMobileIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_routingAreaIdentification2.ispresent()) {
  encoded_length += field_routingAreaIdentification2().RAW_encode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_voiceDomainandUEsUsageSetting.ispresent()) {
  encoded_length += field_voiceDomainandUEsUsageSetting().RAW_encode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_p__TMSI__Type.ispresent()) {
  encoded_length += field_p__TMSI__Type().RAW_encode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  encoded_length += field_mS__NetworkFeatureSupport().RAW_encode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_oldLocationAreaIdentification.ispresent()) {
  encoded_length += field_oldLocationAreaIdentification().RAW_encode(LocationAreaIdentification2__TLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_additionalUpdateType.ispresent()) {
  encoded_length += field_additionalUpdateType().RAW_encode(AdditionalUpdateTypeTV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  encoded_length += field_tMSIBasedNRIcontainer().RAW_encode(NetworkResourceIdentifierContainerTLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_additionalMobileIdentity.ispresent() && (!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={16,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_23.RAW_encode(General__Types::BIT7_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_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.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);
  }
  }
  if (field_mS__NetworkFeatureSupport.ispresent() && (!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={25,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={26,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_messageType !=  bs_22) {
  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_22.RAW_encode(General__Types::BIT8_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 PDU__GMM__AttachRequest_template::single_value_struct {
BITSTRING_template field_messageType;
MSNetworkCapabilityLV_template field_msNetworkCapability;
AttachTypeV_template field_attachType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_gprsCKSN;
DRXParameterV_template field_drxParam;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
RoutingAreaIdentificationV_template field_oldRoutingAreaID;
MSRadioAccessCapabilityLV_template field_msRACap;
P__TMSISignatureTV_template field_ptmsiSignature;
GPRSTimerTV_template field_reqGPRStimer;
TMSIStatusTV_template field_tmsiStatus;
PC__LCSCapability_template field_pC__LCSCapability;
MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template field_mobileStationClassmark3;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
UENetworkCapabilityTLV_template field_uENetworkCapability;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_additionalMobileIdentity;
MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template field_routingAreaIdentification2;
VoiceDomainPreferenceandUEsUsageSettingTLV_template field_voiceDomainandUEsUsageSetting;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
MobileL3__CommonIE__Types::P__TMSI__TypeTV_template field_p__TMSI__Type;
MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template field_mS__NetworkFeatureSupport;
LocationAreaIdentification2__TLV_template field_oldLocationAreaIdentification;
AdditionalUpdateTypeTV_template field_additionalUpdateType;
NetworkResourceIdentifierContainerTLV_template field_tMSIBasedNRIcontainer;
GPRSTimer2TLV_template field_t3324;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__AttachRequest_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_messageType = ANY_VALUE;
single_value->field_msNetworkCapability = ANY_VALUE;
single_value->field_attachType = ANY_VALUE;
single_value->field_gprsCKSN = ANY_VALUE;
single_value->field_drxParam = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
single_value->field_oldRoutingAreaID = ANY_VALUE;
single_value->field_msRACap = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_reqGPRStimer = ANY_OR_OMIT;
single_value->field_tmsiStatus = ANY_OR_OMIT;
single_value->field_pC__LCSCapability = ANY_OR_OMIT;
single_value->field_mobileStationClassmark2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark3 = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_uENetworkCapability = ANY_OR_OMIT;
single_value->field_additionalMobileIdentity = ANY_OR_OMIT;
single_value->field_routingAreaIdentification2 = ANY_OR_OMIT;
single_value->field_voiceDomainandUEsUsageSetting = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_p__TMSI__Type = ANY_OR_OMIT;
single_value->field_mS__NetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_oldLocationAreaIdentification = ANY_OR_OMIT;
single_value->field_additionalUpdateType = ANY_OR_OMIT;
single_value->field_tMSIBasedNRIcontainer = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachRequest_template::copy_value(const PDU__GMM__AttachRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.msNetworkCapability().is_bound()) {
  single_value->field_msNetworkCapability = other_value.msNetworkCapability();
} else {
  single_value->field_msNetworkCapability.clean_up();
}
if (other_value.attachType().is_bound()) {
  single_value->field_attachType = other_value.attachType();
} else {
  single_value->field_attachType.clean_up();
}
if (other_value.gprsCKSN().is_bound()) {
  single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
  single_value->field_gprsCKSN.clean_up();
}
if (other_value.drxParam().is_bound()) {
  single_value->field_drxParam = other_value.drxParam();
} else {
  single_value->field_drxParam.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
if (other_value.oldRoutingAreaID().is_bound()) {
  single_value->field_oldRoutingAreaID = other_value.oldRoutingAreaID();
} else {
  single_value->field_oldRoutingAreaID.clean_up();
}
if (other_value.msRACap().is_bound()) {
  single_value->field_msRACap = other_value.msRACap();
} else {
  single_value->field_msRACap.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.reqGPRStimer().is_bound()) {
  if (other_value.reqGPRStimer().ispresent()) single_value->field_reqGPRStimer = other_value.reqGPRStimer()();
  else single_value->field_reqGPRStimer = OMIT_VALUE;
} else {
  single_value->field_reqGPRStimer.clean_up();
}
if (other_value.tmsiStatus().is_bound()) {
  if (other_value.tmsiStatus().ispresent()) single_value->field_tmsiStatus = other_value.tmsiStatus()();
  else single_value->field_tmsiStatus = OMIT_VALUE;
} else {
  single_value->field_tmsiStatus.clean_up();
}
if (other_value.pC__LCSCapability().is_bound()) {
  if (other_value.pC__LCSCapability().ispresent()) single_value->field_pC__LCSCapability = other_value.pC__LCSCapability()();
  else single_value->field_pC__LCSCapability = OMIT_VALUE;
} else {
  single_value->field_pC__LCSCapability.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  if (other_value.mobileStationClassmark2().ispresent()) single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2()();
  else single_value->field_mobileStationClassmark2 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileStationClassmark3().is_bound()) {
  if (other_value.mobileStationClassmark3().ispresent()) single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3()();
  else single_value->field_mobileStationClassmark3 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark3.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.uENetworkCapability().is_bound()) {
  if (other_value.uENetworkCapability().ispresent()) single_value->field_uENetworkCapability = other_value.uENetworkCapability()();
  else single_value->field_uENetworkCapability = OMIT_VALUE;
} else {
  single_value->field_uENetworkCapability.clean_up();
}
if (other_value.additionalMobileIdentity().is_bound()) {
  if (other_value.additionalMobileIdentity().ispresent()) single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity()();
  else single_value->field_additionalMobileIdentity = OMIT_VALUE;
} else {
  single_value->field_additionalMobileIdentity.clean_up();
}
if (other_value.routingAreaIdentification2().is_bound()) {
  if (other_value.routingAreaIdentification2().ispresent()) single_value->field_routingAreaIdentification2 = other_value.routingAreaIdentification2()();
  else single_value->field_routingAreaIdentification2 = OMIT_VALUE;
} else {
  single_value->field_routingAreaIdentification2.clean_up();
}
if (other_value.voiceDomainandUEsUsageSetting().is_bound()) {
  if (other_value.voiceDomainandUEsUsageSetting().ispresent()) single_value->field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting()();
  else single_value->field_voiceDomainandUEsUsageSetting = OMIT_VALUE;
} else {
  single_value->field_voiceDomainandUEsUsageSetting.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.p__TMSI__Type().is_bound()) {
  if (other_value.p__TMSI__Type().ispresent()) single_value->field_p__TMSI__Type = other_value.p__TMSI__Type()();
  else single_value->field_p__TMSI__Type = OMIT_VALUE;
} else {
  single_value->field_p__TMSI__Type.clean_up();
}
if (other_value.mS__NetworkFeatureSupport().is_bound()) {
  if (other_value.mS__NetworkFeatureSupport().ispresent()) single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport()();
  else single_value->field_mS__NetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (other_value.oldLocationAreaIdentification().is_bound()) {
  if (other_value.oldLocationAreaIdentification().ispresent()) single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification()();
  else single_value->field_oldLocationAreaIdentification = OMIT_VALUE;
} else {
  single_value->field_oldLocationAreaIdentification.clean_up();
}
if (other_value.additionalUpdateType().is_bound()) {
  if (other_value.additionalUpdateType().ispresent()) single_value->field_additionalUpdateType = other_value.additionalUpdateType()();
  else single_value->field_additionalUpdateType = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateType.clean_up();
}
if (other_value.tMSIBasedNRIcontainer().is_bound()) {
  if (other_value.tMSIBasedNRIcontainer().ispresent()) single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer()();
  else single_value->field_tMSIBasedNRIcontainer = OMIT_VALUE;
} else {
  single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachRequest_template::copy_template(const PDU__GMM__AttachRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msNetworkCapability().get_selection()) {
single_value->field_msNetworkCapability = other_value.msNetworkCapability();
} else {
single_value->field_msNetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.attachType().get_selection()) {
single_value->field_attachType = other_value.attachType();
} else {
single_value->field_attachType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsCKSN().get_selection()) {
single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
single_value->field_gprsCKSN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.drxParam().get_selection()) {
single_value->field_drxParam = other_value.drxParam();
} else {
single_value->field_drxParam.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaID().get_selection()) {
single_value->field_oldRoutingAreaID = other_value.oldRoutingAreaID();
} else {
single_value->field_oldRoutingAreaID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msRACap().get_selection()) {
single_value->field_msRACap = other_value.msRACap();
} else {
single_value->field_msRACap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reqGPRStimer().get_selection()) {
single_value->field_reqGPRStimer = other_value.reqGPRStimer();
} else {
single_value->field_reqGPRStimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tmsiStatus().get_selection()) {
single_value->field_tmsiStatus = other_value.tmsiStatus();
} else {
single_value->field_tmsiStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapability().get_selection()) {
single_value->field_pC__LCSCapability = other_value.pC__LCSCapability();
} else {
single_value->field_pC__LCSCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark3().get_selection()) {
single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
} else {
single_value->field_mobileStationClassmark3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapability().get_selection()) {
single_value->field_uENetworkCapability = other_value.uENetworkCapability();
} else {
single_value->field_uENetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalMobileIdentity().get_selection()) {
single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity();
} else {
single_value->field_additionalMobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification2().get_selection()) {
single_value->field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
} else {
single_value->field_routingAreaIdentification2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.voiceDomainandUEsUsageSetting().get_selection()) {
single_value->field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
} else {
single_value->field_voiceDomainandUEsUsageSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSI__Type().get_selection()) {
single_value->field_p__TMSI__Type = other_value.p__TMSI__Type();
} else {
single_value->field_p__TMSI__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__NetworkFeatureSupport().get_selection()) {
single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
} else {
single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldLocationAreaIdentification().get_selection()) {
single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
} else {
single_value->field_oldLocationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateType().get_selection()) {
single_value->field_additionalUpdateType = other_value.additionalUpdateType();
} else {
single_value->field_additionalUpdateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSIBasedNRIcontainer().get_selection()) {
single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
} else {
single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachRequest_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 PDU__GMM__AttachRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachRequest_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.PDU_GMM_AttachRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachRequest_template::PDU__GMM__AttachRequest_template()
{
}

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

PDU__GMM__AttachRequest_template::PDU__GMM__AttachRequest_template(const PDU__GMM__AttachRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AttachRequest_template::match(const PDU__GMM__AttachRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.msNetworkCapability().is_bound()) return FALSE;
if(!single_value->field_msNetworkCapability.match(other_value.msNetworkCapability(), legacy))return FALSE;
if(!other_value.attachType().is_bound()) return FALSE;
if(!single_value->field_attachType.match(other_value.attachType(), legacy))return FALSE;
if(!other_value.gprsCKSN().is_bound()) return FALSE;
if(!single_value->field_gprsCKSN.match(other_value.gprsCKSN(), legacy))return FALSE;
if(!other_value.drxParam().is_bound()) return FALSE;
if(!single_value->field_drxParam.match(other_value.drxParam(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), legacy))return FALSE;
if(!other_value.oldRoutingAreaID().is_bound()) return FALSE;
if(!single_value->field_oldRoutingAreaID.match(other_value.oldRoutingAreaID(), legacy))return FALSE;
if(!other_value.msRACap().is_bound()) return FALSE;
if(!single_value->field_msRACap.match(other_value.msRACap(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.reqGPRStimer().is_bound()) return FALSE;
if((other_value.reqGPRStimer().ispresent() ? !single_value->field_reqGPRStimer.match((const GPRSTimerTV&)other_value.reqGPRStimer(), legacy) : !single_value->field_reqGPRStimer.match_omit(legacy)))return FALSE;
if(!other_value.tmsiStatus().is_bound()) return FALSE;
if((other_value.tmsiStatus().ispresent() ? !single_value->field_tmsiStatus.match((const TMSIStatusTV&)other_value.tmsiStatus(), legacy) : !single_value->field_tmsiStatus.match_omit(legacy)))return FALSE;
if(!other_value.pC__LCSCapability().is_bound()) return FALSE;
if((other_value.pC__LCSCapability().ispresent() ? !single_value->field_pC__LCSCapability.match((const PC__LCSCapability&)other_value.pC__LCSCapability(), legacy) : !single_value->field_pC__LCSCapability.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2().ispresent() ? !single_value->field_mobileStationClassmark2.match((const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV&)other_value.mobileStationClassmark2(), legacy) : !single_value->field_mobileStationClassmark2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark3().is_bound()) return FALSE;
if((other_value.mobileStationClassmark3().ispresent() ? !single_value->field_mobileStationClassmark3.match((const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV&)other_value.mobileStationClassmark3(), legacy) : !single_value->field_mobileStationClassmark3.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.uENetworkCapability().is_bound()) return FALSE;
if((other_value.uENetworkCapability().ispresent() ? !single_value->field_uENetworkCapability.match((const UENetworkCapabilityTLV&)other_value.uENetworkCapability(), legacy) : !single_value->field_uENetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.additionalMobileIdentity().is_bound()) return FALSE;
if((other_value.additionalMobileIdentity().ispresent() ? !single_value->field_additionalMobileIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.additionalMobileIdentity(), legacy) : !single_value->field_additionalMobileIdentity.match_omit(legacy)))return FALSE;
if(!other_value.routingAreaIdentification2().is_bound()) return FALSE;
if((other_value.routingAreaIdentification2().ispresent() ? !single_value->field_routingAreaIdentification2.match((const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV&)other_value.routingAreaIdentification2(), legacy) : !single_value->field_routingAreaIdentification2.match_omit(legacy)))return FALSE;
if(!other_value.voiceDomainandUEsUsageSetting().is_bound()) return FALSE;
if((other_value.voiceDomainandUEsUsageSetting().ispresent() ? !single_value->field_voiceDomainandUEsUsageSetting.match((const VoiceDomainPreferenceandUEsUsageSettingTLV&)other_value.voiceDomainandUEsUsageSetting(), legacy) : !single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.p__TMSI__Type().is_bound()) return FALSE;
if((other_value.p__TMSI__Type().ispresent() ? !single_value->field_p__TMSI__Type.match((const MobileL3__CommonIE__Types::P__TMSI__TypeTV&)other_value.p__TMSI__Type(), legacy) : !single_value->field_p__TMSI__Type.match_omit(legacy)))return FALSE;
if(!other_value.mS__NetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.mS__NetworkFeatureSupport().ispresent() ? !single_value->field_mS__NetworkFeatureSupport.match((const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV&)other_value.mS__NetworkFeatureSupport(), legacy) : !single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.oldLocationAreaIdentification().is_bound()) return FALSE;
if((other_value.oldLocationAreaIdentification().ispresent() ? !single_value->field_oldLocationAreaIdentification.match((const LocationAreaIdentification2__TLV&)other_value.oldLocationAreaIdentification(), legacy) : !single_value->field_oldLocationAreaIdentification.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateType().is_bound()) return FALSE;
if((other_value.additionalUpdateType().ispresent() ? !single_value->field_additionalUpdateType.match((const AdditionalUpdateTypeTV&)other_value.additionalUpdateType(), legacy) : !single_value->field_additionalUpdateType.match_omit(legacy)))return FALSE;
if(!other_value.tMSIBasedNRIcontainer().is_bound()) return FALSE;
if((other_value.tMSIBasedNRIcontainer().ispresent() ? !single_value->field_tMSIBasedNRIcontainer.match((const NetworkResourceIdentifierContainerTLV&)other_value.tMSIBasedNRIcontainer(), legacy) : !single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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.PDU_GMM_AttachRequest.");
}
return FALSE;
}

boolean PDU__GMM__AttachRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_msNetworkCapability.is_bound()
 || single_value->field_attachType.is_bound()
 || single_value->field_gprsCKSN.is_bound()
 || single_value->field_drxParam.is_bound()
 || single_value->field_mobileIdentity.is_bound()
 || single_value->field_oldRoutingAreaID.is_bound()
 || single_value->field_msRACap.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_reqGPRStimer.is_omit() || single_value->field_reqGPRStimer.is_bound())
 || (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_bound())
 || (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_bound())
 || (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_bound())
 || (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_bound())
 || (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_bound())
 || (single_value->field_routingAreaIdentification2.is_omit() || single_value->field_routingAreaIdentification2.is_bound())
 || (single_value->field_voiceDomainandUEsUsageSetting.is_omit() || single_value->field_voiceDomainandUEsUsageSetting.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_bound())
 || (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_bound())
 || (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_bound())
 || (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_bound())
 || (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__AttachRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_msNetworkCapability.is_value()
 && single_value->field_attachType.is_value()
 && single_value->field_gprsCKSN.is_value()
 && single_value->field_drxParam.is_value()
 && single_value->field_mobileIdentity.is_value()
 && single_value->field_oldRoutingAreaID.is_value()
 && single_value->field_msRACap.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_reqGPRStimer.is_omit() || single_value->field_reqGPRStimer.is_value())
 && (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_value())
 && (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_value())
 && (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_value())
 && (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_value())
 && (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_value())
 && (single_value->field_routingAreaIdentification2.is_omit() || single_value->field_routingAreaIdentification2.is_value())
 && (single_value->field_voiceDomainandUEsUsageSetting.is_omit() || single_value->field_voiceDomainandUEsUsageSetting.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_value())
 && (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_value())
 && (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_value())
 && (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_value())
 && (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

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

PDU__GMM__AttachRequest PDU__GMM__AttachRequest_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.PDU_GMM_AttachRequest.");
PDU__GMM__AttachRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_msNetworkCapability.is_bound()) {
ret_val.msNetworkCapability() = single_value->field_msNetworkCapability.valueof();
}
if (single_value->field_attachType.is_bound()) {
ret_val.attachType() = single_value->field_attachType.valueof();
}
if (single_value->field_gprsCKSN.is_bound()) {
ret_val.gprsCKSN() = single_value->field_gprsCKSN.valueof();
}
if (single_value->field_drxParam.is_bound()) {
ret_val.drxParam() = single_value->field_drxParam.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
if (single_value->field_oldRoutingAreaID.is_bound()) {
ret_val.oldRoutingAreaID() = single_value->field_oldRoutingAreaID.valueof();
}
if (single_value->field_msRACap.is_bound()) {
ret_val.msRACap() = single_value->field_msRACap.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_reqGPRStimer.is_omit()) ret_val.reqGPRStimer() = OMIT_VALUE;
else if (single_value->field_reqGPRStimer.is_bound()) {
ret_val.reqGPRStimer() = single_value->field_reqGPRStimer.valueof();
}
if (single_value->field_tmsiStatus.is_omit()) ret_val.tmsiStatus() = OMIT_VALUE;
else if (single_value->field_tmsiStatus.is_bound()) {
ret_val.tmsiStatus() = single_value->field_tmsiStatus.valueof();
}
if (single_value->field_pC__LCSCapability.is_omit()) ret_val.pC__LCSCapability() = OMIT_VALUE;
else if (single_value->field_pC__LCSCapability.is_bound()) {
ret_val.pC__LCSCapability() = single_value->field_pC__LCSCapability.valueof();
}
if (single_value->field_mobileStationClassmark2.is_omit()) ret_val.mobileStationClassmark2() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileStationClassmark3.is_omit()) ret_val.mobileStationClassmark3() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark3.is_bound()) {
ret_val.mobileStationClassmark3() = single_value->field_mobileStationClassmark3.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_uENetworkCapability.is_omit()) ret_val.uENetworkCapability() = OMIT_VALUE;
else if (single_value->field_uENetworkCapability.is_bound()) {
ret_val.uENetworkCapability() = single_value->field_uENetworkCapability.valueof();
}
if (single_value->field_additionalMobileIdentity.is_omit()) ret_val.additionalMobileIdentity() = OMIT_VALUE;
else if (single_value->field_additionalMobileIdentity.is_bound()) {
ret_val.additionalMobileIdentity() = single_value->field_additionalMobileIdentity.valueof();
}
if (single_value->field_routingAreaIdentification2.is_omit()) ret_val.routingAreaIdentification2() = OMIT_VALUE;
else if (single_value->field_routingAreaIdentification2.is_bound()) {
ret_val.routingAreaIdentification2() = single_value->field_routingAreaIdentification2.valueof();
}
if (single_value->field_voiceDomainandUEsUsageSetting.is_omit()) ret_val.voiceDomainandUEsUsageSetting() = OMIT_VALUE;
else if (single_value->field_voiceDomainandUEsUsageSetting.is_bound()) {
ret_val.voiceDomainandUEsUsageSetting() = single_value->field_voiceDomainandUEsUsageSetting.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_p__TMSI__Type.is_omit()) ret_val.p__TMSI__Type() = OMIT_VALUE;
else if (single_value->field_p__TMSI__Type.is_bound()) {
ret_val.p__TMSI__Type() = single_value->field_p__TMSI__Type.valueof();
}
if (single_value->field_mS__NetworkFeatureSupport.is_omit()) ret_val.mS__NetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_mS__NetworkFeatureSupport.is_bound()) {
ret_val.mS__NetworkFeatureSupport() = single_value->field_mS__NetworkFeatureSupport.valueof();
}
if (single_value->field_oldLocationAreaIdentification.is_omit()) ret_val.oldLocationAreaIdentification() = OMIT_VALUE;
else if (single_value->field_oldLocationAreaIdentification.is_bound()) {
ret_val.oldLocationAreaIdentification() = single_value->field_oldLocationAreaIdentification.valueof();
}
if (single_value->field_additionalUpdateType.is_omit()) ret_val.additionalUpdateType() = OMIT_VALUE;
else if (single_value->field_additionalUpdateType.is_bound()) {
ret_val.additionalUpdateType() = single_value->field_additionalUpdateType.valueof();
}
if (single_value->field_tMSIBasedNRIcontainer.is_omit()) ret_val.tMSIBasedNRIcontainer() = OMIT_VALUE;
else if (single_value->field_tMSIBasedNRIcontainer.is_bound()) {
ret_val.tMSIBasedNRIcontainer() = single_value->field_tMSIBasedNRIcontainer.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__AttachRequest_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.PDU_GMM_AttachRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachRequest_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AttachRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_messageType;
}

MSNetworkCapabilityLV_template& PDU__GMM__AttachRequest_template::msNetworkCapability()
{
set_specific();
return single_value->field_msNetworkCapability;
}

const MSNetworkCapabilityLV_template& PDU__GMM__AttachRequest_template::msNetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msNetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_msNetworkCapability;
}

AttachTypeV_template& PDU__GMM__AttachRequest_template::attachType()
{
set_specific();
return single_value->field_attachType;
}

const AttachTypeV_template& PDU__GMM__AttachRequest_template::attachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field attachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_attachType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__AttachRequest_template::gprsCKSN()
{
set_specific();
return single_value->field_gprsCKSN;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__AttachRequest_template::gprsCKSN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsCKSN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_gprsCKSN;
}

DRXParameterV_template& PDU__GMM__AttachRequest_template::drxParam()
{
set_specific();
return single_value->field_drxParam;
}

const DRXParameterV_template& PDU__GMM__AttachRequest_template::drxParam() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field drxParam of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_drxParam;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__AttachRequest_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__AttachRequest_template::mobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileIdentity;
}

RoutingAreaIdentificationV_template& PDU__GMM__AttachRequest_template::oldRoutingAreaID()
{
set_specific();
return single_value->field_oldRoutingAreaID;
}

const RoutingAreaIdentificationV_template& PDU__GMM__AttachRequest_template::oldRoutingAreaID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaID of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_oldRoutingAreaID;
}

MSRadioAccessCapabilityLV_template& PDU__GMM__AttachRequest_template::msRACap()
{
set_specific();
return single_value->field_msRACap;
}

const MSRadioAccessCapabilityLV_template& PDU__GMM__AttachRequest_template::msRACap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msRACap of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_msRACap;
}

P__TMSISignatureTV_template& PDU__GMM__AttachRequest_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__AttachRequest_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_ptmsiSignature;
}

GPRSTimerTV_template& PDU__GMM__AttachRequest_template::reqGPRStimer()
{
set_specific();
return single_value->field_reqGPRStimer;
}

const GPRSTimerTV_template& PDU__GMM__AttachRequest_template::reqGPRStimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reqGPRStimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_reqGPRStimer;
}

TMSIStatusTV_template& PDU__GMM__AttachRequest_template::tmsiStatus()
{
set_specific();
return single_value->field_tmsiStatus;
}

const TMSIStatusTV_template& PDU__GMM__AttachRequest_template::tmsiStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tmsiStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_tmsiStatus;
}

PC__LCSCapability_template& PDU__GMM__AttachRequest_template::pC__LCSCapability()
{
set_specific();
return single_value->field_pC__LCSCapability;
}

const PC__LCSCapability_template& PDU__GMM__AttachRequest_template::pC__LCSCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_pC__LCSCapability;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark3()
{
set_specific();
return single_value->field_mobileStationClassmark3;
}

const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark3 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileStationClassmark3;
}

MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__AttachRequest_template::supportedCodecs()
{
set_specific();
return single_value->field_supportedCodecs;
}

const MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__AttachRequest_template::supportedCodecs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supportedCodecs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_supportedCodecs;
}

UENetworkCapabilityTLV_template& PDU__GMM__AttachRequest_template::uENetworkCapability()
{
set_specific();
return single_value->field_uENetworkCapability;
}

const UENetworkCapabilityTLV_template& PDU__GMM__AttachRequest_template::uENetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_uENetworkCapability;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachRequest_template::additionalMobileIdentity()
{
set_specific();
return single_value->field_additionalMobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachRequest_template::additionalMobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalMobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_additionalMobileIdentity;
}

MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__AttachRequest_template::routingAreaIdentification2()
{
set_specific();
return single_value->field_routingAreaIdentification2;
}

const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__AttachRequest_template::routingAreaIdentification2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_routingAreaIdentification2;
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__AttachRequest_template::voiceDomainandUEsUsageSetting()
{
set_specific();
return single_value->field_voiceDomainandUEsUsageSetting;
}

const VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__AttachRequest_template::voiceDomainandUEsUsageSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field voiceDomainandUEsUsageSetting of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_voiceDomainandUEsUsageSetting;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__AttachRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__AttachRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_deviceProperties;
}

MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__AttachRequest_template::p__TMSI__Type()
{
set_specific();
return single_value->field_p__TMSI__Type;
}

const MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__AttachRequest_template::p__TMSI__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI_Type of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_p__TMSI__Type;
}

MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__AttachRequest_template::mS__NetworkFeatureSupport()
{
set_specific();
return single_value->field_mS__NetworkFeatureSupport;
}

const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__AttachRequest_template::mS__NetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_NetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mS__NetworkFeatureSupport;
}

LocationAreaIdentification2__TLV_template& PDU__GMM__AttachRequest_template::oldLocationAreaIdentification()
{
set_specific();
return single_value->field_oldLocationAreaIdentification;
}

const LocationAreaIdentification2__TLV_template& PDU__GMM__AttachRequest_template::oldLocationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldLocationAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_oldLocationAreaIdentification;
}

AdditionalUpdateTypeTV_template& PDU__GMM__AttachRequest_template::additionalUpdateType()
{
set_specific();
return single_value->field_additionalUpdateType;
}

const AdditionalUpdateTypeTV_template& PDU__GMM__AttachRequest_template::additionalUpdateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_additionalUpdateType;
}

NetworkResourceIdentifierContainerTLV_template& PDU__GMM__AttachRequest_template::tMSIBasedNRIcontainer()
{
set_specific();
return single_value->field_tMSIBasedNRIcontainer;
}

const NetworkResourceIdentifierContainerTLV_template& PDU__GMM__AttachRequest_template::tMSIBasedNRIcontainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSIBasedNRIcontainer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_tMSIBasedNRIcontainer;
}

GPRSTimer2TLV_template& PDU__GMM__AttachRequest_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachRequest_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_t3324;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachRequest_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachRequest_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_t3312__ExtendedValue;
}

ExtendedDRXParametersTLV_template& PDU__GMM__AttachRequest_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__AttachRequest_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__AttachRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 8;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_reqGPRStimer.is_present()) ret_val++;
      if (single_value->field_tmsiStatus.is_present()) ret_val++;
      if (single_value->field_pC__LCSCapability.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark3.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.is_present()) ret_val++;
      if (single_value->field_uENetworkCapability.is_present()) ret_val++;
      if (single_value->field_additionalMobileIdentity.is_present()) ret_val++;
      if (single_value->field_routingAreaIdentification2.is_present()) ret_val++;
      if (single_value->field_voiceDomainandUEsUsageSetting.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_p__TMSI__Type.is_present()) ret_val++;
      if (single_value->field_mS__NetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_oldLocationAreaIdentification.is_present()) ret_val++;
      if (single_value->field_additionalUpdateType.is_present()) ret_val++;
      if (single_value->field_tMSIBasedNRIcontainer.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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.PDU_GMM_AttachRequest 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.PDU_GMM_AttachRequest 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.PDU_GMM_AttachRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
  }
  return 0;
}

void PDU__GMM__AttachRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", msNetworkCapability := ");
single_value->field_msNetworkCapability.log();
TTCN_Logger::log_event_str(", attachType := ");
single_value->field_attachType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log();
TTCN_Logger::log_event_str(", drxParam := ");
single_value->field_drxParam.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
single_value->field_oldRoutingAreaID.log();
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", reqGPRStimer := ");
single_value->field_reqGPRStimer.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
single_value->field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
single_value->field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachRequest_template::log_match(const PDU__GMM__AttachRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msNetworkCapability.match(match_value.msNetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".msNetworkCapability");
single_value->field_msNetworkCapability.log_match(match_value.msNetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_attachType.match(match_value.attachType(), legacy)){
TTCN_Logger::log_logmatch_info(".attachType");
single_value->field_attachType.log_match(match_value.attachType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsCKSN.match(match_value.gprsCKSN(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsCKSN");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_drxParam.match(match_value.drxParam(), legacy)){
TTCN_Logger::log_logmatch_info(".drxParam");
single_value->field_drxParam.log_match(match_value.drxParam(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oldRoutingAreaID.match(match_value.oldRoutingAreaID(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaID");
single_value->field_oldRoutingAreaID.log_match(match_value.oldRoutingAreaID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msRACap.match(match_value.msRACap(), legacy)){
TTCN_Logger::log_logmatch_info(".msRACap");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reqGPRStimer().ispresent()){
if(!single_value->field_reqGPRStimer.match(match_value.reqGPRStimer(), legacy)){
TTCN_Logger::log_logmatch_info(".reqGPRStimer");
single_value->field_reqGPRStimer.log_match(match_value.reqGPRStimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reqGPRStimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reqGPRStimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reqGPRStimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tmsiStatus().ispresent()){
if(!single_value->field_tmsiStatus.match(match_value.tmsiStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".tmsiStatus");
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tmsiStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tmsiStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pC__LCSCapability().ispresent()){
if(!single_value->field_pC__LCSCapability.match(match_value.pC__LCSCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapability");
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pC__LCSCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pC_LCSCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark2().ispresent()){
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark3().ispresent()){
if(!single_value->field_mobileStationClassmark3.match(match_value.mobileStationClassmark3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark3");
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uENetworkCapability().ispresent()){
if(!single_value->field_uENetworkCapability.match(match_value.uENetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapability");
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uENetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uENetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalMobileIdentity().ispresent()){
if(!single_value->field_additionalMobileIdentity.match(match_value.additionalMobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalMobileIdentity");
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalMobileIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalMobileIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routingAreaIdentification2().ispresent()){
if(!single_value->field_routingAreaIdentification2.match(match_value.routingAreaIdentification2(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification2");
single_value->field_routingAreaIdentification2.log_match(match_value.routingAreaIdentification2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routingAreaIdentification2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routingAreaIdentification2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.voiceDomainandUEsUsageSetting().ispresent()){
if(!single_value->field_voiceDomainandUEsUsageSetting.match(match_value.voiceDomainandUEsUsageSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".voiceDomainandUEsUsageSetting");
single_value->field_voiceDomainandUEsUsageSetting.log_match(match_value.voiceDomainandUEsUsageSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".voiceDomainandUEsUsageSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.p__TMSI__Type().ispresent()){
if(!single_value->field_p__TMSI__Type.match(match_value.p__TMSI__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI_Type");
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mS__NetworkFeatureSupport().ispresent()){
if(!single_value->field_mS__NetworkFeatureSupport.match(match_value.mS__NetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport");
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldLocationAreaIdentification().ispresent()){
if(!single_value->field_oldLocationAreaIdentification.match(match_value.oldLocationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification");
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldLocationAreaIdentification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateType().ispresent()){
if(!single_value->field_additionalUpdateType.match(match_value.additionalUpdateType(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateType");
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSIBasedNRIcontainer().ispresent()){
if(!single_value->field_tMSIBasedNRIcontainer.match(match_value.tMSIBasedNRIcontainer(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer");
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", msNetworkCapability := ");
single_value->field_msNetworkCapability.log_match(match_value.msNetworkCapability(), legacy);
TTCN_Logger::log_event_str(", attachType := ");
single_value->field_attachType.log_match(match_value.attachType(), legacy);
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::log_event_str(", drxParam := ");
single_value->field_drxParam.log_match(match_value.drxParam(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
single_value->field_oldRoutingAreaID.log_match(match_value.oldRoutingAreaID(), legacy);
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reqGPRStimer := ");
if (match_value.reqGPRStimer().ispresent()) {
single_value->field_reqGPRStimer.log_match(match_value.reqGPRStimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reqGPRStimer.log();
if (single_value->field_reqGPRStimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tmsiStatus := ");
if (match_value.tmsiStatus().ispresent()) {
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tmsiStatus.log();
if (single_value->field_tmsiStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
if (match_value.pC__LCSCapability().ispresent()) {
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pC__LCSCapability.log();
if (single_value->field_pC__LCSCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
if (match_value.mobileStationClassmark2().ispresent()) {
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2.log();
if (single_value->field_mobileStationClassmark2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
if (match_value.mobileStationClassmark3().ispresent()) {
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark3.log();
if (single_value->field_mobileStationClassmark3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uENetworkCapability := ");
if (match_value.uENetworkCapability().ispresent()) {
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uENetworkCapability.log();
if (single_value->field_uENetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
if (match_value.additionalMobileIdentity().ispresent()) {
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalMobileIdentity.log();
if (single_value->field_additionalMobileIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
if (match_value.routingAreaIdentification2().ispresent()) {
single_value->field_routingAreaIdentification2.log_match(match_value.routingAreaIdentification2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routingAreaIdentification2.log();
if (single_value->field_routingAreaIdentification2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
if (match_value.voiceDomainandUEsUsageSetting().ispresent()) {
single_value->field_voiceDomainandUEsUsageSetting.log_match(match_value.voiceDomainandUEsUsageSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_voiceDomainandUEsUsageSetting.log();
if (single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
if (match_value.p__TMSI__Type().ispresent()) {
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI__Type.log();
if (single_value->field_p__TMSI__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
if (match_value.mS__NetworkFeatureSupport().ispresent()) {
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__NetworkFeatureSupport.log();
if (single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
if (match_value.oldLocationAreaIdentification().ispresent()) {
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldLocationAreaIdentification.log();
if (single_value->field_oldLocationAreaIdentification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateType := ");
if (match_value.additionalUpdateType().ispresent()) {
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateType.log();
if (single_value->field_additionalUpdateType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
if (match_value.tMSIBasedNRIcontainer().ispresent()) {
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSIBasedNRIcontainer.log();
if (single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__AttachRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_msNetworkCapability.encode_text(text_buf);
single_value->field_attachType.encode_text(text_buf);
single_value->field_gprsCKSN.encode_text(text_buf);
single_value->field_drxParam.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
single_value->field_oldRoutingAreaID.encode_text(text_buf);
single_value->field_msRACap.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_reqGPRStimer.encode_text(text_buf);
single_value->field_tmsiStatus.encode_text(text_buf);
single_value->field_pC__LCSCapability.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileStationClassmark3.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_uENetworkCapability.encode_text(text_buf);
single_value->field_additionalMobileIdentity.encode_text(text_buf);
single_value->field_routingAreaIdentification2.encode_text(text_buf);
single_value->field_voiceDomainandUEsUsageSetting.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_p__TMSI__Type.encode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.encode_text(text_buf);
single_value->field_oldLocationAreaIdentification.encode_text(text_buf);
single_value->field_additionalUpdateType.encode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_extendedDRXParameters.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.PDU_GMM_AttachRequest.");
}
}

void PDU__GMM__AttachRequest_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_messageType.decode_text(text_buf);
single_value->field_msNetworkCapability.decode_text(text_buf);
single_value->field_attachType.decode_text(text_buf);
single_value->field_gprsCKSN.decode_text(text_buf);
single_value->field_drxParam.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
single_value->field_oldRoutingAreaID.decode_text(text_buf);
single_value->field_msRACap.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_reqGPRStimer.decode_text(text_buf);
single_value->field_tmsiStatus.decode_text(text_buf);
single_value->field_pC__LCSCapability.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileStationClassmark3.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_uENetworkCapability.decode_text(text_buf);
single_value->field_additionalMobileIdentity.decode_text(text_buf);
single_value->field_routingAreaIdentification2.decode_text(text_buf);
single_value->field_voiceDomainandUEsUsageSetting.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_p__TMSI__Type.decode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.decode_text(text_buf);
single_value->field_oldLocationAreaIdentification.decode_text(text_buf);
single_value->field_additionalUpdateType.decode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachRequest_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.PDU_GMM_AttachRequest.");
}
}

void PDU__GMM__AttachRequest_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: {
    PDU__GMM__AttachRequest_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 (28<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest has 28 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msNetworkCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) attachType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) drxParam().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) reqGPRStimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) voiceDomainandUEsUsageSetting().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(27));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParam().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reqGPRStimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reqGPRStimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainandUEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainandUEsUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_AttachRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachRequest_template* precondition = new PDU__GMM__AttachRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachRequest_template* implied_template = new PDU__GMM__AttachRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_msNetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_attachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_gprsCKSN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_drxParam.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_oldRoutingAreaID.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_msRACap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_reqGPRStimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_tmsiStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_pC__LCSCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileStationClassmark3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_uENetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_additionalMobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_routingAreaIdentification2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_voiceDomainandUEsUsageSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_p__TMSI__Type.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mS__NetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_oldLocationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_additionalUpdateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_tMSIBasedNRIcontainer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
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.PDU_GMM_AttachRequest");
}

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

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

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept()
{
}

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept(const BITSTRING& par_messageType,
    const AttachResultV& par_attachResult,
    const ForceToStandbyV& par_forceToStandby,
    const GPRSTimerV& par_updateTimer,
    const RadioPriorityV& par_radioPriority,
    const RadioPriority2V& par_radioPriorityTOM8,
    const RoutingAreaIdentificationV& par_routingAreaIdentification,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< GPRSTimerTV >& par_readyTimer,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_allocatedPTMSI,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_msIdentity,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< CellNotificationT >& par_cellNotification,
    const OPTIONAL< MobileL3__CommonIE__Types::PLMNListTLV >& par_equivalentPLMNs,
    const OPTIONAL< NetworkFeatureSupportTV >& par_networkFeatureSupport,
    const OPTIONAL< MobileL3__MM__Types::EmergencyNumberListTLV >& par_emergencyNumberList,
    const OPTIONAL< RequestedMSInformationTV >& par_requestedMSInformation,
    const OPTIONAL< GPRSTimer2TLV >& par_t3319,
    const OPTIONAL< GPRSTimer2TLV >& par_t3323,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< AdditionalNetworkFeatureSupportTLV >& par_additionalNetworkFeatureSupport,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_attachResult(par_attachResult),
  field_forceToStandby(par_forceToStandby),
  field_updateTimer(par_updateTimer),
  field_radioPriority(par_radioPriority),
  field_radioPriorityTOM8(par_radioPriorityTOM8),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_ptmsiSignature(par_ptmsiSignature),
  field_readyTimer(par_readyTimer),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_msIdentity(par_msIdentity),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_cellNotification(par_cellNotification),
  field_equivalentPLMNs(par_equivalentPLMNs),
  field_networkFeatureSupport(par_networkFeatureSupport),
  field_emergencyNumberList(par_emergencyNumberList),
  field_requestedMSInformation(par_requestedMSInformation),
  field_t3319(par_t3319),
  field_t3323(par_t3323),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_additionalNetworkFeatureSupport(par_additionalNetworkFeatureSupport),
  field_t3324(par_t3324),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept(const PDU__GMM__AttachAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.attachResult().is_bound()) field_attachResult = other_value.attachResult();
else field_attachResult.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.updateTimer().is_bound()) field_updateTimer = other_value.updateTimer();
else field_updateTimer.clean_up();
if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
else field_radioPriority.clean_up();
if (other_value.radioPriorityTOM8().is_bound()) field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
else field_radioPriorityTOM8.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
else field_readyTimer.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
else field_msIdentity.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
else field_cellNotification.clean_up();
if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
else field_equivalentPLMNs.clean_up();
if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
else field_networkFeatureSupport.clean_up();
if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
else field_emergencyNumberList.clean_up();
if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
else field_requestedMSInformation.clean_up();
if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
else field_t3319.clean_up();
if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
else field_t3323.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
else field_additionalNetworkFeatureSupport.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__AttachAccept::clean_up()
{
field_messageType.clean_up();
field_attachResult.clean_up();
field_forceToStandby.clean_up();
field_updateTimer.clean_up();
field_radioPriority.clean_up();
field_radioPriorityTOM8.clean_up();
field_routingAreaIdentification.clean_up();
field_ptmsiSignature.clean_up();
field_readyTimer.clean_up();
field_allocatedPTMSI.clean_up();
field_msIdentity.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_cellNotification.clean_up();
field_equivalentPLMNs.clean_up();
field_networkFeatureSupport.clean_up();
field_emergencyNumberList.clean_up();
field_requestedMSInformation.clean_up();
field_t3319.clean_up();
field_t3323.clean_up();
field_t3312__ExtendedValue.clean_up();
field_additionalNetworkFeatureSupport.clean_up();
field_t3324.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachAccept::get_descriptor() const { return &PDU__GMM__AttachAccept_descr_; }
PDU__GMM__AttachAccept& PDU__GMM__AttachAccept::operator=(const PDU__GMM__AttachAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.attachResult().is_bound()) field_attachResult = other_value.attachResult();
  else field_attachResult.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.updateTimer().is_bound()) field_updateTimer = other_value.updateTimer();
  else field_updateTimer.clean_up();
  if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
  else field_radioPriority.clean_up();
  if (other_value.radioPriorityTOM8().is_bound()) field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
  else field_radioPriorityTOM8.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
  else field_readyTimer.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
  else field_msIdentity.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
  else field_cellNotification.clean_up();
  if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
  else field_equivalentPLMNs.clean_up();
  if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
  else field_networkFeatureSupport.clean_up();
  if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
  else field_emergencyNumberList.clean_up();
  if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
  else field_requestedMSInformation.clean_up();
  if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
  else field_t3319.clean_up();
  if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
  else field_t3323.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
  else field_additionalNetworkFeatureSupport.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachAccept::operator==(const PDU__GMM__AttachAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_attachResult==other_value.field_attachResult
  && field_forceToStandby==other_value.field_forceToStandby
  && field_updateTimer==other_value.field_updateTimer
  && field_radioPriority==other_value.field_radioPriority
  && field_radioPriorityTOM8==other_value.field_radioPriorityTOM8
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_readyTimer==other_value.field_readyTimer
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_msIdentity==other_value.field_msIdentity
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_cellNotification==other_value.field_cellNotification
  && field_equivalentPLMNs==other_value.field_equivalentPLMNs
  && field_networkFeatureSupport==other_value.field_networkFeatureSupport
  && field_emergencyNumberList==other_value.field_emergencyNumberList
  && field_requestedMSInformation==other_value.field_requestedMSInformation
  && field_t3319==other_value.field_t3319
  && field_t3323==other_value.field_t3323
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_additionalNetworkFeatureSupport==other_value.field_additionalNetworkFeatureSupport
  && field_t3324==other_value.field_t3324
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__AttachAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_attachResult.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_updateTimer.is_bound())
  || (field_radioPriority.is_bound())
  || (field_radioPriorityTOM8.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_bound())
  || (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_bound())
  || (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_bound())
  || (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_bound())
  || (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_bound())
  || (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_bound())
  || (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_bound())
  || (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__AttachAccept::is_value() const
{
return field_messageType.is_value()
  && field_attachResult.is_value()
  && field_forceToStandby.is_value()
  && field_updateTimer.is_value()
  && field_radioPriority.is_value()
  && field_radioPriorityTOM8.is_value()
  && field_routingAreaIdentification.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_value())
  && (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_value())
  && (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_value())
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value())
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_value())
  && (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_value())
  && (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_value())
  && (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_value())
  && (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_value())
  && (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__AttachAccept::size_of() const
{
  int ret_val = 7;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_readyTimer.ispresent()) ret_val++;
  if (field_allocatedPTMSI.ispresent()) ret_val++;
  if (field_msIdentity.ispresent()) ret_val++;
  if (field_gmmCause.ispresent()) ret_val++;
  if (field_t3302.ispresent()) ret_val++;
  if (field_cellNotification.ispresent()) ret_val++;
  if (field_equivalentPLMNs.ispresent()) ret_val++;
  if (field_networkFeatureSupport.ispresent()) ret_val++;
  if (field_emergencyNumberList.ispresent()) ret_val++;
  if (field_requestedMSInformation.ispresent()) ret_val++;
  if (field_t3319.ispresent()) ret_val++;
  if (field_t3323.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_additionalNetworkFeatureSupport.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", attachResult := ");
field_attachResult.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateTimer := ");
field_updateTimer.log();
TTCN_Logger::log_event_str(", radioPriority := ");
field_radioPriority.log();
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
field_radioPriorityTOM8.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", readyTimer := ");
field_readyTimer.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
field_msIdentity.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (attachResult().is_bound()) attachResult().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateTimer().is_bound()) updateTimer().set_implicit_omit();
if (radioPriority().is_bound()) radioPriority().set_implicit_omit();
if (radioPriorityTOM8().is_bound()) radioPriorityTOM8().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachAccept::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 (24<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept has 24 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) attachResult().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) updateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) radioPriorityTOM8().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(23));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriorityTOM8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriorityTOM8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_AttachAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
  }
}

void PDU__GMM__AttachAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_attachResult.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_updateTimer.encode_text(text_buf);
field_radioPriority.encode_text(text_buf);
field_radioPriorityTOM8.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_readyTimer.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_msIdentity.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_cellNotification.encode_text(text_buf);
field_equivalentPLMNs.encode_text(text_buf);
field_networkFeatureSupport.encode_text(text_buf);
field_emergencyNumberList.encode_text(text_buf);
field_requestedMSInformation.encode_text(text_buf);
field_t3319.encode_text(text_buf);
field_t3323.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_additionalNetworkFeatureSupport.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__AttachAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_attachResult.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_updateTimer.decode_text(text_buf);
field_radioPriority.decode_text(text_buf);
field_radioPriorityTOM8.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_readyTimer.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_msIdentity.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_cellNotification.decode_text(text_buf);
field_equivalentPLMNs.decode_text(text_buf);
field_networkFeatureSupport.decode_text(text_buf);
field_emergencyNumberList.decode_text(text_buf);
field_requestedMSInformation.decode_text(text_buf);
field_t3319.decode_text(text_buf);
field_t3323.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_additionalNetworkFeatureSupport.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__AttachAccept::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 PDU__GMM__AttachAccept::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 PDU__GMM__AttachAccept::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_messageType.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, AttachResultV_descr_.raw->forceomit);
  decoded_field_length = field_attachResult.RAW_decode(AttachResultV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_updateTimer.RAW_decode(GPRSTimerV_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, RadioPriorityV_descr_.raw->forceomit);
  decoded_field_length = field_radioPriority.RAW_decode(RadioPriorityV_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, RadioPriority2V_descr_.raw->forceomit);
  decoded_field_length = field_radioPriorityTOM8.RAW_decode(RadioPriority2V_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(RoutingAreaIdentificationV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_readyTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimer = 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_readyTimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_allocatedPTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_allocatedPTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26){
  field_allocatedPTMSI=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_allocatedPTMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_msIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_msIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_msIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27){
  field_msIdentity=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_msIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_cellNotification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, CellNotificationT_descr_.raw->forceomit);
  decoded_field_length = field_cellNotification().RAW_decode(CellNotificationT_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_cellNotification = 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_cellNotification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_equivalentPLMNs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw->forceomit);
  decoded_field_length = field_equivalentPLMNs().RAW_decode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_equivalentPLMNs = 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_equivalentPLMNs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_networkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_networkFeatureSupport().RAW_decode(NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_networkFeatureSupport = 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_networkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_emergencyNumberList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumberList().RAW_decode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyNumberList = 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_emergencyNumberList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_requestedMSInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, RequestedMSInformationTV_descr_.raw->forceomit);
  decoded_field_length = field_requestedMSInformation().RAW_decode(RequestedMSInformationTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_requestedMSInformation = 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_requestedMSInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_t3319 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3319().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_t3319 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33){
  field_t3319=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_t3319=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_t3323 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3323().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_t3323 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34){
  field_t3323=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_t3323=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_additionalNetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, AdditionalNetworkFeatureSupportTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalNetworkFeatureSupport().RAW_decode(AdditionalNetworkFeatureSupportTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_additionalNetworkFeatureSupport = 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_additionalNetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_25) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AttachAccept::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 = 24;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(24);
  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, AttachResultV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimerV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RadioPriorityV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RadioPriority2V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RoutingAreaIdentificationV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_readyTimer.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_allocatedPTMSI.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_msIdentity.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_cellNotification.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, CellNotificationT_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_equivalentPLMNs.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_networkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_emergencyNumberList.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_requestedMSInformation.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, RequestedMSInformationTV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_t3319.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_t3323.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, AdditionalNetworkFeatureSupportTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_attachResult.RAW_encode(AttachResultV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_updateTimer.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_radioPriority.RAW_encode(RadioPriorityV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_radioPriorityTOM8.RAW_encode(RadioPriority2V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_routingAreaIdentification.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[6]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_readyTimer.ispresent()) {
  encoded_length += field_readyTimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_allocatedPTMSI.ispresent()) {
  encoded_length += field_allocatedPTMSI().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_msIdentity.ispresent()) {
  encoded_length += field_msIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_cellNotification.ispresent()) {
  encoded_length += field_cellNotification().RAW_encode(CellNotificationT_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_equivalentPLMNs.ispresent()) {
  encoded_length += field_equivalentPLMNs().RAW_encode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_networkFeatureSupport.ispresent()) {
  encoded_length += field_networkFeatureSupport().RAW_encode(NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_emergencyNumberList.ispresent()) {
  encoded_length += field_emergencyNumberList().RAW_encode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_requestedMSInformation.ispresent()) {
  encoded_length += field_requestedMSInformation().RAW_encode(RequestedMSInformationTV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_t3319.ispresent()) {
  encoded_length += field_t3319().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_t3323.ispresent()) {
  encoded_length += field_t3323().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  encoded_length += field_additionalNetworkFeatureSupport().RAW_encode(AdditionalNetworkFeatureSupportTLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_allocatedPTMSI.ispresent() && (!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_msIdentity.ispresent() && (!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_27.RAW_encode(General__Types::BIT7_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_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={12,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3319.ispresent() && (!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={18,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_33.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);
  }
  }
  if (field_t3323.ispresent() && (!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_34.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_messageType !=  bs_25) {
  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_25.RAW_encode(General__Types::BIT8_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 PDU__GMM__AttachAccept_template::single_value_struct {
BITSTRING_template field_messageType;
AttachResultV_template field_attachResult;
ForceToStandbyV_template field_forceToStandby;
GPRSTimerV_template field_updateTimer;
RadioPriorityV_template field_radioPriority;
RadioPriority2V_template field_radioPriorityTOM8;
RoutingAreaIdentificationV_template field_routingAreaIdentification;
P__TMSISignatureTV_template field_ptmsiSignature;
GPRSTimerTV_template field_readyTimer;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_allocatedPTMSI;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_msIdentity;
GMM__CauseTV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
CellNotificationT_template field_cellNotification;
MobileL3__CommonIE__Types::PLMNListTLV_template field_equivalentPLMNs;
NetworkFeatureSupportTV_template field_networkFeatureSupport;
MobileL3__MM__Types::EmergencyNumberListTLV_template field_emergencyNumberList;
RequestedMSInformationTV_template field_requestedMSInformation;
GPRSTimer2TLV_template field_t3319;
GPRSTimer2TLV_template field_t3323;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
AdditionalNetworkFeatureSupportTLV_template field_additionalNetworkFeatureSupport;
GPRSTimer2TLV_template field_t3324;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__AttachAccept_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_messageType = ANY_VALUE;
single_value->field_attachResult = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_updateTimer = ANY_VALUE;
single_value->field_radioPriority = ANY_VALUE;
single_value->field_radioPriorityTOM8 = ANY_VALUE;
single_value->field_routingAreaIdentification = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_readyTimer = ANY_OR_OMIT;
single_value->field_allocatedPTMSI = ANY_OR_OMIT;
single_value->field_msIdentity = ANY_OR_OMIT;
single_value->field_gmmCause = ANY_OR_OMIT;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_cellNotification = ANY_OR_OMIT;
single_value->field_equivalentPLMNs = ANY_OR_OMIT;
single_value->field_networkFeatureSupport = ANY_OR_OMIT;
single_value->field_emergencyNumberList = ANY_OR_OMIT;
single_value->field_requestedMSInformation = ANY_OR_OMIT;
single_value->field_t3319 = ANY_OR_OMIT;
single_value->field_t3323 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_additionalNetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachAccept_template::copy_value(const PDU__GMM__AttachAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.attachResult().is_bound()) {
  single_value->field_attachResult = other_value.attachResult();
} else {
  single_value->field_attachResult.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.updateTimer().is_bound()) {
  single_value->field_updateTimer = other_value.updateTimer();
} else {
  single_value->field_updateTimer.clean_up();
}
if (other_value.radioPriority().is_bound()) {
  single_value->field_radioPriority = other_value.radioPriority();
} else {
  single_value->field_radioPriority.clean_up();
}
if (other_value.radioPriorityTOM8().is_bound()) {
  single_value->field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
} else {
  single_value->field_radioPriorityTOM8.clean_up();
}
if (other_value.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.readyTimer().is_bound()) {
  if (other_value.readyTimer().ispresent()) single_value->field_readyTimer = other_value.readyTimer()();
  else single_value->field_readyTimer = OMIT_VALUE;
} else {
  single_value->field_readyTimer.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  if (other_value.allocatedPTMSI().ispresent()) single_value->field_allocatedPTMSI = other_value.allocatedPTMSI()();
  else single_value->field_allocatedPTMSI = OMIT_VALUE;
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.msIdentity().is_bound()) {
  if (other_value.msIdentity().ispresent()) single_value->field_msIdentity = other_value.msIdentity()();
  else single_value->field_msIdentity = OMIT_VALUE;
} else {
  single_value->field_msIdentity.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.cellNotification().is_bound()) {
  if (other_value.cellNotification().ispresent()) single_value->field_cellNotification = other_value.cellNotification()();
  else single_value->field_cellNotification = OMIT_VALUE;
} else {
  single_value->field_cellNotification.clean_up();
}
if (other_value.equivalentPLMNs().is_bound()) {
  if (other_value.equivalentPLMNs().ispresent()) single_value->field_equivalentPLMNs = other_value.equivalentPLMNs()();
  else single_value->field_equivalentPLMNs = OMIT_VALUE;
} else {
  single_value->field_equivalentPLMNs.clean_up();
}
if (other_value.networkFeatureSupport().is_bound()) {
  if (other_value.networkFeatureSupport().ispresent()) single_value->field_networkFeatureSupport = other_value.networkFeatureSupport()();
  else single_value->field_networkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_networkFeatureSupport.clean_up();
}
if (other_value.emergencyNumberList().is_bound()) {
  if (other_value.emergencyNumberList().ispresent()) single_value->field_emergencyNumberList = other_value.emergencyNumberList()();
  else single_value->field_emergencyNumberList = OMIT_VALUE;
} else {
  single_value->field_emergencyNumberList.clean_up();
}
if (other_value.requestedMSInformation().is_bound()) {
  if (other_value.requestedMSInformation().ispresent()) single_value->field_requestedMSInformation = other_value.requestedMSInformation()();
  else single_value->field_requestedMSInformation = OMIT_VALUE;
} else {
  single_value->field_requestedMSInformation.clean_up();
}
if (other_value.t3319().is_bound()) {
  if (other_value.t3319().ispresent()) single_value->field_t3319 = other_value.t3319()();
  else single_value->field_t3319 = OMIT_VALUE;
} else {
  single_value->field_t3319.clean_up();
}
if (other_value.t3323().is_bound()) {
  if (other_value.t3323().ispresent()) single_value->field_t3323 = other_value.t3323()();
  else single_value->field_t3323 = OMIT_VALUE;
} else {
  single_value->field_t3323.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.additionalNetworkFeatureSupport().is_bound()) {
  if (other_value.additionalNetworkFeatureSupport().ispresent()) single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport()();
  else single_value->field_additionalNetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachAccept_template::copy_template(const PDU__GMM__AttachAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.attachResult().get_selection()) {
single_value->field_attachResult = other_value.attachResult();
} else {
single_value->field_attachResult.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateTimer().get_selection()) {
single_value->field_updateTimer = other_value.updateTimer();
} else {
single_value->field_updateTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radioPriority().get_selection()) {
single_value->field_radioPriority = other_value.radioPriority();
} else {
single_value->field_radioPriority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radioPriorityTOM8().get_selection()) {
single_value->field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
} else {
single_value->field_radioPriorityTOM8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimer().get_selection()) {
single_value->field_readyTimer = other_value.readyTimer();
} else {
single_value->field_readyTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msIdentity().get_selection()) {
single_value->field_msIdentity = other_value.msIdentity();
} else {
single_value->field_msIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellNotification().get_selection()) {
single_value->field_cellNotification = other_value.cellNotification();
} else {
single_value->field_cellNotification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.equivalentPLMNs().get_selection()) {
single_value->field_equivalentPLMNs = other_value.equivalentPLMNs();
} else {
single_value->field_equivalentPLMNs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkFeatureSupport().get_selection()) {
single_value->field_networkFeatureSupport = other_value.networkFeatureSupport();
} else {
single_value->field_networkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumberList().get_selection()) {
single_value->field_emergencyNumberList = other_value.emergencyNumberList();
} else {
single_value->field_emergencyNumberList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedMSInformation().get_selection()) {
single_value->field_requestedMSInformation = other_value.requestedMSInformation();
} else {
single_value->field_requestedMSInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3319().get_selection()) {
single_value->field_t3319 = other_value.t3319();
} else {
single_value->field_t3319.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3323().get_selection()) {
single_value->field_t3323 = other_value.t3323();
} else {
single_value->field_t3323.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalNetworkFeatureSupport().get_selection()) {
single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
} else {
single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachAccept_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 PDU__GMM__AttachAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachAccept_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.PDU_GMM_AttachAccept.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachAccept_template::PDU__GMM__AttachAccept_template()
{
}

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

PDU__GMM__AttachAccept_template::PDU__GMM__AttachAccept_template(const PDU__GMM__AttachAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AttachAccept_template::match(const PDU__GMM__AttachAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.attachResult().is_bound()) return FALSE;
if(!single_value->field_attachResult.match(other_value.attachResult(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.updateTimer().is_bound()) return FALSE;
if(!single_value->field_updateTimer.match(other_value.updateTimer(), legacy))return FALSE;
if(!other_value.radioPriority().is_bound()) return FALSE;
if(!single_value->field_radioPriority.match(other_value.radioPriority(), legacy))return FALSE;
if(!other_value.radioPriorityTOM8().is_bound()) return FALSE;
if(!single_value->field_radioPriorityTOM8.match(other_value.radioPriorityTOM8(), legacy))return FALSE;
if(!other_value.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.readyTimer().is_bound()) return FALSE;
if((other_value.readyTimer().ispresent() ? !single_value->field_readyTimer.match((const GPRSTimerTV&)other_value.readyTimer(), legacy) : !single_value->field_readyTimer.match_omit(legacy)))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if((other_value.allocatedPTMSI().ispresent() ? !single_value->field_allocatedPTMSI.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.allocatedPTMSI(), legacy) : !single_value->field_allocatedPTMSI.match_omit(legacy)))return FALSE;
if(!other_value.msIdentity().is_bound()) return FALSE;
if((other_value.msIdentity().ispresent() ? !single_value->field_msIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.msIdentity(), legacy) : !single_value->field_msIdentity.match_omit(legacy)))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.match_omit(legacy)))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.cellNotification().is_bound()) return FALSE;
if((other_value.cellNotification().ispresent() ? !single_value->field_cellNotification.match((const CellNotificationT&)other_value.cellNotification(), legacy) : !single_value->field_cellNotification.match_omit(legacy)))return FALSE;
if(!other_value.equivalentPLMNs().is_bound()) return FALSE;
if((other_value.equivalentPLMNs().ispresent() ? !single_value->field_equivalentPLMNs.match((const MobileL3__CommonIE__Types::PLMNListTLV&)other_value.equivalentPLMNs(), legacy) : !single_value->field_equivalentPLMNs.match_omit(legacy)))return FALSE;
if(!other_value.networkFeatureSupport().is_bound()) return FALSE;
if((other_value.networkFeatureSupport().ispresent() ? !single_value->field_networkFeatureSupport.match((const NetworkFeatureSupportTV&)other_value.networkFeatureSupport(), legacy) : !single_value->field_networkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.emergencyNumberList().is_bound()) return FALSE;
if((other_value.emergencyNumberList().ispresent() ? !single_value->field_emergencyNumberList.match((const MobileL3__MM__Types::EmergencyNumberListTLV&)other_value.emergencyNumberList(), legacy) : !single_value->field_emergencyNumberList.match_omit(legacy)))return FALSE;
if(!other_value.requestedMSInformation().is_bound()) return FALSE;
if((other_value.requestedMSInformation().ispresent() ? !single_value->field_requestedMSInformation.match((const RequestedMSInformationTV&)other_value.requestedMSInformation(), legacy) : !single_value->field_requestedMSInformation.match_omit(legacy)))return FALSE;
if(!other_value.t3319().is_bound()) return FALSE;
if((other_value.t3319().ispresent() ? !single_value->field_t3319.match((const GPRSTimer2TLV&)other_value.t3319(), legacy) : !single_value->field_t3319.match_omit(legacy)))return FALSE;
if(!other_value.t3323().is_bound()) return FALSE;
if((other_value.t3323().ispresent() ? !single_value->field_t3323.match((const GPRSTimer2TLV&)other_value.t3323(), legacy) : !single_value->field_t3323.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.additionalNetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.additionalNetworkFeatureSupport().ispresent() ? !single_value->field_additionalNetworkFeatureSupport.match((const AdditionalNetworkFeatureSupportTLV&)other_value.additionalNetworkFeatureSupport(), legacy) : !single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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.PDU_GMM_AttachAccept.");
}
return FALSE;
}

boolean PDU__GMM__AttachAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_attachResult.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_updateTimer.is_bound()
 || single_value->field_radioPriority.is_bound()
 || single_value->field_radioPriorityTOM8.is_bound()
 || single_value->field_routingAreaIdentification.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_bound())
 || (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_bound())
 || (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_bound())
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound())
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_bound())
 || (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_bound())
 || (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_bound())
 || (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_bound())
 || (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_bound())
 || (single_value->field_t3319.is_omit() || single_value->field_t3319.is_bound())
 || (single_value->field_t3323.is_omit() || single_value->field_t3323.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__AttachAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_attachResult.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_updateTimer.is_value()
 && single_value->field_radioPriority.is_value()
 && single_value->field_radioPriorityTOM8.is_value()
 && single_value->field_routingAreaIdentification.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_value())
 && (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_value())
 && (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_value())
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value())
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_value())
 && (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_value())
 && (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_value())
 && (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_value())
 && (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_value())
 && (single_value->field_t3319.is_omit() || single_value->field_t3319.is_value())
 && (single_value->field_t3323.is_omit() || single_value->field_t3323.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

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

PDU__GMM__AttachAccept PDU__GMM__AttachAccept_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.PDU_GMM_AttachAccept.");
PDU__GMM__AttachAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_attachResult.is_bound()) {
ret_val.attachResult() = single_value->field_attachResult.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_updateTimer.is_bound()) {
ret_val.updateTimer() = single_value->field_updateTimer.valueof();
}
if (single_value->field_radioPriority.is_bound()) {
ret_val.radioPriority() = single_value->field_radioPriority.valueof();
}
if (single_value->field_radioPriorityTOM8.is_bound()) {
ret_val.radioPriorityTOM8() = single_value->field_radioPriorityTOM8.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_readyTimer.is_omit()) ret_val.readyTimer() = OMIT_VALUE;
else if (single_value->field_readyTimer.is_bound()) {
ret_val.readyTimer() = single_value->field_readyTimer.valueof();
}
if (single_value->field_allocatedPTMSI.is_omit()) ret_val.allocatedPTMSI() = OMIT_VALUE;
else if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_msIdentity.is_omit()) ret_val.msIdentity() = OMIT_VALUE;
else if (single_value->field_msIdentity.is_bound()) {
ret_val.msIdentity() = single_value->field_msIdentity.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_cellNotification.is_omit()) ret_val.cellNotification() = OMIT_VALUE;
else if (single_value->field_cellNotification.is_bound()) {
ret_val.cellNotification() = single_value->field_cellNotification.valueof();
}
if (single_value->field_equivalentPLMNs.is_omit()) ret_val.equivalentPLMNs() = OMIT_VALUE;
else if (single_value->field_equivalentPLMNs.is_bound()) {
ret_val.equivalentPLMNs() = single_value->field_equivalentPLMNs.valueof();
}
if (single_value->field_networkFeatureSupport.is_omit()) ret_val.networkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_networkFeatureSupport.is_bound()) {
ret_val.networkFeatureSupport() = single_value->field_networkFeatureSupport.valueof();
}
if (single_value->field_emergencyNumberList.is_omit()) ret_val.emergencyNumberList() = OMIT_VALUE;
else if (single_value->field_emergencyNumberList.is_bound()) {
ret_val.emergencyNumberList() = single_value->field_emergencyNumberList.valueof();
}
if (single_value->field_requestedMSInformation.is_omit()) ret_val.requestedMSInformation() = OMIT_VALUE;
else if (single_value->field_requestedMSInformation.is_bound()) {
ret_val.requestedMSInformation() = single_value->field_requestedMSInformation.valueof();
}
if (single_value->field_t3319.is_omit()) ret_val.t3319() = OMIT_VALUE;
else if (single_value->field_t3319.is_bound()) {
ret_val.t3319() = single_value->field_t3319.valueof();
}
if (single_value->field_t3323.is_omit()) ret_val.t3323() = OMIT_VALUE;
else if (single_value->field_t3323.is_bound()) {
ret_val.t3323() = single_value->field_t3323.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_additionalNetworkFeatureSupport.is_omit()) ret_val.additionalNetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_additionalNetworkFeatureSupport.is_bound()) {
ret_val.additionalNetworkFeatureSupport() = single_value->field_additionalNetworkFeatureSupport.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__AttachAccept_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.PDU_GMM_AttachAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachAccept_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AttachAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_messageType;
}

AttachResultV_template& PDU__GMM__AttachAccept_template::attachResult()
{
set_specific();
return single_value->field_attachResult;
}

const AttachResultV_template& PDU__GMM__AttachAccept_template::attachResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field attachResult of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_attachResult;
}

ForceToStandbyV_template& PDU__GMM__AttachAccept_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__AttachAccept_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_forceToStandby;
}

GPRSTimerV_template& PDU__GMM__AttachAccept_template::updateTimer()
{
set_specific();
return single_value->field_updateTimer;
}

const GPRSTimerV_template& PDU__GMM__AttachAccept_template::updateTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_updateTimer;
}

RadioPriorityV_template& PDU__GMM__AttachAccept_template::radioPriority()
{
set_specific();
return single_value->field_radioPriority;
}

const RadioPriorityV_template& PDU__GMM__AttachAccept_template::radioPriority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioPriority of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_radioPriority;
}

RadioPriority2V_template& PDU__GMM__AttachAccept_template::radioPriorityTOM8()
{
set_specific();
return single_value->field_radioPriorityTOM8;
}

const RadioPriority2V_template& PDU__GMM__AttachAccept_template::radioPriorityTOM8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioPriorityTOM8 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_radioPriorityTOM8;
}

RoutingAreaIdentificationV_template& PDU__GMM__AttachAccept_template::routingAreaIdentification()
{
set_specific();
return single_value->field_routingAreaIdentification;
}

const RoutingAreaIdentificationV_template& PDU__GMM__AttachAccept_template::routingAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_routingAreaIdentification;
}

P__TMSISignatureTV_template& PDU__GMM__AttachAccept_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__AttachAccept_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_ptmsiSignature;
}

GPRSTimerTV_template& PDU__GMM__AttachAccept_template::readyTimer()
{
set_specific();
return single_value->field_readyTimer;
}

const GPRSTimerTV_template& PDU__GMM__AttachAccept_template::readyTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_readyTimer;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_allocatedPTMSI;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::msIdentity()
{
set_specific();
return single_value->field_msIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::msIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_msIdentity;
}

GMM__CauseTV_template& PDU__GMM__AttachAccept_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__AttachAccept_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3302;
}

CellNotificationT_template& PDU__GMM__AttachAccept_template::cellNotification()
{
set_specific();
return single_value->field_cellNotification;
}

const CellNotificationT_template& PDU__GMM__AttachAccept_template::cellNotification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellNotification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_cellNotification;
}

MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__AttachAccept_template::equivalentPLMNs()
{
set_specific();
return single_value->field_equivalentPLMNs;
}

const MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__AttachAccept_template::equivalentPLMNs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field equivalentPLMNs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_equivalentPLMNs;
}

NetworkFeatureSupportTV_template& PDU__GMM__AttachAccept_template::networkFeatureSupport()
{
set_specific();
return single_value->field_networkFeatureSupport;
}

const NetworkFeatureSupportTV_template& PDU__GMM__AttachAccept_template::networkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_networkFeatureSupport;
}

MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__AttachAccept_template::emergencyNumberList()
{
set_specific();
return single_value->field_emergencyNumberList;
}

const MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__AttachAccept_template::emergencyNumberList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumberList of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_emergencyNumberList;
}

RequestedMSInformationTV_template& PDU__GMM__AttachAccept_template::requestedMSInformation()
{
set_specific();
return single_value->field_requestedMSInformation;
}

const RequestedMSInformationTV_template& PDU__GMM__AttachAccept_template::requestedMSInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedMSInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_requestedMSInformation;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3319()
{
set_specific();
return single_value->field_t3319;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3319() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3319 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3319;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3323()
{
set_specific();
return single_value->field_t3323;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3323() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3323 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3323;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachAccept_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachAccept_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3312__ExtendedValue;
}

AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__AttachAccept_template::additionalNetworkFeatureSupport()
{
set_specific();
return single_value->field_additionalNetworkFeatureSupport;
}

const AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__AttachAccept_template::additionalNetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalNetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_additionalNetworkFeatureSupport;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3324;
}

ExtendedDRXParametersTLV_template& PDU__GMM__AttachAccept_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__AttachAccept_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__AttachAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 7;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_readyTimer.is_present()) ret_val++;
      if (single_value->field_allocatedPTMSI.is_present()) ret_val++;
      if (single_value->field_msIdentity.is_present()) ret_val++;
      if (single_value->field_gmmCause.is_present()) ret_val++;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_cellNotification.is_present()) ret_val++;
      if (single_value->field_equivalentPLMNs.is_present()) ret_val++;
      if (single_value->field_networkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_emergencyNumberList.is_present()) ret_val++;
      if (single_value->field_requestedMSInformation.is_present()) ret_val++;
      if (single_value->field_t3319.is_present()) ret_val++;
      if (single_value->field_t3323.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_additionalNetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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.PDU_GMM_AttachAccept 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.PDU_GMM_AttachAccept 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.PDU_GMM_AttachAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
  }
  return 0;
}

void PDU__GMM__AttachAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", attachResult := ");
single_value->field_attachResult.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateTimer := ");
single_value->field_updateTimer.log();
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log();
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
single_value->field_radioPriorityTOM8.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", readyTimer := ");
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
single_value->field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
single_value->field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachAccept_template::log_match(const PDU__GMM__AttachAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_attachResult.match(match_value.attachResult(), legacy)){
TTCN_Logger::log_logmatch_info(".attachResult");
single_value->field_attachResult.log_match(match_value.attachResult(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateTimer.match(match_value.updateTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".updateTimer");
single_value->field_updateTimer.log_match(match_value.updateTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radioPriority.match(match_value.radioPriority(), legacy)){
TTCN_Logger::log_logmatch_info(".radioPriority");
single_value->field_radioPriority.log_match(match_value.radioPriority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radioPriorityTOM8.match(match_value.radioPriorityTOM8(), legacy)){
TTCN_Logger::log_logmatch_info(".radioPriorityTOM8");
single_value->field_radioPriorityTOM8.log_match(match_value.radioPriorityTOM8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimer().ispresent()){
if(!single_value->field_readyTimer.match(match_value.readyTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimer");
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allocatedPTMSI().ispresent()){
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocatedPTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocatedPTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.msIdentity().ispresent()){
if(!single_value->field_msIdentity.match(match_value.msIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".msIdentity");
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_msIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".msIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cellNotification().ispresent()){
if(!single_value->field_cellNotification.match(match_value.cellNotification(), legacy)){
TTCN_Logger::log_logmatch_info(".cellNotification");
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellNotification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellNotification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.equivalentPLMNs().ispresent()){
if(!single_value->field_equivalentPLMNs.match(match_value.equivalentPLMNs(), legacy)){
TTCN_Logger::log_logmatch_info(".equivalentPLMNs");
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_equivalentPLMNs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".equivalentPLMNs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkFeatureSupport().ispresent()){
if(!single_value->field_networkFeatureSupport.match(match_value.networkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".networkFeatureSupport");
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.emergencyNumberList().ispresent()){
if(!single_value->field_emergencyNumberList.match(match_value.emergencyNumberList(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyNumberList");
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_emergencyNumberList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".emergencyNumberList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requestedMSInformation().ispresent()){
if(!single_value->field_requestedMSInformation.match(match_value.requestedMSInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedMSInformation");
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requestedMSInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requestedMSInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3319().ispresent()){
if(!single_value->field_t3319.match(match_value.t3319(), legacy)){
TTCN_Logger::log_logmatch_info(".t3319");
single_value->field_t3319.log_match(match_value.t3319(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3319.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3319 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3319.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3323().ispresent()){
if(!single_value->field_t3323.match(match_value.t3323(), legacy)){
TTCN_Logger::log_logmatch_info(".t3323");
single_value->field_t3323.log_match(match_value.t3323(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3323.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3323 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3323.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalNetworkFeatureSupport().ispresent()){
if(!single_value->field_additionalNetworkFeatureSupport.match(match_value.additionalNetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport");
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", attachResult := ");
single_value->field_attachResult.log_match(match_value.attachResult(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", updateTimer := ");
single_value->field_updateTimer.log_match(match_value.updateTimer(), legacy);
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log_match(match_value.radioPriority(), legacy);
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
single_value->field_radioPriorityTOM8.log_match(match_value.radioPriorityTOM8(), legacy);
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimer := ");
if (match_value.readyTimer().ispresent()) {
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimer.log();
if (single_value->field_readyTimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
if (match_value.allocatedPTMSI().ispresent()) {
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocatedPTMSI.log();
if (single_value->field_allocatedPTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", msIdentity := ");
if (match_value.msIdentity().ispresent()) {
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_msIdentity.log();
if (single_value->field_msIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cellNotification := ");
if (match_value.cellNotification().ispresent()) {
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellNotification.log();
if (single_value->field_cellNotification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
if (match_value.equivalentPLMNs().ispresent()) {
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_equivalentPLMNs.log();
if (single_value->field_equivalentPLMNs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
if (match_value.networkFeatureSupport().ispresent()) {
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkFeatureSupport.log();
if (single_value->field_networkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", emergencyNumberList := ");
if (match_value.emergencyNumberList().ispresent()) {
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_emergencyNumberList.log();
if (single_value->field_emergencyNumberList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestedMSInformation := ");
if (match_value.requestedMSInformation().ispresent()) {
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requestedMSInformation.log();
if (single_value->field_requestedMSInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3319 := ");
if (match_value.t3319().ispresent()) {
single_value->field_t3319.log_match(match_value.t3319(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3319.log();
if (single_value->field_t3319.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3323 := ");
if (match_value.t3323().ispresent()) {
single_value->field_t3323.log_match(match_value.t3323(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3323.log();
if (single_value->field_t3323.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
if (match_value.additionalNetworkFeatureSupport().ispresent()) {
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalNetworkFeatureSupport.log();
if (single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__AttachAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_attachResult.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_updateTimer.encode_text(text_buf);
single_value->field_radioPriority.encode_text(text_buf);
single_value->field_radioPriorityTOM8.encode_text(text_buf);
single_value->field_routingAreaIdentification.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_readyTimer.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_msIdentity.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_cellNotification.encode_text(text_buf);
single_value->field_equivalentPLMNs.encode_text(text_buf);
single_value->field_networkFeatureSupport.encode_text(text_buf);
single_value->field_emergencyNumberList.encode_text(text_buf);
single_value->field_requestedMSInformation.encode_text(text_buf);
single_value->field_t3319.encode_text(text_buf);
single_value->field_t3323.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_extendedDRXParameters.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.PDU_GMM_AttachAccept.");
}
}

void PDU__GMM__AttachAccept_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_messageType.decode_text(text_buf);
single_value->field_attachResult.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_updateTimer.decode_text(text_buf);
single_value->field_radioPriority.decode_text(text_buf);
single_value->field_radioPriorityTOM8.decode_text(text_buf);
single_value->field_routingAreaIdentification.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_readyTimer.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_msIdentity.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_cellNotification.decode_text(text_buf);
single_value->field_equivalentPLMNs.decode_text(text_buf);
single_value->field_networkFeatureSupport.decode_text(text_buf);
single_value->field_emergencyNumberList.decode_text(text_buf);
single_value->field_requestedMSInformation.decode_text(text_buf);
single_value->field_t3319.decode_text(text_buf);
single_value->field_t3323.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_extendedDRXParameters.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 PDU__GMM__AttachAccept_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.PDU_GMM_AttachAccept.");
}
}

void PDU__GMM__AttachAccept_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: {
    PDU__GMM__AttachAccept_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 (24<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept has 24 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) attachResult().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) updateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) radioPriorityTOM8().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(23));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriorityTOM8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriorityTOM8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_AttachAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachAccept_template* precondition = new PDU__GMM__AttachAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachAccept_template* implied_template = new PDU__GMM__AttachAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_attachResult.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_updateTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_radioPriority.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_radioPriorityTOM8.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_readyTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_msIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_cellNotification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_equivalentPLMNs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_networkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_emergencyNumberList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_requestedMSInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3319.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3323.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_additionalNetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
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.PDU_GMM_AttachAccept");
}

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

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

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete()
{
}

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete(const BITSTRING& par_messageType,
    const OPTIONAL< InterRATInformationContainerTLV >& par_interRATHandoverInformation,
    const OPTIONAL< EUTRANinterRATInformationContainerTLV >& par_eUTRANinterRATHandoverInformation)
  :   field_messageType(par_messageType),
  field_interRATHandoverInformation(par_interRATHandoverInformation),
  field_eUTRANinterRATHandoverInformation(par_eUTRANinterRATHandoverInformation)
{
}

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete(const PDU__GMM__AttachComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
else field_interRATHandoverInformation.clean_up();
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
else field_eUTRANinterRATHandoverInformation.clean_up();
}

void PDU__GMM__AttachComplete::clean_up()
{
field_messageType.clean_up();
field_interRATHandoverInformation.clean_up();
field_eUTRANinterRATHandoverInformation.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachComplete::get_descriptor() const { return &PDU__GMM__AttachComplete_descr_; }
PDU__GMM__AttachComplete& PDU__GMM__AttachComplete::operator=(const PDU__GMM__AttachComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
  else field_interRATHandoverInformation.clean_up();
  if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
  else field_eUTRANinterRATHandoverInformation.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachComplete::operator==(const PDU__GMM__AttachComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_interRATHandoverInformation==other_value.field_interRATHandoverInformation
  && field_eUTRANinterRATHandoverInformation==other_value.field_eUTRANinterRATHandoverInformation;
}

boolean PDU__GMM__AttachComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_bound())
  || (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_bound());
}
boolean PDU__GMM__AttachComplete::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_value())
  && (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_value());
}
int PDU__GMM__AttachComplete::size_of() const
{
  int ret_val = 1;
  if (field_interRATHandoverInformation.ispresent()) ret_val++;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
field_eUTRANinterRATHandoverInformation.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!interRATHandoverInformation().is_bound()) interRATHandoverInformation() = OMIT_VALUE;
else interRATHandoverInformation().set_implicit_omit();
if (!eUTRANinterRATHandoverInformation().is_bound()) eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else eUTRANinterRATHandoverInformation().set_implicit_omit();
}

void PDU__GMM__AttachComplete::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.PDU_GMM_AttachComplete 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInformation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInformation().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInformation().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.PDU_GMM_AttachComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
  }
}

void PDU__GMM__AttachComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_interRATHandoverInformation.encode_text(text_buf);
field_eUTRANinterRATHandoverInformation.encode_text(text_buf);
}

void PDU__GMM__AttachComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_interRATHandoverInformation.decode_text(text_buf);
field_eUTRANinterRATHandoverInformation.decode_text(text_buf);
}

void PDU__GMM__AttachComplete::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 PDU__GMM__AttachComplete::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 PDU__GMM__AttachComplete::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_messageType.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_interRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, InterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_interRATHandoverInformation().RAW_decode(InterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_interRATHandoverInformation = 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_interRATHandoverInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, EUTRANinterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_eUTRANinterRATHandoverInformation().RAW_decode(EUTRANinterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_eUTRANinterRATHandoverInformation = 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_eUTRANinterRATHandoverInformation=OMIT_VALUE;
  if (field_messageType !=  bs_28) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AttachComplete::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::BIT8_descr_.raw);
  if (field_interRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, InterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EUTRANinterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_interRATHandoverInformation.ispresent()) {
  encoded_length += field_interRATHandoverInformation().RAW_encode(InterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  encoded_length += field_eUTRANinterRATHandoverInformation().RAW_encode(EUTRANinterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_messageType !=  bs_28) {
  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_28.RAW_encode(General__Types::BIT8_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 PDU__GMM__AttachComplete_template::single_value_struct {
BITSTRING_template field_messageType;
InterRATInformationContainerTLV_template field_interRATHandoverInformation;
EUTRANinterRATInformationContainerTLV_template field_eUTRANinterRATHandoverInformation;
};

void PDU__GMM__AttachComplete_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_messageType = ANY_VALUE;
single_value->field_interRATHandoverInformation = ANY_OR_OMIT;
single_value->field_eUTRANinterRATHandoverInformation = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachComplete_template::copy_value(const PDU__GMM__AttachComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.interRATHandoverInformation().is_bound()) {
  if (other_value.interRATHandoverInformation().ispresent()) single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation()();
  else single_value->field_interRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_interRATHandoverInformation.clean_up();
}
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) {
  if (other_value.eUTRANinterRATHandoverInformation().ispresent()) single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation()();
  else single_value->field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_eUTRANinterRATHandoverInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachComplete_template::copy_template(const PDU__GMM__AttachComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interRATHandoverInformation().get_selection()) {
single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation();
} else {
single_value->field_interRATHandoverInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANinterRATHandoverInformation().get_selection()) {
single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
} else {
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__AttachComplete_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 PDU__GMM__AttachComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachComplete_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.PDU_GMM_AttachComplete.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachComplete_template::PDU__GMM__AttachComplete_template()
{
}

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

PDU__GMM__AttachComplete_template::PDU__GMM__AttachComplete_template(const PDU__GMM__AttachComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AttachComplete_template::match(const PDU__GMM__AttachComplete& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.interRATHandoverInformation().is_bound()) return FALSE;
if((other_value.interRATHandoverInformation().ispresent() ? !single_value->field_interRATHandoverInformation.match((const InterRATInformationContainerTLV&)other_value.interRATHandoverInformation(), legacy) : !single_value->field_interRATHandoverInformation.match_omit(legacy)))return FALSE;
if(!other_value.eUTRANinterRATHandoverInformation().is_bound()) return FALSE;
if((other_value.eUTRANinterRATHandoverInformation().ispresent() ? !single_value->field_eUTRANinterRATHandoverInformation.match((const EUTRANinterRATInformationContainerTLV&)other_value.eUTRANinterRATHandoverInformation(), legacy) : !single_value->field_eUTRANinterRATHandoverInformation.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.PDU_GMM_AttachComplete.");
}
return FALSE;
}

boolean PDU__GMM__AttachComplete_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_bound())
 || (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_bound());
}

boolean PDU__GMM__AttachComplete_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_value())
 && (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_value());
}

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

PDU__GMM__AttachComplete PDU__GMM__AttachComplete_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.PDU_GMM_AttachComplete.");
PDU__GMM__AttachComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_interRATHandoverInformation.is_omit()) ret_val.interRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_interRATHandoverInformation.is_bound()) {
ret_val.interRATHandoverInformation() = single_value->field_interRATHandoverInformation.valueof();
}
if (single_value->field_eUTRANinterRATHandoverInformation.is_omit()) ret_val.eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_eUTRANinterRATHandoverInformation.is_bound()) {
ret_val.eUTRANinterRATHandoverInformation() = single_value->field_eUTRANinterRATHandoverInformation.valueof();
}
return ret_val;
}

void PDU__GMM__AttachComplete_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.PDU_GMM_AttachComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachComplete_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AttachComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_messageType;
}

InterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::interRATHandoverInformation()
{
set_specific();
return single_value->field_interRATHandoverInformation;
}

const InterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::interRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_interRATHandoverInformation;
}

EUTRANinterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::eUTRANinterRATHandoverInformation()
{
set_specific();
return single_value->field_eUTRANinterRATHandoverInformation;
}

const EUTRANinterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::eUTRANinterRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANinterRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_eUTRANinterRATHandoverInformation;
}

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

void PDU__GMM__AttachComplete_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__AttachComplete_template::log_match(const PDU__GMM__AttachComplete& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.interRATHandoverInformation().ispresent()){
if(!single_value->field_interRATHandoverInformation.match(match_value.interRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".interRATHandoverInformation");
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_interRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".interRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eUTRANinterRATHandoverInformation().ispresent()){
if(!single_value->field_eUTRANinterRATHandoverInformation.match(match_value.eUTRANinterRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation");
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eUTRANinterRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eUTRANinterRATHandoverInformation.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
if (match_value.interRATHandoverInformation().ispresent()) {
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_interRATHandoverInformation.log();
if (single_value->field_interRATHandoverInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
if (match_value.eUTRANinterRATHandoverInformation().ispresent()) {
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eUTRANinterRATHandoverInformation.log();
if (single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__AttachComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_interRATHandoverInformation.encode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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.PDU_GMM_AttachComplete.");
}
}

void PDU__GMM__AttachComplete_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_messageType.decode_text(text_buf);
single_value->field_interRATHandoverInformation.decode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__AttachComplete_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.PDU_GMM_AttachComplete.");
}
}

void PDU__GMM__AttachComplete_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: {
    PDU__GMM__AttachComplete_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.PDU_GMM_AttachComplete 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInformation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInformation().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInformation().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.PDU_GMM_AttachComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachComplete_template* precondition = new PDU__GMM__AttachComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachComplete_template* implied_template = new PDU__GMM__AttachComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachComplete_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
single_value->field_interRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
single_value->field_eUTRANinterRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
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.PDU_GMM_AttachComplete");
}

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

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

PDU__GMM__AttachReject::PDU__GMM__AttachReject()
{
}

PDU__GMM__AttachReject::PDU__GMM__AttachReject(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< GPRSTimer2TLV >& par_t3346)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_t3346(par_t3346)
{
}

PDU__GMM__AttachReject::PDU__GMM__AttachReject(const PDU__GMM__AttachReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
else field_t3346.clean_up();
}

void PDU__GMM__AttachReject::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_t3346.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachReject::get_descriptor() const { return &PDU__GMM__AttachReject_descr_; }
PDU__GMM__AttachReject& PDU__GMM__AttachReject::operator=(const PDU__GMM__AttachReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
  else field_t3346.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachReject::operator==(const PDU__GMM__AttachReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_t3346==other_value.field_t3346;
}

boolean PDU__GMM__AttachReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_bound());
}
boolean PDU__GMM__AttachReject::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_value());
}
int PDU__GMM__AttachReject::size_of() const
{
  int ret_val = 2;
  if (field_t3302.ispresent()) ret_val++;
  if (field_t3346.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
field_t3346.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!t3346().is_bound()) t3346() = OMIT_VALUE;
else t3346().set_implicit_omit();
}

void PDU__GMM__AttachReject::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.PDU_GMM_AttachReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_AttachReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
  }
}

void PDU__GMM__AttachReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_t3346.encode_text(text_buf);
}

void PDU__GMM__AttachReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_t3346.decode_text(text_buf);
}

void PDU__GMM__AttachReject::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 PDU__GMM__AttachReject::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 PDU__GMM__AttachReject::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_messageType.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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.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 (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_t3346 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3346().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_t3346 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35){
  field_t3346=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_t3346=OMIT_VALUE;
  if (field_messageType !=  bs_29) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AttachReject::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_t3346.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_t3346.ispresent()) {
  encoded_length += field_t3346().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3346.ispresent() && (!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_35.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);
  }
  }
  if (field_messageType !=  bs_29) {
  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_29.RAW_encode(General__Types::BIT8_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 PDU__GMM__AttachReject_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
GPRSTimer2TLV_template field_t3346;
};

void PDU__GMM__AttachReject_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_t3346 = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachReject_template::copy_value(const PDU__GMM__AttachReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.t3346().is_bound()) {
  if (other_value.t3346().ispresent()) single_value->field_t3346 = other_value.t3346()();
  else single_value->field_t3346 = OMIT_VALUE;
} else {
  single_value->field_t3346.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachReject_template::copy_template(const PDU__GMM__AttachReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3346().get_selection()) {
single_value->field_t3346 = other_value.t3346();
} else {
single_value->field_t3346.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 PDU__GMM__AttachReject_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 PDU__GMM__AttachReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachReject_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.PDU_GMM_AttachReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachReject_template::PDU__GMM__AttachReject_template()
{
}

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

PDU__GMM__AttachReject_template::PDU__GMM__AttachReject_template(const PDU__GMM__AttachReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AttachReject_template::match(const PDU__GMM__AttachReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.t3346().is_bound()) return FALSE;
if((other_value.t3346().ispresent() ? !single_value->field_t3346.match((const GPRSTimer2TLV&)other_value.t3346(), legacy) : !single_value->field_t3346.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.PDU_GMM_AttachReject.");
}
return FALSE;
}

boolean PDU__GMM__AttachReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_t3346.is_omit() || single_value->field_t3346.is_bound());
}

boolean PDU__GMM__AttachReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_t3346.is_omit() || single_value->field_t3346.is_value());
}

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

PDU__GMM__AttachReject PDU__GMM__AttachReject_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.PDU_GMM_AttachReject.");
PDU__GMM__AttachReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_t3346.is_omit()) ret_val.t3346() = OMIT_VALUE;
else if (single_value->field_t3346.is_bound()) {
ret_val.t3346() = single_value->field_t3346.valueof();
}
return ret_val;
}

void PDU__GMM__AttachReject_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.PDU_GMM_AttachReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachReject_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AttachReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__AttachReject_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__AttachReject_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_t3302;
}

GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3346()
{
set_specific();
return single_value->field_t3346;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3346() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3346 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_t3346;
}

int PDU__GMM__AttachReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_t3346.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.PDU_GMM_AttachReject 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.PDU_GMM_AttachReject 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.PDU_GMM_AttachReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
  }
  return 0;
}

void PDU__GMM__AttachReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
single_value->field_t3346.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 PDU__GMM__AttachReject_template::log_match(const PDU__GMM__AttachReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3346().ispresent()){
if(!single_value->field_t3346.match(match_value.t3346(), legacy)){
TTCN_Logger::log_logmatch_info(".t3346");
single_value->field_t3346.log_match(match_value.t3346(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3346.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3346 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3346.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3346 := ");
if (match_value.t3346().ispresent()) {
single_value->field_t3346.log_match(match_value.t3346(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3346.log();
if (single_value->field_t3346.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 PDU__GMM__AttachReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_t3346.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.PDU_GMM_AttachReject.");
}
}

void PDU__GMM__AttachReject_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_t3346.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 PDU__GMM__AttachReject_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.PDU_GMM_AttachReject.");
}
}

void PDU__GMM__AttachReject_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: {
    PDU__GMM__AttachReject_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.PDU_GMM_AttachReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_AttachReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachReject_template* precondition = new PDU__GMM__AttachReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachReject_template* implied_template = new PDU__GMM__AttachReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_t3346.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
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.PDU_GMM_AttachReject");
}

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

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

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS()
{
}

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS(const BITSTRING& par_messageType,
    const DetachTypeV& par_detachType,
    const ForceToStandbyV& par_forceToStandby,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause)
  :   field_messageType(par_messageType),
  field_detachType(par_detachType),
  field_forceToStandby(par_forceToStandby),
  field_gmmCause(par_gmmCause)
{
}

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
else field_detachType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
}

void PDU__GMM__DetachRequest__SGSN__MS::clean_up()
{
field_messageType.clean_up();
field_detachType.clean_up();
field_forceToStandby.clean_up();
field_gmmCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachRequest__SGSN__MS::get_descriptor() const { return &PDU__GMM__DetachRequest__SGSN__MS_descr_; }
PDU__GMM__DetachRequest__SGSN__MS& PDU__GMM__DetachRequest__SGSN__MS::operator=(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
  else field_detachType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachRequest__SGSN__MS::operator==(const PDU__GMM__DetachRequest__SGSN__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_detachType==other_value.field_detachType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_gmmCause==other_value.field_gmmCause;
}

boolean PDU__GMM__DetachRequest__SGSN__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_detachType.is_bound())
  || (field_forceToStandby.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound());
}
boolean PDU__GMM__DetachRequest__SGSN__MS::is_value() const
{
return field_messageType.is_value()
  && field_detachType.is_value()
  && field_forceToStandby.is_value()
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value());
}
int PDU__GMM__DetachRequest__SGSN__MS::size_of() const
{
  int ret_val = 3;
  if (field_gmmCause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__DetachRequest__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
field_detachType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachRequest__SGSN__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
}

void PDU__GMM__DetachRequest__SGSN__MS::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.PDU_GMM_DetachRequest_SGSN_MS 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gmmCause().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().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.PDU_GMM_DetachRequest_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
  }
}

void PDU__GMM__DetachRequest__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_detachType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
}

void PDU__GMM__DetachRequest__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_detachType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
}

void PDU__GMM__DetachRequest__SGSN__MS::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 PDU__GMM__DetachRequest__SGSN__MS::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 PDU__GMM__DetachRequest__SGSN__MS::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_messageType.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, DetachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_detachType.RAW_decode(DetachTypeV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (field_messageType !=  bs_30) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__DetachRequest__SGSN__MS::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DetachTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_detachType.RAW_encode(DetachTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_messageType !=  bs_30) {
  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_30.RAW_encode(General__Types::BIT8_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 PDU__GMM__DetachRequest__SGSN__MS_template::single_value_struct {
BITSTRING_template field_messageType;
DetachTypeV_template field_detachType;
ForceToStandbyV_template field_forceToStandby;
GMM__CauseTV_template field_gmmCause;
};

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType = ANY_VALUE;
single_value->field_detachType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_gmmCause = ANY_OR_OMIT;
}
}
}

void PDU__GMM__DetachRequest__SGSN__MS_template::copy_value(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.detachType().is_bound()) {
  single_value->field_detachType = other_value.detachType();
} else {
  single_value->field_detachType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachRequest__SGSN__MS_template::copy_template(const PDU__GMM__DetachRequest__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.detachType().get_selection()) {
single_value->field_detachType = other_value.detachType();
} else {
single_value->field_detachType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.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 PDU__GMM__DetachRequest__SGSN__MS_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 PDU__GMM__DetachRequest__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachRequest__SGSN__MS_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.PDU_GMM_DetachRequest_SGSN_MS.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachRequest__SGSN__MS_template::PDU__GMM__DetachRequest__SGSN__MS_template()
{
}

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

PDU__GMM__DetachRequest__SGSN__MS_template::PDU__GMM__DetachRequest__SGSN__MS_template(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__DetachRequest__SGSN__MS_template::match(const PDU__GMM__DetachRequest__SGSN__MS& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.detachType().is_bound()) return FALSE;
if(!single_value->field_detachType.match(other_value.detachType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.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.PDU_GMM_DetachRequest_SGSN_MS.");
}
return FALSE;
}

boolean PDU__GMM__DetachRequest__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_detachType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound());
}

boolean PDU__GMM__DetachRequest__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_detachType.is_value()
 && single_value->field_forceToStandby.is_value()
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value());
}

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

PDU__GMM__DetachRequest__SGSN__MS PDU__GMM__DetachRequest__SGSN__MS_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.PDU_GMM_DetachRequest_SGSN_MS.");
PDU__GMM__DetachRequest__SGSN__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_detachType.is_bound()) {
ret_val.detachType() = single_value->field_detachType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
return ret_val;
}

void PDU__GMM__DetachRequest__SGSN__MS_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.PDU_GMM_DetachRequest_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachRequest__SGSN__MS_template[list_length];
}

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

BITSTRING_template& PDU__GMM__DetachRequest__SGSN__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachRequest__SGSN__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_messageType;
}

DetachTypeV_template& PDU__GMM__DetachRequest__SGSN__MS_template::detachType()
{
set_specific();
return single_value->field_detachType;
}

const DetachTypeV_template& PDU__GMM__DetachRequest__SGSN__MS_template::detachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field detachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_detachType;
}

ForceToStandbyV_template& PDU__GMM__DetachRequest__SGSN__MS_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__DetachRequest__SGSN__MS_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_forceToStandby;
}

GMM__CauseTV_template& PDU__GMM__DetachRequest__SGSN__MS_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__DetachRequest__SGSN__MS_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_gmmCause;
}

int PDU__GMM__DetachRequest__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_gmmCause.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.PDU_GMM_DetachRequest_SGSN_MS 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.PDU_GMM_DetachRequest_SGSN_MS 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.PDU_GMM_DetachRequest_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
  }
  return 0;
}

void PDU__GMM__DetachRequest__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.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 PDU__GMM__DetachRequest__SGSN__MS_template::log_match(const PDU__GMM__DetachRequest__SGSN__MS& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_detachType.match(match_value.detachType(), legacy)){
TTCN_Logger::log_logmatch_info(".detachType");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.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 PDU__GMM__DetachRequest__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_detachType.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_gmmCause.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.PDU_GMM_DetachRequest_SGSN_MS.");
}
}

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType.decode_text(text_buf);
single_value->field_detachType.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_gmmCause.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 PDU__GMM__DetachRequest__SGSN__MS_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.PDU_GMM_DetachRequest_SGSN_MS.");
}
}

void PDU__GMM__DetachRequest__SGSN__MS_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: {
    PDU__GMM__DetachRequest__SGSN__MS_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.PDU_GMM_DetachRequest_SGSN_MS 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gmmCause().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().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.PDU_GMM_DetachRequest_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachRequest__SGSN__MS_template* precondition = new PDU__GMM__DetachRequest__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachRequest__SGSN__MS_template* implied_template = new PDU__GMM__DetachRequest__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachRequest__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_detachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
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.PDU_GMM_DetachRequest_SGSN_MS");
}

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

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

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN()
{
}

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN(const BITSTRING& par_messageType,
    const DetachTypeV& par_detachType,
    const BITSTRING& par_spare,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_ptmsi,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSISignature2TLV >& par_ptmsiSignature)
  :   field_messageType(par_messageType),
  field_detachType(par_detachType),
  field_spare(par_spare),
  field_ptmsi(par_ptmsi),
  field_ptmsiSignature(par_ptmsiSignature)
{
}

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
else field_detachType.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
else field_ptmsi.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
}

void PDU__GMM__DetachRequest__MS__SGSN::clean_up()
{
field_messageType.clean_up();
field_detachType.clean_up();
field_spare.clean_up();
field_ptmsi.clean_up();
field_ptmsiSignature.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachRequest__MS__SGSN::get_descriptor() const { return &PDU__GMM__DetachRequest__MS__SGSN_descr_; }
PDU__GMM__DetachRequest__MS__SGSN& PDU__GMM__DetachRequest__MS__SGSN::operator=(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
  else field_detachType.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
  else field_ptmsi.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachRequest__MS__SGSN::operator==(const PDU__GMM__DetachRequest__MS__SGSN& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_detachType==other_value.field_detachType
  && field_spare==other_value.field_spare
  && field_ptmsi==other_value.field_ptmsi
  && field_ptmsiSignature==other_value.field_ptmsiSignature;
}

boolean PDU__GMM__DetachRequest__MS__SGSN::is_bound() const
{
return (field_messageType.is_bound())
  || (field_detachType.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound());
}
boolean PDU__GMM__DetachRequest__MS__SGSN::is_value() const
{
return field_messageType.is_value()
  && field_detachType.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_value())
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value());
}
int PDU__GMM__DetachRequest__MS__SGSN::size_of() const
{
  int ret_val = 3;
  if (field_ptmsi.ispresent()) ret_val++;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__DetachRequest__MS__SGSN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
field_detachType.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", ptmsi := ");
field_ptmsi.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachRequest__MS__SGSN::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__DetachRequest__MS__SGSN::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.PDU_GMM_DetachRequest_MS_SGSN 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().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.PDU_GMM_DetachRequest_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
  }
}

void PDU__GMM__DetachRequest__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_detachType.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_ptmsi.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
}

void PDU__GMM__DetachRequest__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_detachType.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_ptmsi.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
}

void PDU__GMM__DetachRequest__MS__SGSN::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 PDU__GMM__DetachRequest__MS__SGSN::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 PDU__GMM__DetachRequest__MS__SGSN::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_messageType.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, DetachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_detachType.RAW_decode(DetachTypeV_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_ptmsi = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsi().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsi = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26){
  field_ptmsi=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_ptmsi=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (field_messageType !=  bs_30) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__DetachRequest__MS__SGSN::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DetachTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  if (field_ptmsi.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_detachType.RAW_encode(DetachTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_ptmsi.ispresent()) {
  encoded_length += field_ptmsi().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_ptmsi.ispresent() && (!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_messageType !=  bs_30) {
  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_30.RAW_encode(General__Types::BIT8_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 PDU__GMM__DetachRequest__MS__SGSN_template::single_value_struct {
BITSTRING_template field_messageType;
DetachTypeV_template field_detachType;
BITSTRING_template field_spare;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_ptmsi;
MobileL3__CommonIE__Types::P__TMSISignature2TLV_template field_ptmsiSignature;
};

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType = ANY_VALUE;
single_value->field_detachType = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_ptmsi = ANY_OR_OMIT;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
}
}
}

void PDU__GMM__DetachRequest__MS__SGSN_template::copy_value(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.detachType().is_bound()) {
  single_value->field_detachType = other_value.detachType();
} else {
  single_value->field_detachType.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.ptmsi().is_bound()) {
  if (other_value.ptmsi().ispresent()) single_value->field_ptmsi = other_value.ptmsi()();
  else single_value->field_ptmsi = OMIT_VALUE;
} else {
  single_value->field_ptmsi.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachRequest__MS__SGSN_template::copy_template(const PDU__GMM__DetachRequest__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.detachType().get_selection()) {
single_value->field_detachType = other_value.detachType();
} else {
single_value->field_detachType.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.ptmsi().get_selection()) {
single_value->field_ptmsi = other_value.ptmsi();
} else {
single_value->field_ptmsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.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 PDU__GMM__DetachRequest__MS__SGSN_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 PDU__GMM__DetachRequest__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachRequest__MS__SGSN_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.PDU_GMM_DetachRequest_MS_SGSN.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachRequest__MS__SGSN_template::PDU__GMM__DetachRequest__MS__SGSN_template()
{
}

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

PDU__GMM__DetachRequest__MS__SGSN_template::PDU__GMM__DetachRequest__MS__SGSN_template(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__DetachRequest__MS__SGSN_template::match(const PDU__GMM__DetachRequest__MS__SGSN& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.detachType().is_bound()) return FALSE;
if(!single_value->field_detachType.match(other_value.detachType(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.ptmsi().is_bound()) return FALSE;
if((other_value.ptmsi().ispresent() ? !single_value->field_ptmsi.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.ptmsi(), legacy) : !single_value->field_ptmsi.match_omit(legacy)))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const MobileL3__CommonIE__Types::P__TMSISignature2TLV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.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.PDU_GMM_DetachRequest_MS_SGSN.");
}
return FALSE;
}

boolean PDU__GMM__DetachRequest__MS__SGSN_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_detachType.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_bound())
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound());
}

boolean PDU__GMM__DetachRequest__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_detachType.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_value())
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value());
}

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

PDU__GMM__DetachRequest__MS__SGSN PDU__GMM__DetachRequest__MS__SGSN_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.PDU_GMM_DetachRequest_MS_SGSN.");
PDU__GMM__DetachRequest__MS__SGSN ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_detachType.is_bound()) {
ret_val.detachType() = single_value->field_detachType.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_ptmsi.is_omit()) ret_val.ptmsi() = OMIT_VALUE;
else if (single_value->field_ptmsi.is_bound()) {
ret_val.ptmsi() = single_value->field_ptmsi.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
return ret_val;
}

void PDU__GMM__DetachRequest__MS__SGSN_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.PDU_GMM_DetachRequest_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachRequest__MS__SGSN_template[list_length];
}

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

BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_messageType;
}

DetachTypeV_template& PDU__GMM__DetachRequest__MS__SGSN_template::detachType()
{
set_specific();
return single_value->field_detachType;
}

const DetachTypeV_template& PDU__GMM__DetachRequest__MS__SGSN_template::detachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field detachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_detachType;
}

BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_spare;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsi()
{
set_specific();
return single_value->field_ptmsi;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsi of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_ptmsi;
}

MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_ptmsiSignature;
}

int PDU__GMM__DetachRequest__MS__SGSN_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_ptmsi.is_present()) ret_val++;
      if (single_value->field_ptmsiSignature.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.PDU_GMM_DetachRequest_MS_SGSN 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.PDU_GMM_DetachRequest_MS_SGSN 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.PDU_GMM_DetachRequest_MS_SGSN containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
  }
  return 0;
}

void PDU__GMM__DetachRequest__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.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 PDU__GMM__DetachRequest__MS__SGSN_template::log_match(const PDU__GMM__DetachRequest__MS__SGSN& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_detachType.match(match_value.detachType(), legacy)){
TTCN_Logger::log_logmatch_info(".detachType");
single_value->field_detachType.log_match(match_value.detachType(), 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);
}
if (match_value.ptmsi().ispresent()){
if(!single_value->field_ptmsi.match(match_value.ptmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsi");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", ptmsi := ");
if (match_value.ptmsi().ispresent()) {
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsi.log();
if (single_value->field_ptmsi.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.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 PDU__GMM__DetachRequest__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_detachType.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_ptmsi.encode_text(text_buf);
single_value->field_ptmsiSignature.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.PDU_GMM_DetachRequest_MS_SGSN.");
}
}

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType.decode_text(text_buf);
single_value->field_detachType.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_ptmsi.decode_text(text_buf);
single_value->field_ptmsiSignature.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 PDU__GMM__DetachRequest__MS__SGSN_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.PDU_GMM_DetachRequest_MS_SGSN.");
}
}

void PDU__GMM__DetachRequest__MS__SGSN_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: {
    PDU__GMM__DetachRequest__MS__SGSN_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.PDU_GMM_DetachRequest_MS_SGSN 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().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.PDU_GMM_DetachRequest_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachRequest__MS__SGSN_template* precondition = new PDU__GMM__DetachRequest__MS__SGSN_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachRequest__MS__SGSN_template* implied_template = new PDU__GMM__DetachRequest__MS__SGSN_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachRequest__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_detachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_ptmsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
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.PDU_GMM_DetachRequest_MS_SGSN");
}

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

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

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN()
{
}

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__DetachAccept__MS__SGSN::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachAccept__MS__SGSN::get_descriptor() const { return &PDU__GMM__DetachAccept__MS__SGSN_descr_; }
PDU__GMM__DetachAccept__MS__SGSN& PDU__GMM__DetachAccept__MS__SGSN::operator=(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachAccept__MS__SGSN::operator==(const PDU__GMM__DetachAccept__MS__SGSN& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__DetachAccept__MS__SGSN::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__DetachAccept__MS__SGSN::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__DetachAccept__MS__SGSN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachAccept__MS__SGSN::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__DetachAccept__MS__SGSN::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.PDU_GMM_DetachAccept_MS_SGSN 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) messageType().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().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.PDU_GMM_DetachAccept_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
  }
}

void PDU__GMM__DetachAccept__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__DetachAccept__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__DetachAccept__MS__SGSN::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 PDU__GMM__DetachAccept__MS__SGSN::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 PDU__GMM__DetachAccept__MS__SGSN::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_messageType.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());
  if (field_messageType !=  bs_31) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__DetachAccept__MS__SGSN::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_31) {
  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_31.RAW_encode(General__Types::BIT8_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 PDU__GMM__DetachAccept__MS__SGSN_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__DetachAccept__MS__SGSN_template::copy_value(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachAccept__MS__SGSN_template::copy_template(const PDU__GMM__DetachAccept__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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 PDU__GMM__DetachAccept__MS__SGSN_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 PDU__GMM__DetachAccept__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachAccept__MS__SGSN_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.PDU_GMM_DetachAccept_MS_SGSN.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachAccept__MS__SGSN_template::PDU__GMM__DetachAccept__MS__SGSN_template()
{
}

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

PDU__GMM__DetachAccept__MS__SGSN_template::PDU__GMM__DetachAccept__MS__SGSN_template(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__DetachAccept__MS__SGSN_template::match(const PDU__GMM__DetachAccept__MS__SGSN& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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.PDU_GMM_DetachAccept_MS_SGSN.");
}
return FALSE;
}

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

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

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

PDU__GMM__DetachAccept__MS__SGSN PDU__GMM__DetachAccept__MS__SGSN_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.PDU_GMM_DetachAccept_MS_SGSN.");
PDU__GMM__DetachAccept__MS__SGSN ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__DetachAccept__MS__SGSN_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.PDU_GMM_DetachAccept_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachAccept__MS__SGSN_template[list_length];
}

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

BITSTRING_template& PDU__GMM__DetachAccept__MS__SGSN_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachAccept__MS__SGSN_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
return single_value->field_messageType;
}

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

void PDU__GMM__DetachAccept__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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 PDU__GMM__DetachAccept__MS__SGSN_template::log_match(const PDU__GMM__DetachAccept__MS__SGSN& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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 PDU__GMM__DetachAccept__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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.PDU_GMM_DetachAccept_MS_SGSN.");
}
}

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType.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 PDU__GMM__DetachAccept__MS__SGSN_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.PDU_GMM_DetachAccept_MS_SGSN.");
}
}

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

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
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.PDU_GMM_DetachAccept_MS_SGSN");
}

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

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

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS()
{
}

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS(const BITSTRING& par_messageType,
    const ForceToStandbyV& par_forceToStandby,
    const BITSTRING& par_spare)
  :   field_messageType(par_messageType),
  field_forceToStandby(par_forceToStandby),
  field_spare(par_spare)
{
}

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PDU__GMM__DetachAccept__SGSN__MS::clean_up()
{
field_messageType.clean_up();
field_forceToStandby.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachAccept__SGSN__MS::get_descriptor() const { return &PDU__GMM__DetachAccept__SGSN__MS_descr_; }
PDU__GMM__DetachAccept__SGSN__MS& PDU__GMM__DetachAccept__SGSN__MS::operator=(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachAccept__SGSN__MS::operator==(const PDU__GMM__DetachAccept__SGSN__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_spare==other_value.field_spare;
}

boolean PDU__GMM__DetachAccept__SGSN__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_spare.is_bound());
}
boolean PDU__GMM__DetachAccept__SGSN__MS::is_value() const
{
return field_messageType.is_value()
  && field_forceToStandby.is_value()
  && field_spare.is_value();
}
void PDU__GMM__DetachAccept__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachAccept__SGSN__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void PDU__GMM__DetachAccept__SGSN__MS::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.PDU_GMM_DetachAccept_SGSN_MS 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PDU_GMM_DetachAccept_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
  }
}

void PDU__GMM__DetachAccept__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PDU__GMM__DetachAccept__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void PDU__GMM__DetachAccept__SGSN__MS::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 PDU__GMM__DetachAccept__SGSN__MS::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 PDU__GMM__DetachAccept__SGSN__MS::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_messageType.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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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 (field_messageType !=  bs_31) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__DetachAccept__SGSN__MS::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_messageType !=  bs_31) {
  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_31.RAW_encode(General__Types::BIT8_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 PDU__GMM__DetachAccept__SGSN__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ForceToStandbyV_template field_forceToStandby;
BITSTRING_template field_spare;
};

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PDU__GMM__DetachAccept__SGSN__MS_template::copy_value(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template::copy_template(const PDU__GMM__DetachAccept__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_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 PDU__GMM__DetachAccept__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachAccept__SGSN__MS_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.PDU_GMM_DetachAccept_SGSN_MS.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachAccept__SGSN__MS_template::PDU__GMM__DetachAccept__SGSN__MS_template()
{
}

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

PDU__GMM__DetachAccept__SGSN__MS_template::PDU__GMM__DetachAccept__SGSN__MS_template(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__DetachAccept__SGSN__MS_template::match(const PDU__GMM__DetachAccept__SGSN__MS& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), 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.PDU_GMM_DetachAccept_SGSN_MS.");
}
return FALSE;
}

boolean PDU__GMM__DetachAccept__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_spare.is_bound();
}

boolean PDU__GMM__DetachAccept__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_spare.is_value();
}

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

PDU__GMM__DetachAccept__SGSN__MS PDU__GMM__DetachAccept__SGSN__MS_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.PDU_GMM_DetachAccept_SGSN_MS.");
PDU__GMM__DetachAccept__SGSN__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void PDU__GMM__DetachAccept__SGSN__MS_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.PDU_GMM_DetachAccept_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachAccept__SGSN__MS_template[list_length];
}

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

BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_messageType;
}

ForceToStandbyV_template& PDU__GMM__DetachAccept__SGSN__MS_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__DetachAccept__SGSN__MS_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_forceToStandby;
}

BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_spare;
}

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

void PDU__GMM__DetachAccept__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template::log_match(const PDU__GMM__DetachAccept__SGSN__MS& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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 PDU__GMM__DetachAccept__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_forceToStandby.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.PDU_GMM_DetachAccept_SGSN_MS.");
}
}

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType.decode_text(text_buf);
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_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.PDU_GMM_DetachAccept_SGSN_MS.");
}
}

void PDU__GMM__DetachAccept__SGSN__MS_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: {
    PDU__GMM__DetachAccept__SGSN__MS_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.PDU_GMM_DetachAccept_SGSN_MS 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PDU_GMM_DetachAccept_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachAccept__SGSN__MS_template* precondition = new PDU__GMM__DetachAccept__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachAccept__SGSN__MS_template* implied_template = new PDU__GMM__DetachAccept__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachAccept__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
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.PDU_GMM_DetachAccept_SGSN_MS");
}

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

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

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand()
{
}

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_allocatedPTMSI,
    const RoutingAreaIdentificationV& par_routingAreaIdentification,
    const ForceToStandbyV& par_forceToStandby,
    const BITSTRING& par_spare,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature)
  :   field_messageType(par_messageType),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_forceToStandby(par_forceToStandby),
  field_spare(par_spare),
  field_ptmsiSignature(par_ptmsiSignature)
{
}

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
}

void PDU__GMM__P__TMSIReallocationCommand::clean_up()
{
field_messageType.clean_up();
field_allocatedPTMSI.clean_up();
field_routingAreaIdentification.clean_up();
field_forceToStandby.clean_up();
field_spare.clean_up();
field_ptmsiSignature.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__P__TMSIReallocationCommand::get_descriptor() const { return &PDU__GMM__P__TMSIReallocationCommand_descr_; }
PDU__GMM__P__TMSIReallocationCommand& PDU__GMM__P__TMSIReallocationCommand::operator=(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
}
return *this;
}

boolean PDU__GMM__P__TMSIReallocationCommand::operator==(const PDU__GMM__P__TMSIReallocationCommand& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_forceToStandby==other_value.field_forceToStandby
  && field_spare==other_value.field_spare
  && field_ptmsiSignature==other_value.field_ptmsiSignature;
}

boolean PDU__GMM__P__TMSIReallocationCommand::is_bound() const
{
return (field_messageType.is_bound())
  || (field_allocatedPTMSI.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound());
}
boolean PDU__GMM__P__TMSIReallocationCommand::is_value() const
{
return field_messageType.is_value()
  && field_allocatedPTMSI.is_value()
  && field_routingAreaIdentification.is_value()
  && field_forceToStandby.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value());
}
int PDU__GMM__P__TMSIReallocationCommand::size_of() const
{
  int ret_val = 5;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__P__TMSIReallocationCommand::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__P__TMSIReallocationCommand::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (allocatedPTMSI().is_bound()) allocatedPTMSI().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationCommand::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.PDU_GMM_P_TMSIReallocationCommand 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().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.PDU_GMM_P_TMSIReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
  }
}

void PDU__GMM__P__TMSIReallocationCommand::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationCommand::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationCommand::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 PDU__GMM__P__TMSIReallocationCommand::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 PDU__GMM__P__TMSIReallocationCommand::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_messageType.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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(RoutingAreaIdentificationV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (field_messageType !=  bs_32) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__P__TMSIReallocationCommand::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT4_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_allocatedPTMSI.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routingAreaIdentification.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[4]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_messageType !=  bs_32) {
  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_32.RAW_encode(General__Types::BIT8_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 PDU__GMM__P__TMSIReallocationCommand_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_allocatedPTMSI;
RoutingAreaIdentificationV_template field_routingAreaIdentification;
ForceToStandbyV_template field_forceToStandby;
BITSTRING_template field_spare;
P__TMSISignatureTV_template field_ptmsiSignature;
};

void PDU__GMM__P__TMSIReallocationCommand_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_messageType = ANY_VALUE;
single_value->field_allocatedPTMSI = ANY_VALUE;
single_value->field_routingAreaIdentification = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
}
}
}

void PDU__GMM__P__TMSIReallocationCommand_template::copy_value(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__P__TMSIReallocationCommand_template::copy_template(const PDU__GMM__P__TMSIReallocationCommand_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.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 PDU__GMM__P__TMSIReallocationCommand_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 PDU__GMM__P__TMSIReallocationCommand_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__P__TMSIReallocationCommand_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.PDU_GMM_P_TMSIReallocationCommand.");
break;
}
set_selection(other_value);
}

PDU__GMM__P__TMSIReallocationCommand_template::PDU__GMM__P__TMSIReallocationCommand_template()
{
}

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

PDU__GMM__P__TMSIReallocationCommand_template::PDU__GMM__P__TMSIReallocationCommand_template(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__P__TMSIReallocationCommand_template::match(const PDU__GMM__P__TMSIReallocationCommand& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if(!single_value->field_allocatedPTMSI.match(other_value.allocatedPTMSI(), legacy))return FALSE;
if(!other_value.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.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.PDU_GMM_P_TMSIReallocationCommand.");
}
return FALSE;
}

boolean PDU__GMM__P__TMSIReallocationCommand_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_allocatedPTMSI.is_bound()
 || single_value->field_routingAreaIdentification.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound());
}

boolean PDU__GMM__P__TMSIReallocationCommand_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_allocatedPTMSI.is_value()
 && single_value->field_routingAreaIdentification.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value());
}

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

PDU__GMM__P__TMSIReallocationCommand PDU__GMM__P__TMSIReallocationCommand_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.PDU_GMM_P_TMSIReallocationCommand.");
PDU__GMM__P__TMSIReallocationCommand ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
return ret_val;
}

void PDU__GMM__P__TMSIReallocationCommand_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.PDU_GMM_P_TMSIReallocationCommand.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__P__TMSIReallocationCommand_template[list_length];
}

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

BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__P__TMSIReallocationCommand_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__P__TMSIReallocationCommand_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_allocatedPTMSI;
}

RoutingAreaIdentificationV_template& PDU__GMM__P__TMSIReallocationCommand_template::routingAreaIdentification()
{
set_specific();
return single_value->field_routingAreaIdentification;
}

const RoutingAreaIdentificationV_template& PDU__GMM__P__TMSIReallocationCommand_template::routingAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_routingAreaIdentification;
}

ForceToStandbyV_template& PDU__GMM__P__TMSIReallocationCommand_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__P__TMSIReallocationCommand_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_forceToStandby;
}

BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_spare;
}

P__TMSISignatureTV_template& PDU__GMM__P__TMSIReallocationCommand_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__P__TMSIReallocationCommand_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_ptmsiSignature;
}

int PDU__GMM__P__TMSIReallocationCommand_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_ptmsiSignature.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.PDU_GMM_P_TMSIReallocationCommand 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.PDU_GMM_P_TMSIReallocationCommand 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.PDU_GMM_P_TMSIReallocationCommand containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
  }
  return 0;
}

void PDU__GMM__P__TMSIReallocationCommand_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.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 PDU__GMM__P__TMSIReallocationCommand_template::log_match(const PDU__GMM__P__TMSIReallocationCommand& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.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 PDU__GMM__P__TMSIReallocationCommand_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_routingAreaIdentification.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_ptmsiSignature.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.PDU_GMM_P_TMSIReallocationCommand.");
}
}

void PDU__GMM__P__TMSIReallocationCommand_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_messageType.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_routingAreaIdentification.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_ptmsiSignature.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 PDU__GMM__P__TMSIReallocationCommand_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.PDU_GMM_P_TMSIReallocationCommand.");
}
}

void PDU__GMM__P__TMSIReallocationCommand_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: {
    PDU__GMM__P__TMSIReallocationCommand_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.PDU_GMM_P_TMSIReallocationCommand 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().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.PDU_GMM_P_TMSIReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__P__TMSIReallocationCommand_template* precondition = new PDU__GMM__P__TMSIReallocationCommand_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__P__TMSIReallocationCommand_template* implied_template = new PDU__GMM__P__TMSIReallocationCommand_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__P__TMSIReallocationCommand_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__P__TMSIReallocationCommand_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
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.PDU_GMM_P_TMSIReallocationCommand");
}

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

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

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete()
{
}

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__P__TMSIReallocationComplete::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__P__TMSIReallocationComplete::get_descriptor() const { return &PDU__GMM__P__TMSIReallocationComplete_descr_; }
PDU__GMM__P__TMSIReallocationComplete& PDU__GMM__P__TMSIReallocationComplete::operator=(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__P__TMSIReallocationComplete::operator==(const PDU__GMM__P__TMSIReallocationComplete& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__P__TMSIReallocationComplete::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__P__TMSIReallocationComplete::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__P__TMSIReallocationComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__P__TMSIReallocationComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationComplete::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.PDU_GMM_P_TMSIReallocationComplete 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) messageType().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().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.PDU_GMM_P_TMSIReallocationComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
  }
}

void PDU__GMM__P__TMSIReallocationComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationComplete::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 PDU__GMM__P__TMSIReallocationComplete::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 PDU__GMM__P__TMSIReallocationComplete::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_messageType.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());
  if (field_messageType !=  bs_33) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__P__TMSIReallocationComplete::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_33) {
  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_33.RAW_encode(General__Types::BIT8_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 PDU__GMM__P__TMSIReallocationComplete_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__P__TMSIReallocationComplete_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__P__TMSIReallocationComplete_template::copy_value(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__P__TMSIReallocationComplete_template::copy_template(const PDU__GMM__P__TMSIReallocationComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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 PDU__GMM__P__TMSIReallocationComplete_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 PDU__GMM__P__TMSIReallocationComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__P__TMSIReallocationComplete_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.PDU_GMM_P_TMSIReallocationComplete.");
break;
}
set_selection(other_value);
}

PDU__GMM__P__TMSIReallocationComplete_template::PDU__GMM__P__TMSIReallocationComplete_template()
{
}

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

PDU__GMM__P__TMSIReallocationComplete_template::PDU__GMM__P__TMSIReallocationComplete_template(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__P__TMSIReallocationComplete_template::match(const PDU__GMM__P__TMSIReallocationComplete& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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.PDU_GMM_P_TMSIReallocationComplete.");
}
return FALSE;
}

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

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

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

PDU__GMM__P__TMSIReallocationComplete PDU__GMM__P__TMSIReallocationComplete_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.PDU_GMM_P_TMSIReallocationComplete.");
PDU__GMM__P__TMSIReallocationComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__P__TMSIReallocationComplete_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.PDU_GMM_P_TMSIReallocationComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__P__TMSIReallocationComplete_template[list_length];
}

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

BITSTRING_template& PDU__GMM__P__TMSIReallocationComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
return single_value->field_messageType;
}

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

void PDU__GMM__P__TMSIReallocationComplete_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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 PDU__GMM__P__TMSIReallocationComplete_template::log_match(const PDU__GMM__P__TMSIReallocationComplete& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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 PDU__GMM__P__TMSIReallocationComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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.PDU_GMM_P_TMSIReallocationComplete.");
}
}

void PDU__GMM__P__TMSIReallocationComplete_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_messageType.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 PDU__GMM__P__TMSIReallocationComplete_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.PDU_GMM_P_TMSIReallocationComplete.");
}
}

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

void PDU__GMM__P__TMSIReallocationComplete_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
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.PDU_GMM_P_TMSIReallocationComplete");
}

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

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

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest()
{
}

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest(const BITSTRING& par_messageType,
    const CipheringAlgorithmV& par_cipheringAlgorithm,
    const IMEISVRequestV& par_imeisvRequest,
    const ForceToStandbyV& par_forceToStandby,
    const ACReferenceNumberV& par_acReferenceNumber,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationParameterRANDTV >& par_authenticationParameterRAND,
    const OPTIONAL< MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV >& par_cipheringKeySequenceNumber,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationParameterAUTNTLV >& par_authenticationParameterAUTN)
  :   field_messageType(par_messageType),
  field_cipheringAlgorithm(par_cipheringAlgorithm),
  field_imeisvRequest(par_imeisvRequest),
  field_forceToStandby(par_forceToStandby),
  field_acReferenceNumber(par_acReferenceNumber),
  field_authenticationParameterRAND(par_authenticationParameterRAND),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_authenticationParameterAUTN(par_authenticationParameterAUTN)
{
}

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cipheringAlgorithm().is_bound()) field_cipheringAlgorithm = other_value.cipheringAlgorithm();
else field_cipheringAlgorithm.clean_up();
if (other_value.imeisvRequest().is_bound()) field_imeisvRequest = other_value.imeisvRequest();
else field_imeisvRequest.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
else field_acReferenceNumber.clean_up();
if (other_value.authenticationParameterRAND().is_bound()) field_authenticationParameterRAND = other_value.authenticationParameterRAND();
else field_authenticationParameterRAND.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.authenticationParameterAUTN().is_bound()) field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
else field_authenticationParameterAUTN.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringRequest::clean_up()
{
field_messageType.clean_up();
field_cipheringAlgorithm.clean_up();
field_imeisvRequest.clean_up();
field_forceToStandby.clean_up();
field_acReferenceNumber.clean_up();
field_authenticationParameterRAND.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_authenticationParameterAUTN.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringRequest::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringRequest_descr_; }
PDU__GMM__AuthenticationAndCipheringRequest& PDU__GMM__AuthenticationAndCipheringRequest::operator=(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cipheringAlgorithm().is_bound()) field_cipheringAlgorithm = other_value.cipheringAlgorithm();
  else field_cipheringAlgorithm.clean_up();
  if (other_value.imeisvRequest().is_bound()) field_imeisvRequest = other_value.imeisvRequest();
  else field_imeisvRequest.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
  else field_acReferenceNumber.clean_up();
  if (other_value.authenticationParameterRAND().is_bound()) field_authenticationParameterRAND = other_value.authenticationParameterRAND();
  else field_authenticationParameterRAND.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.authenticationParameterAUTN().is_bound()) field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
  else field_authenticationParameterAUTN.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest::operator==(const PDU__GMM__AuthenticationAndCipheringRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cipheringAlgorithm==other_value.field_cipheringAlgorithm
  && field_imeisvRequest==other_value.field_imeisvRequest
  && field_forceToStandby==other_value.field_forceToStandby
  && field_acReferenceNumber==other_value.field_acReferenceNumber
  && field_authenticationParameterRAND==other_value.field_authenticationParameterRAND
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_authenticationParameterAUTN==other_value.field_authenticationParameterAUTN;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cipheringAlgorithm.is_bound())
  || (field_imeisvRequest.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_acReferenceNumber.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParameterRAND.get_selection() || field_authenticationParameterRAND.is_bound())
  || (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParameterAUTN.get_selection() || field_authenticationParameterAUTN.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringRequest::is_value() const
{
return field_messageType.is_value()
  && field_cipheringAlgorithm.is_value()
  && field_imeisvRequest.is_value()
  && field_forceToStandby.is_value()
  && field_acReferenceNumber.is_value()
  && (OPTIONAL_OMIT == field_authenticationParameterRAND.get_selection() || field_authenticationParameterRAND.is_value())
  && (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_value())
  && (OPTIONAL_OMIT == field_authenticationParameterAUTN.get_selection() || field_authenticationParameterAUTN.is_value());
}
int PDU__GMM__AuthenticationAndCipheringRequest::size_of() const
{
  int ret_val = 5;
  if (field_authenticationParameterRAND.ispresent()) ret_val++;
  if (field_cipheringKeySequenceNumber.ispresent()) ret_val++;
  if (field_authenticationParameterAUTN.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
field_cipheringAlgorithm.log();
TTCN_Logger::log_event_str(", imeisvRequest := ");
field_imeisvRequest.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
field_authenticationParameterAUTN.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipheringAlgorithm().is_bound()) cipheringAlgorithm().set_implicit_omit();
if (imeisvRequest().is_bound()) imeisvRequest().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (!authenticationParameterRAND().is_bound()) authenticationParameterRAND() = OMIT_VALUE;
else authenticationParameterRAND().set_implicit_omit();
if (!cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber() = OMIT_VALUE;
else cipheringKeySequenceNumber().set_implicit_omit();
if (!authenticationParameterAUTN().is_bound()) authenticationParameterAUTN() = OMIT_VALUE;
else authenticationParameterAUTN().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringRequest::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.PDU_GMM_AuthenticationAndCipheringRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringAlgorithm().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imeisvRequest().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterRAND().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterAUTN().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisvRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisvRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "authenticationParameterRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterAUTN().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.PDU_GMM_AuthenticationAndCipheringRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
  }
}

void PDU__GMM__AuthenticationAndCipheringRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cipheringAlgorithm.encode_text(text_buf);
field_imeisvRequest.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_acReferenceNumber.encode_text(text_buf);
field_authenticationParameterRAND.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_authenticationParameterAUTN.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cipheringAlgorithm.decode_text(text_buf);
field_imeisvRequest.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_acReferenceNumber.decode_text(text_buf);
field_authenticationParameterRAND.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_authenticationParameterAUTN.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringRequest::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 PDU__GMM__AuthenticationAndCipheringRequest::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 PDU__GMM__AuthenticationAndCipheringRequest::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_messageType.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, CipheringAlgorithmV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringAlgorithm.RAW_decode(CipheringAlgorithmV_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, IMEISVRequestV_descr_.raw->forceomit);
  decoded_field_length = field_imeisvRequest.RAW_decode(IMEISVRequestV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, ACReferenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumber.RAW_decode(ACReferenceNumberV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_authenticationParameterRAND = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParameterRAND().RAW_decode(MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParameterRAND = 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_authenticationParameterRAND=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_cipheringKeySequenceNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber().RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_cipheringKeySequenceNumber = 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_cipheringKeySequenceNumber=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_authenticationParameterAUTN = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParameterAUTN().RAW_decode(MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParameterAUTN = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationParameterAUTN.ispresent() || field_authenticationParameterAUTN().elementIdentifier() !=  os_14){
  field_authenticationParameterAUTN=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_authenticationParameterAUTN=OMIT_VALUE;
  if (field_messageType !=  bs_34) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AuthenticationAndCipheringRequest::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CipheringAlgorithmV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMEISVRequestV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ACReferenceNumberV_descr_.raw);
  if (field_authenticationParameterRAND.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_cipheringKeySequenceNumber.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_authenticationParameterAUTN.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cipheringAlgorithm.RAW_encode(CipheringAlgorithmV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_imeisvRequest.RAW_encode(IMEISVRequestV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_acReferenceNumber.RAW_encode(ACReferenceNumberV_descr_, *myleaf.body.node.nodes[4]);
  if (field_authenticationParameterRAND.ispresent()) {
  encoded_length += field_authenticationParameterRAND().RAW_encode(MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cipheringKeySequenceNumber.ispresent()) {
  encoded_length += field_cipheringKeySequenceNumber().RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_authenticationParameterAUTN.ispresent()) {
  encoded_length += field_authenticationParameterAUTN().RAW_encode(MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_authenticationParameterAUTN.ispresent() && (!field_authenticationParameterAUTN.ispresent() || field_authenticationParameterAUTN().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,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);
  }
  }
  if (field_messageType !=  bs_34) {
  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_34.RAW_encode(General__Types::BIT8_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 PDU__GMM__AuthenticationAndCipheringRequest_template::single_value_struct {
BITSTRING_template field_messageType;
CipheringAlgorithmV_template field_cipheringAlgorithm;
IMEISVRequestV_template field_imeisvRequest;
ForceToStandbyV_template field_forceToStandby;
ACReferenceNumberV_template field_acReferenceNumber;
MobileL3__MM__Types::AuthenticationParameterRANDTV_template field_authenticationParameterRAND;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template field_cipheringKeySequenceNumber;
MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template field_authenticationParameterAUTN;
};

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType = ANY_VALUE;
single_value->field_cipheringAlgorithm = ANY_VALUE;
single_value->field_imeisvRequest = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_acReferenceNumber = ANY_VALUE;
single_value->field_authenticationParameterRAND = ANY_OR_OMIT;
single_value->field_cipheringKeySequenceNumber = ANY_OR_OMIT;
single_value->field_authenticationParameterAUTN = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::copy_value(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.cipheringAlgorithm().is_bound()) {
  single_value->field_cipheringAlgorithm = other_value.cipheringAlgorithm();
} else {
  single_value->field_cipheringAlgorithm.clean_up();
}
if (other_value.imeisvRequest().is_bound()) {
  single_value->field_imeisvRequest = other_value.imeisvRequest();
} else {
  single_value->field_imeisvRequest.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.acReferenceNumber().is_bound()) {
  single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
  single_value->field_acReferenceNumber.clean_up();
}
if (other_value.authenticationParameterRAND().is_bound()) {
  if (other_value.authenticationParameterRAND().ispresent()) single_value->field_authenticationParameterRAND = other_value.authenticationParameterRAND()();
  else single_value->field_authenticationParameterRAND = OMIT_VALUE;
} else {
  single_value->field_authenticationParameterRAND.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  if (other_value.cipheringKeySequenceNumber().ispresent()) single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber()();
  else single_value->field_cipheringKeySequenceNumber = OMIT_VALUE;
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.authenticationParameterAUTN().is_bound()) {
  if (other_value.authenticationParameterAUTN().ispresent()) single_value->field_authenticationParameterAUTN = other_value.authenticationParameterAUTN()();
  else single_value->field_authenticationParameterAUTN = OMIT_VALUE;
} else {
  single_value->field_authenticationParameterAUTN.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::copy_template(const PDU__GMM__AuthenticationAndCipheringRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringAlgorithm().get_selection()) {
single_value->field_cipheringAlgorithm = other_value.cipheringAlgorithm();
} else {
single_value->field_cipheringAlgorithm.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imeisvRequest().get_selection()) {
single_value->field_imeisvRequest = other_value.imeisvRequest();
} else {
single_value->field_imeisvRequest.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
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.authenticationParameterRAND().get_selection()) {
single_value->field_authenticationParameterRAND = other_value.authenticationParameterRAND();
} else {
single_value->field_authenticationParameterRAND.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParameterAUTN().get_selection()) {
single_value->field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
} else {
single_value->field_authenticationParameterAUTN.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 PDU__GMM__AuthenticationAndCipheringRequest_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 PDU__GMM__AuthenticationAndCipheringRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringRequest_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.PDU_GMM_AuthenticationAndCipheringRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringRequest_template::PDU__GMM__AuthenticationAndCipheringRequest_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringRequest_template::PDU__GMM__AuthenticationAndCipheringRequest_template(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::match(const PDU__GMM__AuthenticationAndCipheringRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.cipheringAlgorithm().is_bound()) return FALSE;
if(!single_value->field_cipheringAlgorithm.match(other_value.cipheringAlgorithm(), legacy))return FALSE;
if(!other_value.imeisvRequest().is_bound()) return FALSE;
if(!single_value->field_imeisvRequest.match(other_value.imeisvRequest(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.acReferenceNumber().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumber.match(other_value.acReferenceNumber(), legacy))return FALSE;
if(!other_value.authenticationParameterRAND().is_bound()) return FALSE;
if((other_value.authenticationParameterRAND().ispresent() ? !single_value->field_authenticationParameterRAND.match((const MobileL3__MM__Types::AuthenticationParameterRANDTV&)other_value.authenticationParameterRAND(), legacy) : !single_value->field_authenticationParameterRAND.match_omit(legacy)))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if((other_value.cipheringKeySequenceNumber().ispresent() ? !single_value->field_cipheringKeySequenceNumber.match((const MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV&)other_value.cipheringKeySequenceNumber(), legacy) : !single_value->field_cipheringKeySequenceNumber.match_omit(legacy)))return FALSE;
if(!other_value.authenticationParameterAUTN().is_bound()) return FALSE;
if((other_value.authenticationParameterAUTN().ispresent() ? !single_value->field_authenticationParameterAUTN.match((const MobileL3__MM__Types::AuthenticationParameterAUTNTLV&)other_value.authenticationParameterAUTN(), legacy) : !single_value->field_authenticationParameterAUTN.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.PDU_GMM_AuthenticationAndCipheringRequest.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_cipheringAlgorithm.is_bound()
 || single_value->field_imeisvRequest.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_acReferenceNumber.is_bound()
 || (single_value->field_authenticationParameterRAND.is_omit() || single_value->field_authenticationParameterRAND.is_bound())
 || (single_value->field_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_bound())
 || (single_value->field_authenticationParameterAUTN.is_omit() || single_value->field_authenticationParameterAUTN.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_cipheringAlgorithm.is_value()
 && single_value->field_imeisvRequest.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_acReferenceNumber.is_value()
 && (single_value->field_authenticationParameterRAND.is_omit() || single_value->field_authenticationParameterRAND.is_value())
 && (single_value->field_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_value())
 && (single_value->field_authenticationParameterAUTN.is_omit() || single_value->field_authenticationParameterAUTN.is_value());
}

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

PDU__GMM__AuthenticationAndCipheringRequest PDU__GMM__AuthenticationAndCipheringRequest_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.PDU_GMM_AuthenticationAndCipheringRequest.");
PDU__GMM__AuthenticationAndCipheringRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cipheringAlgorithm.is_bound()) {
ret_val.cipheringAlgorithm() = single_value->field_cipheringAlgorithm.valueof();
}
if (single_value->field_imeisvRequest.is_bound()) {
ret_val.imeisvRequest() = single_value->field_imeisvRequest.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_acReferenceNumber.is_bound()) {
ret_val.acReferenceNumber() = single_value->field_acReferenceNumber.valueof();
}
if (single_value->field_authenticationParameterRAND.is_omit()) ret_val.authenticationParameterRAND() = OMIT_VALUE;
else if (single_value->field_authenticationParameterRAND.is_bound()) {
ret_val.authenticationParameterRAND() = single_value->field_authenticationParameterRAND.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_omit()) ret_val.cipheringKeySequenceNumber() = OMIT_VALUE;
else if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_authenticationParameterAUTN.is_omit()) ret_val.authenticationParameterAUTN() = OMIT_VALUE;
else if (single_value->field_authenticationParameterAUTN.is_bound()) {
ret_val.authenticationParameterAUTN() = single_value->field_authenticationParameterAUTN.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringRequest_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.PDU_GMM_AuthenticationAndCipheringRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringRequest_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_messageType;
}

CipheringAlgorithmV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringAlgorithm()
{
set_specific();
return single_value->field_cipheringAlgorithm;
}

const CipheringAlgorithmV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringAlgorithm() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringAlgorithm of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_cipheringAlgorithm;
}

IMEISVRequestV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::imeisvRequest()
{
set_specific();
return single_value->field_imeisvRequest;
}

const IMEISVRequestV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::imeisvRequest() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imeisvRequest of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_imeisvRequest;
}

ForceToStandbyV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_forceToStandby;
}

ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::acReferenceNumber()
{
set_specific();
return single_value->field_acReferenceNumber;
}

const ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::acReferenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_acReferenceNumber;
}

MobileL3__MM__Types::AuthenticationParameterRANDTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterRAND()
{
set_specific();
return single_value->field_authenticationParameterRAND;
}

const MobileL3__MM__Types::AuthenticationParameterRANDTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterRAND() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParameterRAND of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_authenticationParameterRAND;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterAUTN()
{
set_specific();
return single_value->field_authenticationParameterAUTN;
}

const MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterAUTN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParameterAUTN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_authenticationParameterAUTN;
}

int PDU__GMM__AuthenticationAndCipheringRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_authenticationParameterRAND.is_present()) ret_val++;
      if (single_value->field_cipheringKeySequenceNumber.is_present()) ret_val++;
      if (single_value->field_authenticationParameterAUTN.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.PDU_GMM_AuthenticationAndCipheringRequest 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.PDU_GMM_AuthenticationAndCipheringRequest 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.PDU_GMM_AuthenticationAndCipheringRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
single_value->field_cipheringAlgorithm.log();
TTCN_Logger::log_event_str(", imeisvRequest := ");
single_value->field_imeisvRequest.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
single_value->field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
single_value->field_authenticationParameterAUTN.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 PDU__GMM__AuthenticationAndCipheringRequest_template::log_match(const PDU__GMM__AuthenticationAndCipheringRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringAlgorithm.match(match_value.cipheringAlgorithm(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringAlgorithm");
single_value->field_cipheringAlgorithm.log_match(match_value.cipheringAlgorithm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_imeisvRequest.match(match_value.imeisvRequest(), legacy)){
TTCN_Logger::log_logmatch_info(".imeisvRequest");
single_value->field_imeisvRequest.log_match(match_value.imeisvRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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 (match_value.authenticationParameterRAND().ispresent()){
if(!single_value->field_authenticationParameterRAND.match(match_value.authenticationParameterRAND(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParameterRAND");
single_value->field_authenticationParameterRAND.log_match(match_value.authenticationParameterRAND(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParameterRAND.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParameterRAND := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cipheringKeySequenceNumber().ispresent()){
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipheringKeySequenceNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.authenticationParameterAUTN().ispresent()){
if(!single_value->field_authenticationParameterAUTN.match(match_value.authenticationParameterAUTN(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParameterAUTN");
single_value->field_authenticationParameterAUTN.log_match(match_value.authenticationParameterAUTN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParameterAUTN.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParameterAUTN := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParameterAUTN.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
single_value->field_cipheringAlgorithm.log_match(match_value.cipheringAlgorithm(), legacy);
TTCN_Logger::log_event_str(", imeisvRequest := ");
single_value->field_imeisvRequest.log_match(match_value.imeisvRequest(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
if (match_value.authenticationParameterRAND().ispresent()) {
single_value->field_authenticationParameterRAND.log_match(match_value.authenticationParameterRAND(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParameterRAND.log();
if (single_value->field_authenticationParameterRAND.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
if (match_value.cipheringKeySequenceNumber().ispresent()) {
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipheringKeySequenceNumber.log();
if (single_value->field_cipheringKeySequenceNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
if (match_value.authenticationParameterAUTN().ispresent()) {
single_value->field_authenticationParameterAUTN.log_match(match_value.authenticationParameterAUTN(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParameterAUTN.log();
if (single_value->field_authenticationParameterAUTN.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 PDU__GMM__AuthenticationAndCipheringRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_cipheringAlgorithm.encode_text(text_buf);
single_value->field_imeisvRequest.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_acReferenceNumber.encode_text(text_buf);
single_value->field_authenticationParameterRAND.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_authenticationParameterAUTN.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.PDU_GMM_AuthenticationAndCipheringRequest.");
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType.decode_text(text_buf);
single_value->field_cipheringAlgorithm.decode_text(text_buf);
single_value->field_imeisvRequest.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_acReferenceNumber.decode_text(text_buf);
single_value->field_authenticationParameterRAND.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_authenticationParameterAUTN.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 PDU__GMM__AuthenticationAndCipheringRequest_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.PDU_GMM_AuthenticationAndCipheringRequest.");
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_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: {
    PDU__GMM__AuthenticationAndCipheringRequest_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.PDU_GMM_AuthenticationAndCipheringRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringAlgorithm().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imeisvRequest().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterRAND().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterAUTN().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisvRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisvRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "authenticationParameterRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterAUTN().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.PDU_GMM_AuthenticationAndCipheringRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringRequest_template* precondition = new PDU__GMM__AuthenticationAndCipheringRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringRequest_template* implied_template = new PDU__GMM__AuthenticationAndCipheringRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_cipheringAlgorithm.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_imeisvRequest.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_acReferenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_authenticationParameterRAND.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_authenticationParameterAUTN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
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.PDU_GMM_AuthenticationAndCipheringRequest");
}

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

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

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse()
{
}

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse(const BITSTRING& par_messageType,
    const ACReferenceNumberV& par_acReferenceNumber,
    const BITSTRING& par_spare,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationResponseParameterTV >& par_authenticationParResp,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_imeisv,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV >& par_authenticationRespParExt)
  :   field_messageType(par_messageType),
  field_acReferenceNumber(par_acReferenceNumber),
  field_spare(par_spare),
  field_authenticationParResp(par_authenticationParResp),
  field_imeisv(par_imeisv),
  field_authenticationRespParExt(par_authenticationRespParExt)
{
}

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
else field_acReferenceNumber.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.authenticationParResp().is_bound()) field_authenticationParResp = other_value.authenticationParResp();
else field_authenticationParResp.clean_up();
if (other_value.imeisv().is_bound()) field_imeisv = other_value.imeisv();
else field_imeisv.clean_up();
if (other_value.authenticationRespParExt().is_bound()) field_authenticationRespParExt = other_value.authenticationRespParExt();
else field_authenticationRespParExt.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringResponse::clean_up()
{
field_messageType.clean_up();
field_acReferenceNumber.clean_up();
field_spare.clean_up();
field_authenticationParResp.clean_up();
field_imeisv.clean_up();
field_authenticationRespParExt.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringResponse::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringResponse_descr_; }
PDU__GMM__AuthenticationAndCipheringResponse& PDU__GMM__AuthenticationAndCipheringResponse::operator=(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
  else field_acReferenceNumber.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.authenticationParResp().is_bound()) field_authenticationParResp = other_value.authenticationParResp();
  else field_authenticationParResp.clean_up();
  if (other_value.imeisv().is_bound()) field_imeisv = other_value.imeisv();
  else field_imeisv.clean_up();
  if (other_value.authenticationRespParExt().is_bound()) field_authenticationRespParExt = other_value.authenticationRespParExt();
  else field_authenticationRespParExt.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse::operator==(const PDU__GMM__AuthenticationAndCipheringResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_acReferenceNumber==other_value.field_acReferenceNumber
  && field_spare==other_value.field_spare
  && field_authenticationParResp==other_value.field_authenticationParResp
  && field_imeisv==other_value.field_imeisv
  && field_authenticationRespParExt==other_value.field_authenticationRespParExt;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_acReferenceNumber.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParResp.get_selection() || field_authenticationParResp.is_bound())
  || (OPTIONAL_OMIT == field_imeisv.get_selection() || field_imeisv.is_bound())
  || (OPTIONAL_OMIT == field_authenticationRespParExt.get_selection() || field_authenticationRespParExt.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringResponse::is_value() const
{
return field_messageType.is_value()
  && field_acReferenceNumber.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_authenticationParResp.get_selection() || field_authenticationParResp.is_value())
  && (OPTIONAL_OMIT == field_imeisv.get_selection() || field_imeisv.is_value())
  && (OPTIONAL_OMIT == field_authenticationRespParExt.get_selection() || field_authenticationRespParExt.is_value());
}
int PDU__GMM__AuthenticationAndCipheringResponse::size_of() const
{
  int ret_val = 3;
  if (field_authenticationParResp.ispresent()) ret_val++;
  if (field_imeisv.ispresent()) ret_val++;
  if (field_authenticationRespParExt.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", authenticationParResp := ");
field_authenticationParResp.log();
TTCN_Logger::log_event_str(", imeisv := ");
field_imeisv.log();
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
field_authenticationRespParExt.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!authenticationParResp().is_bound()) authenticationParResp() = OMIT_VALUE;
else authenticationParResp().set_implicit_omit();
if (!imeisv().is_bound()) imeisv() = OMIT_VALUE;
else imeisv().set_implicit_omit();
if (!authenticationRespParExt().is_bound()) authenticationRespParExt() = OMIT_VALUE;
else authenticationRespParExt().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringResponse::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.PDU_GMM_AuthenticationAndCipheringResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParResp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) imeisv().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationRespParExt().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "authenticationParResp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParResp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisv")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisv().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationRespParExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationRespParExt().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.PDU_GMM_AuthenticationAndCipheringResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
  }
}

void PDU__GMM__AuthenticationAndCipheringResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_acReferenceNumber.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_authenticationParResp.encode_text(text_buf);
field_imeisv.encode_text(text_buf);
field_authenticationRespParExt.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_acReferenceNumber.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_authenticationParResp.decode_text(text_buf);
field_imeisv.decode_text(text_buf);
field_authenticationRespParExt.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringResponse::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 PDU__GMM__AuthenticationAndCipheringResponse::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 PDU__GMM__AuthenticationAndCipheringResponse::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_messageType.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, ACReferenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumber.RAW_decode(ACReferenceNumberV_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_authenticationParResp = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParResp().RAW_decode(MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParResp = 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_authenticationParResp=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_imeisv = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_imeisv().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_imeisv = 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_imeisv=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_authenticationRespParExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationRespParExt().RAW_decode(MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationRespParExt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationRespParExt.ispresent() || field_authenticationRespParExt().elementIdentifier() !=  os_36){
  field_authenticationRespParExt=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_authenticationRespParExt=OMIT_VALUE;
  if (field_messageType !=  bs_35) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AuthenticationAndCipheringResponse::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ACReferenceNumberV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  if (field_authenticationParResp.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_imeisv.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_authenticationRespParExt.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_acReferenceNumber.RAW_encode(ACReferenceNumberV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_authenticationParResp.ispresent()) {
  encoded_length += field_authenticationParResp().RAW_encode(MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_imeisv.ispresent()) {
  encoded_length += field_imeisv().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_authenticationRespParExt.ispresent()) {
  encoded_length += field_authenticationRespParExt().RAW_encode(MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_authenticationRespParExt.ispresent() && (!field_authenticationRespParExt.ispresent() || field_authenticationRespParExt().elementIdentifier() !=  os_36)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_36.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);
  }
  }
  if (field_messageType !=  bs_35) {
  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_35.RAW_encode(General__Types::BIT8_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 PDU__GMM__AuthenticationAndCipheringResponse_template::single_value_struct {
BITSTRING_template field_messageType;
ACReferenceNumberV_template field_acReferenceNumber;
BITSTRING_template field_spare;
MobileL3__MM__Types::AuthenticationResponseParameterTV_template field_authenticationParResp;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_imeisv;
MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template field_authenticationRespParExt;
};

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType = ANY_VALUE;
single_value->field_acReferenceNumber = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_authenticationParResp = ANY_OR_OMIT;
single_value->field_imeisv = ANY_OR_OMIT;
single_value->field_authenticationRespParExt = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::copy_value(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.acReferenceNumber().is_bound()) {
  single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
  single_value->field_acReferenceNumber.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.authenticationParResp().is_bound()) {
  if (other_value.authenticationParResp().ispresent()) single_value->field_authenticationParResp = other_value.authenticationParResp()();
  else single_value->field_authenticationParResp = OMIT_VALUE;
} else {
  single_value->field_authenticationParResp.clean_up();
}
if (other_value.imeisv().is_bound()) {
  if (other_value.imeisv().ispresent()) single_value->field_imeisv = other_value.imeisv()();
  else single_value->field_imeisv = OMIT_VALUE;
} else {
  single_value->field_imeisv.clean_up();
}
if (other_value.authenticationRespParExt().is_bound()) {
  if (other_value.authenticationRespParExt().ispresent()) single_value->field_authenticationRespParExt = other_value.authenticationRespParExt()();
  else single_value->field_authenticationRespParExt = OMIT_VALUE;
} else {
  single_value->field_authenticationRespParExt.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::copy_template(const PDU__GMM__AuthenticationAndCipheringResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
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.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParResp().get_selection()) {
single_value->field_authenticationParResp = other_value.authenticationParResp();
} else {
single_value->field_authenticationParResp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imeisv().get_selection()) {
single_value->field_imeisv = other_value.imeisv();
} else {
single_value->field_imeisv.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationRespParExt().get_selection()) {
single_value->field_authenticationRespParExt = other_value.authenticationRespParExt();
} else {
single_value->field_authenticationRespParExt.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 PDU__GMM__AuthenticationAndCipheringResponse_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 PDU__GMM__AuthenticationAndCipheringResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringResponse_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.PDU_GMM_AuthenticationAndCipheringResponse.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringResponse_template::PDU__GMM__AuthenticationAndCipheringResponse_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringResponse_template::PDU__GMM__AuthenticationAndCipheringResponse_template(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::match(const PDU__GMM__AuthenticationAndCipheringResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.acReferenceNumber().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumber.match(other_value.acReferenceNumber(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.authenticationParResp().is_bound()) return FALSE;
if((other_value.authenticationParResp().ispresent() ? !single_value->field_authenticationParResp.match((const MobileL3__MM__Types::AuthenticationResponseParameterTV&)other_value.authenticationParResp(), legacy) : !single_value->field_authenticationParResp.match_omit(legacy)))return FALSE;
if(!other_value.imeisv().is_bound()) return FALSE;
if((other_value.imeisv().ispresent() ? !single_value->field_imeisv.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.imeisv(), legacy) : !single_value->field_imeisv.match_omit(legacy)))return FALSE;
if(!other_value.authenticationRespParExt().is_bound()) return FALSE;
if((other_value.authenticationRespParExt().ispresent() ? !single_value->field_authenticationRespParExt.match((const MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV&)other_value.authenticationRespParExt(), legacy) : !single_value->field_authenticationRespParExt.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.PDU_GMM_AuthenticationAndCipheringResponse.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_acReferenceNumber.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_authenticationParResp.is_omit() || single_value->field_authenticationParResp.is_bound())
 || (single_value->field_imeisv.is_omit() || single_value->field_imeisv.is_bound())
 || (single_value->field_authenticationRespParExt.is_omit() || single_value->field_authenticationRespParExt.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_acReferenceNumber.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_authenticationParResp.is_omit() || single_value->field_authenticationParResp.is_value())
 && (single_value->field_imeisv.is_omit() || single_value->field_imeisv.is_value())
 && (single_value->field_authenticationRespParExt.is_omit() || single_value->field_authenticationRespParExt.is_value());
}

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

PDU__GMM__AuthenticationAndCipheringResponse PDU__GMM__AuthenticationAndCipheringResponse_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.PDU_GMM_AuthenticationAndCipheringResponse.");
PDU__GMM__AuthenticationAndCipheringResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_acReferenceNumber.is_bound()) {
ret_val.acReferenceNumber() = single_value->field_acReferenceNumber.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_authenticationParResp.is_omit()) ret_val.authenticationParResp() = OMIT_VALUE;
else if (single_value->field_authenticationParResp.is_bound()) {
ret_val.authenticationParResp() = single_value->field_authenticationParResp.valueof();
}
if (single_value->field_imeisv.is_omit()) ret_val.imeisv() = OMIT_VALUE;
else if (single_value->field_imeisv.is_bound()) {
ret_val.imeisv() = single_value->field_imeisv.valueof();
}
if (single_value->field_authenticationRespParExt.is_omit()) ret_val.authenticationRespParExt() = OMIT_VALUE;
else if (single_value->field_authenticationRespParExt.is_bound()) {
ret_val.authenticationRespParExt() = single_value->field_authenticationRespParExt.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringResponse_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.PDU_GMM_AuthenticationAndCipheringResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringResponse_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_messageType;
}

ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::acReferenceNumber()
{
set_specific();
return single_value->field_acReferenceNumber;
}

const ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::acReferenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_acReferenceNumber;
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_spare;
}

MobileL3__MM__Types::AuthenticationResponseParameterTV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationParResp()
{
set_specific();
return single_value->field_authenticationParResp;
}

const MobileL3__MM__Types::AuthenticationResponseParameterTV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationParResp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParResp of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_authenticationParResp;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::imeisv()
{
set_specific();
return single_value->field_imeisv;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::imeisv() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imeisv of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_imeisv;
}

MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationRespParExt()
{
set_specific();
return single_value->field_authenticationRespParExt;
}

const MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationRespParExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationRespParExt of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_authenticationRespParExt;
}

int PDU__GMM__AuthenticationAndCipheringResponse_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_authenticationParResp.is_present()) ret_val++;
      if (single_value->field_imeisv.is_present()) ret_val++;
      if (single_value->field_authenticationRespParExt.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.PDU_GMM_AuthenticationAndCipheringResponse 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.PDU_GMM_AuthenticationAndCipheringResponse 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.PDU_GMM_AuthenticationAndCipheringResponse containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", authenticationParResp := ");
single_value->field_authenticationParResp.log();
TTCN_Logger::log_event_str(", imeisv := ");
single_value->field_imeisv.log();
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
single_value->field_authenticationRespParExt.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 PDU__GMM__AuthenticationAndCipheringResponse_template::log_match(const PDU__GMM__AuthenticationAndCipheringResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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_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 (match_value.authenticationParResp().ispresent()){
if(!single_value->field_authenticationParResp.match(match_value.authenticationParResp(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParResp");
single_value->field_authenticationParResp.log_match(match_value.authenticationParResp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParResp.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParResp := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParResp.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.imeisv().ispresent()){
if(!single_value->field_imeisv.match(match_value.imeisv(), legacy)){
TTCN_Logger::log_logmatch_info(".imeisv");
single_value->field_imeisv.log_match(match_value.imeisv(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_imeisv.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".imeisv := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_imeisv.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.authenticationRespParExt().ispresent()){
if(!single_value->field_authenticationRespParExt.match(match_value.authenticationRespParExt(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationRespParExt");
single_value->field_authenticationRespParExt.log_match(match_value.authenticationRespParExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationRespParExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationRespParExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationRespParExt.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", authenticationParResp := ");
if (match_value.authenticationParResp().ispresent()) {
single_value->field_authenticationParResp.log_match(match_value.authenticationParResp(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParResp.log();
if (single_value->field_authenticationParResp.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", imeisv := ");
if (match_value.imeisv().ispresent()) {
single_value->field_imeisv.log_match(match_value.imeisv(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_imeisv.log();
if (single_value->field_imeisv.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
if (match_value.authenticationRespParExt().ispresent()) {
single_value->field_authenticationRespParExt.log_match(match_value.authenticationRespParExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationRespParExt.log();
if (single_value->field_authenticationRespParExt.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 PDU__GMM__AuthenticationAndCipheringResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_acReferenceNumber.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_authenticationParResp.encode_text(text_buf);
single_value->field_imeisv.encode_text(text_buf);
single_value->field_authenticationRespParExt.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.PDU_GMM_AuthenticationAndCipheringResponse.");
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType.decode_text(text_buf);
single_value->field_acReferenceNumber.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_authenticationParResp.decode_text(text_buf);
single_value->field_imeisv.decode_text(text_buf);
single_value->field_authenticationRespParExt.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 PDU__GMM__AuthenticationAndCipheringResponse_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.PDU_GMM_AuthenticationAndCipheringResponse.");
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_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: {
    PDU__GMM__AuthenticationAndCipheringResponse_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.PDU_GMM_AuthenticationAndCipheringResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParResp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) imeisv().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationRespParExt().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "authenticationParResp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParResp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisv")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisv().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationRespParExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationRespParExt().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.PDU_GMM_AuthenticationAndCipheringResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringResponse_template* precondition = new PDU__GMM__AuthenticationAndCipheringResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringResponse_template* implied_template = new PDU__GMM__AuthenticationAndCipheringResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_acReferenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_authenticationParResp.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_imeisv.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_authenticationRespParExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
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.PDU_GMM_AuthenticationAndCipheringResponse");
}

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

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

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure()
{
}

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationFailureParametersTLV >& par_authenticationFailureParam)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_authenticationFailureParam(par_authenticationFailureParam)
{
}

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.authenticationFailureParam().is_bound()) field_authenticationFailureParam = other_value.authenticationFailureParam();
else field_authenticationFailureParam.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringFailure::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_authenticationFailureParam.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringFailure::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringFailure_descr_; }
PDU__GMM__AuthenticationAndCipheringFailure& PDU__GMM__AuthenticationAndCipheringFailure::operator=(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.authenticationFailureParam().is_bound()) field_authenticationFailureParam = other_value.authenticationFailureParam();
  else field_authenticationFailureParam.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure::operator==(const PDU__GMM__AuthenticationAndCipheringFailure& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_authenticationFailureParam==other_value.field_authenticationFailureParam;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_authenticationFailureParam.get_selection() || field_authenticationFailureParam.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringFailure::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && (OPTIONAL_OMIT == field_authenticationFailureParam.get_selection() || field_authenticationFailureParam.is_value());
}
int PDU__GMM__AuthenticationAndCipheringFailure::size_of() const
{
  int ret_val = 2;
  if (field_authenticationFailureParam.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringFailure::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
field_authenticationFailureParam.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringFailure::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!authenticationFailureParam().is_bound()) authenticationFailureParam() = OMIT_VALUE;
else authenticationFailureParam().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringFailure::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.PDU_GMM_AuthenticationAndCipheringFailure 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) authenticationFailureParam().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationFailureParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationFailureParam().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.PDU_GMM_AuthenticationAndCipheringFailure: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
  }
}

void PDU__GMM__AuthenticationAndCipheringFailure::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_authenticationFailureParam.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringFailure::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_authenticationFailureParam.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringFailure::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 PDU__GMM__AuthenticationAndCipheringFailure::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 PDU__GMM__AuthenticationAndCipheringFailure::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_messageType.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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.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 (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_authenticationFailureParam = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationFailureParam().RAW_decode(MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationFailureParam = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationFailureParam.ispresent() || field_authenticationFailureParam().elementIdentifier() !=  os_15){
  field_authenticationFailureParam=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_authenticationFailureParam=OMIT_VALUE;
  if (field_messageType !=  bs_36) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AuthenticationAndCipheringFailure::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  if (field_authenticationFailureParam.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_authenticationFailureParam.ispresent()) {
  encoded_length += field_authenticationFailureParam().RAW_encode(MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_authenticationFailureParam.ispresent() && (!field_authenticationFailureParam.ispresent() || field_authenticationFailureParam().elementIdentifier() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_15.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);
  }
  }
  if (field_messageType !=  bs_36) {
  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_36.RAW_encode(General__Types::BIT8_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 PDU__GMM__AuthenticationAndCipheringFailure_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
MobileL3__MM__Types::AuthenticationFailureParametersTLV_template field_authenticationFailureParam;
};

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_authenticationFailureParam = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::copy_value(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.authenticationFailureParam().is_bound()) {
  if (other_value.authenticationFailureParam().ispresent()) single_value->field_authenticationFailureParam = other_value.authenticationFailureParam()();
  else single_value->field_authenticationFailureParam = OMIT_VALUE;
} else {
  single_value->field_authenticationFailureParam.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::copy_template(const PDU__GMM__AuthenticationAndCipheringFailure_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationFailureParam().get_selection()) {
single_value->field_authenticationFailureParam = other_value.authenticationFailureParam();
} else {
single_value->field_authenticationFailureParam.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 PDU__GMM__AuthenticationAndCipheringFailure_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 PDU__GMM__AuthenticationAndCipheringFailure_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringFailure_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.PDU_GMM_AuthenticationAndCipheringFailure.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringFailure_template::PDU__GMM__AuthenticationAndCipheringFailure_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringFailure_template::PDU__GMM__AuthenticationAndCipheringFailure_template(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::match(const PDU__GMM__AuthenticationAndCipheringFailure& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.authenticationFailureParam().is_bound()) return FALSE;
if((other_value.authenticationFailureParam().ispresent() ? !single_value->field_authenticationFailureParam.match((const MobileL3__MM__Types::AuthenticationFailureParametersTLV&)other_value.authenticationFailureParam(), legacy) : !single_value->field_authenticationFailureParam.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.PDU_GMM_AuthenticationAndCipheringFailure.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || (single_value->field_authenticationFailureParam.is_omit() || single_value->field_authenticationFailureParam.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && (single_value->field_authenticationFailureParam.is_omit() || single_value->field_authenticationFailureParam.is_value());
}

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

PDU__GMM__AuthenticationAndCipheringFailure PDU__GMM__AuthenticationAndCipheringFailure_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.PDU_GMM_AuthenticationAndCipheringFailure.");
PDU__GMM__AuthenticationAndCipheringFailure ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_authenticationFailureParam.is_omit()) ret_val.authenticationFailureParam() = OMIT_VALUE;
else if (single_value->field_authenticationFailureParam.is_bound()) {
ret_val.authenticationFailureParam() = single_value->field_authenticationFailureParam.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringFailure_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.PDU_GMM_AuthenticationAndCipheringFailure.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringFailure_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringFailure_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringFailure_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_gmmCause;
}

MobileL3__MM__Types::AuthenticationFailureParametersTLV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::authenticationFailureParam()
{
set_specific();
return single_value->field_authenticationFailureParam;
}

const MobileL3__MM__Types::AuthenticationFailureParametersTLV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::authenticationFailureParam() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationFailureParam of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_authenticationFailureParam;
}

int PDU__GMM__AuthenticationAndCipheringFailure_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_authenticationFailureParam.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.PDU_GMM_AuthenticationAndCipheringFailure 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.PDU_GMM_AuthenticationAndCipheringFailure 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.PDU_GMM_AuthenticationAndCipheringFailure containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
single_value->field_authenticationFailureParam.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 PDU__GMM__AuthenticationAndCipheringFailure_template::log_match(const PDU__GMM__AuthenticationAndCipheringFailure& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationFailureParam().ispresent()){
if(!single_value->field_authenticationFailureParam.match(match_value.authenticationFailureParam(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationFailureParam");
single_value->field_authenticationFailureParam.log_match(match_value.authenticationFailureParam(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationFailureParam.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationFailureParam := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationFailureParam.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
if (match_value.authenticationFailureParam().ispresent()) {
single_value->field_authenticationFailureParam.log_match(match_value.authenticationFailureParam(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationFailureParam.log();
if (single_value->field_authenticationFailureParam.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 PDU__GMM__AuthenticationAndCipheringFailure_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_authenticationFailureParam.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.PDU_GMM_AuthenticationAndCipheringFailure.");
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_authenticationFailureParam.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 PDU__GMM__AuthenticationAndCipheringFailure_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.PDU_GMM_AuthenticationAndCipheringFailure.");
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_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: {
    PDU__GMM__AuthenticationAndCipheringFailure_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.PDU_GMM_AuthenticationAndCipheringFailure 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) authenticationFailureParam().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationFailureParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationFailureParam().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.PDU_GMM_AuthenticationAndCipheringFailure: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringFailure_template* precondition = new PDU__GMM__AuthenticationAndCipheringFailure_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringFailure_template* implied_template = new PDU__GMM__AuthenticationAndCipheringFailure_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringFailure_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
single_value->field_authenticationFailureParam.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
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.PDU_GMM_AuthenticationAndCipheringFailure");
}

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

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

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject()
{
}

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringReject::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringReject::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringReject_descr_; }
PDU__GMM__AuthenticationAndCipheringReject& PDU__GMM__AuthenticationAndCipheringReject::operator=(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringReject::operator==(const PDU__GMM__AuthenticationAndCipheringReject& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__AuthenticationAndCipheringReject::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringReject::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__AuthenticationAndCipheringReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringReject::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.PDU_GMM_AuthenticationAndCipheringReject 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) messageType().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().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.PDU_GMM_AuthenticationAndCipheringReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
  }
}

void PDU__GMM__AuthenticationAndCipheringReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringReject::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 PDU__GMM__AuthenticationAndCipheringReject::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 PDU__GMM__AuthenticationAndCipheringReject::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_messageType.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());
  if (field_messageType !=  bs_37) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__AuthenticationAndCipheringReject::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_37) {
  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_37.RAW_encode(General__Types::BIT8_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 PDU__GMM__AuthenticationAndCipheringReject_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__AuthenticationAndCipheringReject_template::copy_value(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringReject_template::copy_template(const PDU__GMM__AuthenticationAndCipheringReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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 PDU__GMM__AuthenticationAndCipheringReject_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 PDU__GMM__AuthenticationAndCipheringReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringReject_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.PDU_GMM_AuthenticationAndCipheringReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringReject_template::PDU__GMM__AuthenticationAndCipheringReject_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringReject_template::PDU__GMM__AuthenticationAndCipheringReject_template(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__AuthenticationAndCipheringReject_template::match(const PDU__GMM__AuthenticationAndCipheringReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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.PDU_GMM_AuthenticationAndCipheringReject.");
}
return FALSE;
}

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

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

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

PDU__GMM__AuthenticationAndCipheringReject PDU__GMM__AuthenticationAndCipheringReject_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.PDU_GMM_AuthenticationAndCipheringReject.");
PDU__GMM__AuthenticationAndCipheringReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringReject_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.PDU_GMM_AuthenticationAndCipheringReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringReject_template[list_length];
}

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

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
return single_value->field_messageType;
}

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

void PDU__GMM__AuthenticationAndCipheringReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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 PDU__GMM__AuthenticationAndCipheringReject_template::log_match(const PDU__GMM__AuthenticationAndCipheringReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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 PDU__GMM__AuthenticationAndCipheringReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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.PDU_GMM_AuthenticationAndCipheringReject.");
}
}

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType.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 PDU__GMM__AuthenticationAndCipheringReject_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.PDU_GMM_AuthenticationAndCipheringReject.");
}
}

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

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
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.PDU_GMM_AuthenticationAndCipheringReject");
}

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

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

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest()
{
}

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest(const BITSTRING& par_messageType,
    const IdentityType2V& par_identityType,
    const ForceToStandbyV& par_forceToStandby)
  :   field_messageType(par_messageType),
  field_identityType(par_identityType),
  field_forceToStandby(par_forceToStandby)
{
}

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest(const PDU__GMM__IdentityRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
else field_identityType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
}

void PDU__GMM__IdentityRequest::clean_up()
{
field_messageType.clean_up();
field_identityType.clean_up();
field_forceToStandby.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__IdentityRequest::get_descriptor() const { return &PDU__GMM__IdentityRequest_descr_; }
PDU__GMM__IdentityRequest& PDU__GMM__IdentityRequest::operator=(const PDU__GMM__IdentityRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
  else field_identityType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
}
return *this;
}

boolean PDU__GMM__IdentityRequest::operator==(const PDU__GMM__IdentityRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_identityType==other_value.field_identityType
  && field_forceToStandby==other_value.field_forceToStandby;
}

boolean PDU__GMM__IdentityRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_identityType.is_bound())
  || (field_forceToStandby.is_bound());
}
boolean PDU__GMM__IdentityRequest::is_value() const
{
return field_messageType.is_value()
  && field_identityType.is_value()
  && field_forceToStandby.is_value();
}
void PDU__GMM__IdentityRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", identityType := ");
field_identityType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__IdentityRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (identityType().is_bound()) identityType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
}

void PDU__GMM__IdentityRequest::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.PDU_GMM_IdentityRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) identityType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          identityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().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.PDU_GMM_IdentityRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
  }
}

void PDU__GMM__IdentityRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_identityType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
}

void PDU__GMM__IdentityRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_identityType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
}

void PDU__GMM__IdentityRequest::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 PDU__GMM__IdentityRequest::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 PDU__GMM__IdentityRequest::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_messageType.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, IdentityType2V_descr_.raw->forceomit);
  decoded_field_length = field_identityType.RAW_decode(IdentityType2V_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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 (field_messageType !=  bs_38) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__IdentityRequest::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IdentityType2V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_identityType.RAW_encode(IdentityType2V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  if (field_messageType !=  bs_38) {
  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_38.RAW_encode(General__Types::BIT8_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 PDU__GMM__IdentityRequest_template::single_value_struct {
BITSTRING_template field_messageType;
IdentityType2V_template field_identityType;
ForceToStandbyV_template field_forceToStandby;
};

void PDU__GMM__IdentityRequest_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_messageType = ANY_VALUE;
single_value->field_identityType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
}
}
}

void PDU__GMM__IdentityRequest_template::copy_value(const PDU__GMM__IdentityRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.identityType().is_bound()) {
  single_value->field_identityType = other_value.identityType();
} else {
  single_value->field_identityType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__IdentityRequest_template::copy_template(const PDU__GMM__IdentityRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.identityType().get_selection()) {
single_value->field_identityType = other_value.identityType();
} else {
single_value->field_identityType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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 PDU__GMM__IdentityRequest_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 PDU__GMM__IdentityRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__IdentityRequest_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.PDU_GMM_IdentityRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__IdentityRequest_template::PDU__GMM__IdentityRequest_template()
{
}

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

PDU__GMM__IdentityRequest_template::PDU__GMM__IdentityRequest_template(const PDU__GMM__IdentityRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__IdentityRequest_template::match(const PDU__GMM__IdentityRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.identityType().is_bound()) return FALSE;
if(!single_value->field_identityType.match(other_value.identityType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), 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.PDU_GMM_IdentityRequest.");
}
return FALSE;
}

boolean PDU__GMM__IdentityRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_identityType.is_bound()
 || single_value->field_forceToStandby.is_bound();
}

boolean PDU__GMM__IdentityRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_identityType.is_value()
 && single_value->field_forceToStandby.is_value();
}

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

PDU__GMM__IdentityRequest PDU__GMM__IdentityRequest_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.PDU_GMM_IdentityRequest.");
PDU__GMM__IdentityRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_identityType.is_bound()) {
ret_val.identityType() = single_value->field_identityType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
return ret_val;
}

void PDU__GMM__IdentityRequest_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.PDU_GMM_IdentityRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__IdentityRequest_template[list_length];
}

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

BITSTRING_template& PDU__GMM__IdentityRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__IdentityRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_messageType;
}

IdentityType2V_template& PDU__GMM__IdentityRequest_template::identityType()
{
set_specific();
return single_value->field_identityType;
}

const IdentityType2V_template& PDU__GMM__IdentityRequest_template::identityType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field identityType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_identityType;
}

ForceToStandbyV_template& PDU__GMM__IdentityRequest_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__IdentityRequest_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_forceToStandby;
}

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

void PDU__GMM__IdentityRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.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 PDU__GMM__IdentityRequest_template::log_match(const PDU__GMM__IdentityRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_identityType.match(match_value.identityType(), legacy)){
TTCN_Logger::log_logmatch_info(".identityType");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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 PDU__GMM__IdentityRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_identityType.encode_text(text_buf);
single_value->field_forceToStandby.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.PDU_GMM_IdentityRequest.");
}
}

void PDU__GMM__IdentityRequest_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_messageType.decode_text(text_buf);
single_value->field_identityType.decode_text(text_buf);
single_value->field_forceToStandby.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 PDU__GMM__IdentityRequest_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.PDU_GMM_IdentityRequest.");
}
}

void PDU__GMM__IdentityRequest_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: {
    PDU__GMM__IdentityRequest_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.PDU_GMM_IdentityRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) identityType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          identityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().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.PDU_GMM_IdentityRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__IdentityRequest_template* precondition = new PDU__GMM__IdentityRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__IdentityRequest_template* implied_template = new PDU__GMM__IdentityRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__IdentityRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__IdentityRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
single_value->field_identityType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
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.PDU_GMM_IdentityRequest");
}

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

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

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse()
{
}

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity)
  :   field_messageType(par_messageType),
  field_mobileIdentity(par_mobileIdentity)
{
}

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse(const PDU__GMM__IdentityResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
}

void PDU__GMM__IdentityResponse::clean_up()
{
field_messageType.clean_up();
field_mobileIdentity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__IdentityResponse::get_descriptor() const { return &PDU__GMM__IdentityResponse_descr_; }
PDU__GMM__IdentityResponse& PDU__GMM__IdentityResponse::operator=(const PDU__GMM__IdentityResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
}
return *this;
}

boolean PDU__GMM__IdentityResponse::operator==(const PDU__GMM__IdentityResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_mobileIdentity==other_value.field_mobileIdentity;
}

boolean PDU__GMM__IdentityResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_mobileIdentity.is_bound());
}
boolean PDU__GMM__IdentityResponse::is_value() const
{
return field_messageType.is_value()
  && field_mobileIdentity.is_value();
}
void PDU__GMM__IdentityResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__IdentityResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
}

void PDU__GMM__IdentityResponse::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.PDU_GMM_IdentityResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().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.PDU_GMM_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
  }
}

void PDU__GMM__IdentityResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
}

void PDU__GMM__IdentityResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
}

void PDU__GMM__IdentityResponse::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 PDU__GMM__IdentityResponse::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 PDU__GMM__IdentityResponse::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_messageType.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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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_messageType !=  bs_39) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__IdentityResponse::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_messageType !=  bs_39) {
  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_39.RAW_encode(General__Types::BIT8_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 PDU__GMM__IdentityResponse_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
};

void PDU__GMM__IdentityResponse_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_messageType = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
}
}
}

void PDU__GMM__IdentityResponse_template::copy_value(const PDU__GMM__IdentityResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__IdentityResponse_template::copy_template(const PDU__GMM__IdentityResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.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 PDU__GMM__IdentityResponse_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 PDU__GMM__IdentityResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__IdentityResponse_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.PDU_GMM_IdentityResponse.");
break;
}
set_selection(other_value);
}

PDU__GMM__IdentityResponse_template::PDU__GMM__IdentityResponse_template()
{
}

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

PDU__GMM__IdentityResponse_template::PDU__GMM__IdentityResponse_template(const PDU__GMM__IdentityResponse& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__IdentityResponse_template::match(const PDU__GMM__IdentityResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), 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.PDU_GMM_IdentityResponse.");
}
return FALSE;
}

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

boolean PDU__GMM__IdentityResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_mobileIdentity.is_value();
}

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

PDU__GMM__IdentityResponse PDU__GMM__IdentityResponse_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.PDU_GMM_IdentityResponse.");
PDU__GMM__IdentityResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
return ret_val;
}

void PDU__GMM__IdentityResponse_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.PDU_GMM_IdentityResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__IdentityResponse_template[list_length];
}

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

BITSTRING_template& PDU__GMM__IdentityResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__IdentityResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__IdentityResponse_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__IdentityResponse_template::mobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
return single_value->field_mobileIdentity;
}

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

void PDU__GMM__IdentityResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.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 PDU__GMM__IdentityResponse_template::log_match(const PDU__GMM__IdentityResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), 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 PDU__GMM__IdentityResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_mobileIdentity.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.PDU_GMM_IdentityResponse.");
}
}

void PDU__GMM__IdentityResponse_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_messageType.decode_text(text_buf);
single_value->field_mobileIdentity.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 PDU__GMM__IdentityResponse_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.PDU_GMM_IdentityResponse.");
}
}

void PDU__GMM__IdentityResponse_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: {
    PDU__GMM__IdentityResponse_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.PDU_GMM_IdentityResponse 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().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.PDU_GMM_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__IdentityResponse_template* precondition = new PDU__GMM__IdentityResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__IdentityResponse_template* implied_template = new PDU__GMM__IdentityResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__IdentityResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__IdentityResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
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.PDU_GMM_IdentityResponse");
}

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

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

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest()
{
}

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest(const BITSTRING& par_messageType,
    const UpdateTypeV& par_updateType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_gprsCKSN,
    const RoutingAreaIdentificationV& par_oldRoutingAreaId,
    const MSRadioAccessCapabilityLV& par_msRACap,
    const OPTIONAL< P__TMSISignatureTV >& par_oldPTMSISignature,
    const OPTIONAL< GPRSTimerTV >& par_readyTimerValue,
    const OPTIONAL< DRXParameterTV >& par_drxParameter,
    const OPTIONAL< TMSIStatusTV >& par_tmsiStatus,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_ptmsi,
    const OPTIONAL< MSNetworkCapabilityTLV >& par_mSNetworkCapability,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< PC__LCSCapability >& par_pC__LCSCapability,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus,
    const OPTIONAL< UENetworkCapabilityTLV >& par_uENetworkCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_additionalMobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV >& par_oldRoutingAreaIdentification2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark2__TLV >& par_mobileStationClassmark2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark3__TLV >& par_mobileStationClassmark3,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< VoiceDomainPreferenceandUEsUsageSettingTLV >& par_voiceDomainUEUsageSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSI__TypeTV >& par_p__TMSI__Type,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV >& par_mS__NetworkFeatureSupport,
    const OPTIONAL< LocationAreaIdentification2__TLV >& par_oldLocationAreaIdentification,
    const OPTIONAL< AdditionalUpdateTypeTV >& par_additionalUpdateType,
    const OPTIONAL< NetworkResourceIdentifierContainerTLV >& par_tMSIBasedNRIcontainer,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_updateType(par_updateType),
  field_gprsCKSN(par_gprsCKSN),
  field_oldRoutingAreaId(par_oldRoutingAreaId),
  field_msRACap(par_msRACap),
  field_oldPTMSISignature(par_oldPTMSISignature),
  field_readyTimerValue(par_readyTimerValue),
  field_drxParameter(par_drxParameter),
  field_tmsiStatus(par_tmsiStatus),
  field_ptmsi(par_ptmsi),
  field_mSNetworkCapability(par_mSNetworkCapability),
  field_pdpContextStatus(par_pdpContextStatus),
  field_pC__LCSCapability(par_pC__LCSCapability),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus),
  field_uENetworkCapability(par_uENetworkCapability),
  field_additionalMobileIdentity(par_additionalMobileIdentity),
  field_oldRoutingAreaIdentification2(par_oldRoutingAreaIdentification2),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileStationClassmark3(par_mobileStationClassmark3),
  field_supportedCodecs(par_supportedCodecs),
  field_voiceDomainUEUsageSetting(par_voiceDomainUEUsageSetting),
  field_p__TMSI__Type(par_p__TMSI__Type),
  field_deviceProperties(par_deviceProperties),
  field_mS__NetworkFeatureSupport(par_mS__NetworkFeatureSupport),
  field_oldLocationAreaIdentification(par_oldLocationAreaIdentification),
  field_additionalUpdateType(par_additionalUpdateType),
  field_tMSIBasedNRIcontainer(par_tMSIBasedNRIcontainer),
  field_t3324(par_t3324),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.updateType().is_bound()) field_updateType = other_value.updateType();
else field_updateType.clean_up();
if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
else field_gprsCKSN.clean_up();
if (other_value.oldRoutingAreaId().is_bound()) field_oldRoutingAreaId = other_value.oldRoutingAreaId();
else field_oldRoutingAreaId.clean_up();
if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
else field_msRACap.clean_up();
if (other_value.oldPTMSISignature().is_bound()) field_oldPTMSISignature = other_value.oldPTMSISignature();
else field_oldPTMSISignature.clean_up();
if (other_value.readyTimerValue().is_bound()) field_readyTimerValue = other_value.readyTimerValue();
else field_readyTimerValue.clean_up();
if (other_value.drxParameter().is_bound()) field_drxParameter = other_value.drxParameter();
else field_drxParameter.clean_up();
if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
else field_tmsiStatus.clean_up();
if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
else field_ptmsi.clean_up();
if (other_value.mSNetworkCapability().is_bound()) field_mSNetworkCapability = other_value.mSNetworkCapability();
else field_mSNetworkCapability.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
else field_pC__LCSCapability.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
else field_uENetworkCapability.clean_up();
if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
else field_additionalMobileIdentity.clean_up();
if (other_value.oldRoutingAreaIdentification2().is_bound()) field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
else field_oldRoutingAreaIdentification2.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
else field_mobileStationClassmark3.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.voiceDomainUEUsageSetting().is_bound()) field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
else field_voiceDomainUEUsageSetting.clean_up();
if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
else field_p__TMSI__Type.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
else field_mS__NetworkFeatureSupport.clean_up();
if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
else field_oldLocationAreaIdentification.clean_up();
if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
else field_additionalUpdateType.clean_up();
if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
else field_tMSIBasedNRIcontainer.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__RoutingAreaUpdateRequest::clean_up()
{
field_messageType.clean_up();
field_updateType.clean_up();
field_gprsCKSN.clean_up();
field_oldRoutingAreaId.clean_up();
field_msRACap.clean_up();
field_oldPTMSISignature.clean_up();
field_readyTimerValue.clean_up();
field_drxParameter.clean_up();
field_tmsiStatus.clean_up();
field_ptmsi.clean_up();
field_mSNetworkCapability.clean_up();
field_pdpContextStatus.clean_up();
field_pC__LCSCapability.clean_up();
field_mBMS__ContextStatus.clean_up();
field_uENetworkCapability.clean_up();
field_additionalMobileIdentity.clean_up();
field_oldRoutingAreaIdentification2.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileStationClassmark3.clean_up();
field_supportedCodecs.clean_up();
field_voiceDomainUEUsageSetting.clean_up();
field_p__TMSI__Type.clean_up();
field_deviceProperties.clean_up();
field_mS__NetworkFeatureSupport.clean_up();
field_oldLocationAreaIdentification.clean_up();
field_additionalUpdateType.clean_up();
field_tMSIBasedNRIcontainer.clean_up();
field_t3324.clean_up();
field_t3312__ExtendedValue.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateRequest::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateRequest_descr_; }
PDU__GMM__RoutingAreaUpdateRequest& PDU__GMM__RoutingAreaUpdateRequest::operator=(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.updateType().is_bound()) field_updateType = other_value.updateType();
  else field_updateType.clean_up();
  if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
  else field_gprsCKSN.clean_up();
  if (other_value.oldRoutingAreaId().is_bound()) field_oldRoutingAreaId = other_value.oldRoutingAreaId();
  else field_oldRoutingAreaId.clean_up();
  if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
  else field_msRACap.clean_up();
  if (other_value.oldPTMSISignature().is_bound()) field_oldPTMSISignature = other_value.oldPTMSISignature();
  else field_oldPTMSISignature.clean_up();
  if (other_value.readyTimerValue().is_bound()) field_readyTimerValue = other_value.readyTimerValue();
  else field_readyTimerValue.clean_up();
  if (other_value.drxParameter().is_bound()) field_drxParameter = other_value.drxParameter();
  else field_drxParameter.clean_up();
  if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
  else field_tmsiStatus.clean_up();
  if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
  else field_ptmsi.clean_up();
  if (other_value.mSNetworkCapability().is_bound()) field_mSNetworkCapability = other_value.mSNetworkCapability();
  else field_mSNetworkCapability.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
  else field_pC__LCSCapability.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
  if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
  else field_uENetworkCapability.clean_up();
  if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
  else field_additionalMobileIdentity.clean_up();
  if (other_value.oldRoutingAreaIdentification2().is_bound()) field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
  else field_oldRoutingAreaIdentification2.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
  else field_mobileStationClassmark3.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.voiceDomainUEUsageSetting().is_bound()) field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
  else field_voiceDomainUEUsageSetting.clean_up();
  if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
  else field_p__TMSI__Type.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
  else field_mS__NetworkFeatureSupport.clean_up();
  if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
  else field_oldLocationAreaIdentification.clean_up();
  if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
  else field_additionalUpdateType.clean_up();
  if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
  else field_tMSIBasedNRIcontainer.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateRequest::operator==(const PDU__GMM__RoutingAreaUpdateRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_updateType==other_value.field_updateType
  && field_gprsCKSN==other_value.field_gprsCKSN
  && field_oldRoutingAreaId==other_value.field_oldRoutingAreaId
  && field_msRACap==other_value.field_msRACap
  && field_oldPTMSISignature==other_value.field_oldPTMSISignature
  && field_readyTimerValue==other_value.field_readyTimerValue
  && field_drxParameter==other_value.field_drxParameter
  && field_tmsiStatus==other_value.field_tmsiStatus
  && field_ptmsi==other_value.field_ptmsi
  && field_mSNetworkCapability==other_value.field_mSNetworkCapability
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_pC__LCSCapability==other_value.field_pC__LCSCapability
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus
  && field_uENetworkCapability==other_value.field_uENetworkCapability
  && field_additionalMobileIdentity==other_value.field_additionalMobileIdentity
  && field_oldRoutingAreaIdentification2==other_value.field_oldRoutingAreaIdentification2
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileStationClassmark3==other_value.field_mobileStationClassmark3
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_voiceDomainUEUsageSetting==other_value.field_voiceDomainUEUsageSetting
  && field_p__TMSI__Type==other_value.field_p__TMSI__Type
  && field_deviceProperties==other_value.field_deviceProperties
  && field_mS__NetworkFeatureSupport==other_value.field_mS__NetworkFeatureSupport
  && field_oldLocationAreaIdentification==other_value.field_oldLocationAreaIdentification
  && field_additionalUpdateType==other_value.field_additionalUpdateType
  && field_tMSIBasedNRIcontainer==other_value.field_tMSIBasedNRIcontainer
  && field_t3324==other_value.field_t3324
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__RoutingAreaUpdateRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_updateType.is_bound())
  || (field_gprsCKSN.is_bound())
  || (field_oldRoutingAreaId.is_bound())
  || (field_msRACap.is_bound())
  || (OPTIONAL_OMIT == field_oldPTMSISignature.get_selection() || field_oldPTMSISignature.is_bound())
  || (OPTIONAL_OMIT == field_readyTimerValue.get_selection() || field_readyTimerValue.is_bound())
  || (OPTIONAL_OMIT == field_drxParameter.get_selection() || field_drxParameter.is_bound())
  || (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_bound())
  || (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_bound())
  || (OPTIONAL_OMIT == field_mSNetworkCapability.get_selection() || field_mSNetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_oldRoutingAreaIdentification2.get_selection() || field_oldRoutingAreaIdentification2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_voiceDomainUEUsageSetting.get_selection() || field_voiceDomainUEUsageSetting.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_bound())
  || (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateRequest::is_value() const
{
return field_messageType.is_value()
  && field_updateType.is_value()
  && field_gprsCKSN.is_value()
  && field_oldRoutingAreaId.is_value()
  && field_msRACap.is_value()
  && (OPTIONAL_OMIT == field_oldPTMSISignature.get_selection() || field_oldPTMSISignature.is_value())
  && (OPTIONAL_OMIT == field_readyTimerValue.get_selection() || field_readyTimerValue.is_value())
  && (OPTIONAL_OMIT == field_drxParameter.get_selection() || field_drxParameter.is_value())
  && (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_value())
  && (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_value())
  && (OPTIONAL_OMIT == field_mSNetworkCapability.get_selection() || field_mSNetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value())
  && (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_value())
  && (OPTIONAL_OMIT == field_oldRoutingAreaIdentification2.get_selection() || field_oldRoutingAreaIdentification2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_voiceDomainUEUsageSetting.get_selection() || field_voiceDomainUEUsageSetting.is_value())
  && (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_value())
  && (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__RoutingAreaUpdateRequest::size_of() const
{
  int ret_val = 5;
  if (field_oldPTMSISignature.ispresent()) ret_val++;
  if (field_readyTimerValue.ispresent()) ret_val++;
  if (field_drxParameter.ispresent()) ret_val++;
  if (field_tmsiStatus.ispresent()) ret_val++;
  if (field_ptmsi.ispresent()) ret_val++;
  if (field_mSNetworkCapability.ispresent()) ret_val++;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_pC__LCSCapability.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  if (field_uENetworkCapability.ispresent()) ret_val++;
  if (field_additionalMobileIdentity.ispresent()) ret_val++;
  if (field_oldRoutingAreaIdentification2.ispresent()) ret_val++;
  if (field_mobileStationClassmark2.ispresent()) ret_val++;
  if (field_mobileStationClassmark3.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_voiceDomainUEUsageSetting.ispresent()) ret_val++;
  if (field_p__TMSI__Type.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_mS__NetworkFeatureSupport.ispresent()) ret_val++;
  if (field_oldLocationAreaIdentification.ispresent()) ret_val++;
  if (field_additionalUpdateType.ispresent()) ret_val++;
  if (field_tMSIBasedNRIcontainer.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", updateType := ");
field_updateType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
field_gprsCKSN.log();
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
field_oldRoutingAreaId.log();
TTCN_Logger::log_event_str(", msRACap := ");
field_msRACap.log();
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(", readyTimerValue := ");
field_readyTimerValue.log();
TTCN_Logger::log_event_str(", drxParameter := ");
field_drxParameter.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
field_tmsiStatus.log();
TTCN_Logger::log_event_str(", ptmsi := ");
field_ptmsi.log();
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (updateType().is_bound()) updateType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (oldRoutingAreaId().is_bound()) oldRoutingAreaId().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!oldPTMSISignature().is_bound()) oldPTMSISignature() = OMIT_VALUE;
else oldPTMSISignature().set_implicit_omit();
if (!readyTimerValue().is_bound()) readyTimerValue() = OMIT_VALUE;
else readyTimerValue().set_implicit_omit();
if (!drxParameter().is_bound()) drxParameter() = OMIT_VALUE;
else drxParameter().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!mSNetworkCapability().is_bound()) mSNetworkCapability() = OMIT_VALUE;
else mSNetworkCapability().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!oldRoutingAreaIdentification2().is_bound()) oldRoutingAreaIdentification2() = OMIT_VALUE;
else oldRoutingAreaIdentification2().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!voiceDomainUEUsageSetting().is_bound()) voiceDomainUEUsageSetting() = OMIT_VALUE;
else voiceDomainUEUsageSetting().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateRequest::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 (30<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest has 30 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) updateType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) oldPTMSISignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) readyTimerValue().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) drxParameter().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mSNetworkCapability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaIdentification2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) voiceDomainUEUsageSetting().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(29));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldPTMSISignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldPTMSISignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParameter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParameter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainUEUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainUEUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_RoutingAreaUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
  }
}

void PDU__GMM__RoutingAreaUpdateRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_updateType.encode_text(text_buf);
field_gprsCKSN.encode_text(text_buf);
field_oldRoutingAreaId.encode_text(text_buf);
field_msRACap.encode_text(text_buf);
field_oldPTMSISignature.encode_text(text_buf);
field_readyTimerValue.encode_text(text_buf);
field_drxParameter.encode_text(text_buf);
field_tmsiStatus.encode_text(text_buf);
field_ptmsi.encode_text(text_buf);
field_mSNetworkCapability.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_pC__LCSCapability.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
field_uENetworkCapability.encode_text(text_buf);
field_additionalMobileIdentity.encode_text(text_buf);
field_oldRoutingAreaIdentification2.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileStationClassmark3.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_voiceDomainUEUsageSetting.encode_text(text_buf);
field_p__TMSI__Type.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_mS__NetworkFeatureSupport.encode_text(text_buf);
field_oldLocationAreaIdentification.encode_text(text_buf);
field_additionalUpdateType.encode_text(text_buf);
field_tMSIBasedNRIcontainer.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_updateType.decode_text(text_buf);
field_gprsCKSN.decode_text(text_buf);
field_oldRoutingAreaId.decode_text(text_buf);
field_msRACap.decode_text(text_buf);
field_oldPTMSISignature.decode_text(text_buf);
field_readyTimerValue.decode_text(text_buf);
field_drxParameter.decode_text(text_buf);
field_tmsiStatus.decode_text(text_buf);
field_ptmsi.decode_text(text_buf);
field_mSNetworkCapability.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_pC__LCSCapability.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
field_uENetworkCapability.decode_text(text_buf);
field_additionalMobileIdentity.decode_text(text_buf);
field_oldRoutingAreaIdentification2.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileStationClassmark3.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_voiceDomainUEUsageSetting.decode_text(text_buf);
field_p__TMSI__Type.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_mS__NetworkFeatureSupport.decode_text(text_buf);
field_oldLocationAreaIdentification.decode_text(text_buf);
field_additionalUpdateType.decode_text(text_buf);
field_tMSIBasedNRIcontainer.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateRequest::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 PDU__GMM__RoutingAreaUpdateRequest::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 PDU__GMM__RoutingAreaUpdateRequest::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_messageType.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, UpdateTypeV_descr_.raw->forceomit);
  decoded_field_length = field_updateType.RAW_decode(UpdateTypeV_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, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_gprsCKSN.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaId.RAW_decode(RoutingAreaIdentificationV_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, MSRadioAccessCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msRACap.RAW_decode(MSRadioAccessCapabilityLV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_oldPTMSISignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_oldPTMSISignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_oldPTMSISignature = 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_oldPTMSISignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_readyTimerValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimerValue().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimerValue = 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_readyTimerValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_drxParameter = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, DRXParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_drxParameter().RAW_decode(DRXParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_drxParameter = 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_drxParameter=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_tmsiStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, TMSIStatusTV_descr_.raw->forceomit);
  decoded_field_length = field_tmsiStatus().RAW_decode(TMSIStatusTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_tmsiStatus = 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_tmsiStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_ptmsi = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsi().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsi = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26){
  field_ptmsi=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_ptmsi=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_mSNetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MSNetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mSNetworkCapability().RAW_decode(MSNetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_mSNetworkCapability = 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_mSNetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_pC__LCSCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, PC__LCSCapability_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapability().RAW_decode(PC__LCSCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_pC__LCSCapability = 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_pC__LCSCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_uENetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, UENetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapability().RAW_decode(UENetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_uENetworkCapability = 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_uENetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_additionalMobileIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalMobileIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_additionalMobileIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23){
  field_additionalMobileIdentity=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_additionalMobileIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_oldRoutingAreaIdentification2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaIdentification2().RAW_decode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_oldRoutingAreaIdentification2 = 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_oldRoutingAreaIdentification2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_mobileStationClassmark2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2 = 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_mobileStationClassmark2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_mobileStationClassmark3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark3().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark3 = 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_mobileStationClassmark3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_supportedCodecs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = 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_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_voiceDomainUEUsageSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw->forceomit);
  decoded_field_length = field_voiceDomainUEUsageSetting().RAW_decode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_voiceDomainUEUsageSetting = 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_voiceDomainUEUsageSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_p__TMSI__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI__Type().RAW_decode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI__Type = 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_p__TMSI__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_mS__NetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_mS__NetworkFeatureSupport().RAW_decode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_mS__NetworkFeatureSupport = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21){
  field_mS__NetworkFeatureSupport=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_mS__NetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_oldLocationAreaIdentification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, LocationAreaIdentification2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldLocationAreaIdentification().RAW_decode(LocationAreaIdentification2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_oldLocationAreaIdentification = 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_oldLocationAreaIdentification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_additionalUpdateType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, AdditionalUpdateTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateType().RAW_decode(AdditionalUpdateTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateType = 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_additionalUpdateType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_tMSIBasedNRIcontainer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, NetworkResourceIdentifierContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_tMSIBasedNRIcontainer().RAW_decode(NetworkResourceIdentifierContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_tMSIBasedNRIcontainer = 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_tMSIBasedNRIcontainer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(28)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_28_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(29)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_29_force_omit(29, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_29_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_40) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__RoutingAreaUpdateRequest::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 = 30;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(30);
  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, UpdateTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MSRadioAccessCapabilityLV_descr_.raw);
  if (field_oldPTMSISignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_readyTimerValue.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_drxParameter.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, DRXParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_tmsiStatus.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, TMSIStatusTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_ptmsi.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_mSNetworkCapability.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MSNetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_pC__LCSCapability.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, PC__LCSCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_uENetworkCapability.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, UENetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_additionalMobileIdentity.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_oldRoutingAreaIdentification2.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_mobileStationClassmark2.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_mobileStationClassmark3.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_voiceDomainUEUsageSetting.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_p__TMSI__Type.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_oldLocationAreaIdentification.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, LocationAreaIdentification2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_additionalUpdateType.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, AdditionalUpdateTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, NetworkResourceIdentifierContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[29] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 29, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[29] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_updateType.RAW_encode(UpdateTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gprsCKSN.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_oldRoutingAreaId.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_msRACap.RAW_encode(MSRadioAccessCapabilityLV_descr_, *myleaf.body.node.nodes[4]);
  if (field_oldPTMSISignature.ispresent()) {
  encoded_length += field_oldPTMSISignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_readyTimerValue.ispresent()) {
  encoded_length += field_readyTimerValue().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_drxParameter.ispresent()) {
  encoded_length += field_drxParameter().RAW_encode(DRXParameterTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_tmsiStatus.ispresent()) {
  encoded_length += field_tmsiStatus().RAW_encode(TMSIStatusTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_ptmsi.ispresent()) {
  encoded_length += field_ptmsi().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_mSNetworkCapability.ispresent()) {
  encoded_length += field_mSNetworkCapability().RAW_encode(MSNetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_pC__LCSCapability.ispresent()) {
  encoded_length += field_pC__LCSCapability().RAW_encode(PC__LCSCapability_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_uENetworkCapability.ispresent()) {
  encoded_length += field_uENetworkCapability().RAW_encode(UENetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_additionalMobileIdentity.ispresent()) {
  encoded_length += field_additionalMobileIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_oldRoutingAreaIdentification2.ispresent()) {
  encoded_length += field_oldRoutingAreaIdentification2().RAW_encode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_mobileStationClassmark2.ispresent()) {
  encoded_length += field_mobileStationClassmark2().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_mobileStationClassmark3.ispresent()) {
  encoded_length += field_mobileStationClassmark3().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_voiceDomainUEUsageSetting.ispresent()) {
  encoded_length += field_voiceDomainUEUsageSetting().RAW_encode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_p__TMSI__Type.ispresent()) {
  encoded_length += field_p__TMSI__Type().RAW_encode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  encoded_length += field_mS__NetworkFeatureSupport().RAW_encode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_oldLocationAreaIdentification.ispresent()) {
  encoded_length += field_oldLocationAreaIdentification().RAW_encode(LocationAreaIdentification2__TLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_additionalUpdateType.ispresent()) {
  encoded_length += field_additionalUpdateType().RAW_encode(AdditionalUpdateTypeTV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  encoded_length += field_tMSIBasedNRIcontainer().RAW_encode(NetworkResourceIdentifierContainerTLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[29]);
  }
  if (field_ptmsi.ispresent() && (!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_additionalMobileIdentity.ispresent() && (!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={15,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_23.RAW_encode(General__Types::BIT7_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_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.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);
  }
  }
  if (field_mS__NetworkFeatureSupport.ispresent() && (!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={23,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={27,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={28,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_messageType !=  bs_40) {
  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_40.RAW_encode(General__Types::BIT8_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 PDU__GMM__RoutingAreaUpdateRequest_template::single_value_struct {
BITSTRING_template field_messageType;
UpdateTypeV_template field_updateType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_gprsCKSN;
RoutingAreaIdentificationV_template field_oldRoutingAreaId;
MSRadioAccessCapabilityLV_template field_msRACap;
P__TMSISignatureTV_template field_oldPTMSISignature;
GPRSTimerTV_template field_readyTimerValue;
DRXParameterTV_template field_drxParameter;
TMSIStatusTV_template field_tmsiStatus;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_ptmsi;
MSNetworkCapabilityTLV_template field_mSNetworkCapability;
PDPContextStatusTLV_template field_pdpContextStatus;
PC__LCSCapability_template field_pC__LCSCapability;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
UENetworkCapabilityTLV_template field_uENetworkCapability;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_additionalMobileIdentity;
MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template field_oldRoutingAreaIdentification2;
MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template field_mobileStationClassmark3;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
VoiceDomainPreferenceandUEsUsageSettingTLV_template field_voiceDomainUEUsageSetting;
MobileL3__CommonIE__Types::P__TMSI__TypeTV_template field_p__TMSI__Type;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template field_mS__NetworkFeatureSupport;
LocationAreaIdentification2__TLV_template field_oldLocationAreaIdentification;
AdditionalUpdateTypeTV_template field_additionalUpdateType;
NetworkResourceIdentifierContainerTLV_template field_tMSIBasedNRIcontainer;
GPRSTimer2TLV_template field_t3324;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType = ANY_VALUE;
single_value->field_updateType = ANY_VALUE;
single_value->field_gprsCKSN = ANY_VALUE;
single_value->field_oldRoutingAreaId = ANY_VALUE;
single_value->field_msRACap = ANY_VALUE;
single_value->field_oldPTMSISignature = ANY_OR_OMIT;
single_value->field_readyTimerValue = ANY_OR_OMIT;
single_value->field_drxParameter = ANY_OR_OMIT;
single_value->field_tmsiStatus = ANY_OR_OMIT;
single_value->field_ptmsi = ANY_OR_OMIT;
single_value->field_mSNetworkCapability = ANY_OR_OMIT;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_pC__LCSCapability = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
single_value->field_uENetworkCapability = ANY_OR_OMIT;
single_value->field_additionalMobileIdentity = ANY_OR_OMIT;
single_value->field_oldRoutingAreaIdentification2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark3 = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_voiceDomainUEUsageSetting = ANY_OR_OMIT;
single_value->field_p__TMSI__Type = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_mS__NetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_oldLocationAreaIdentification = ANY_OR_OMIT;
single_value->field_additionalUpdateType = ANY_OR_OMIT;
single_value->field_tMSIBasedNRIcontainer = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateRequest_template::copy_value(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.updateType().is_bound()) {
  single_value->field_updateType = other_value.updateType();
} else {
  single_value->field_updateType.clean_up();
}
if (other_value.gprsCKSN().is_bound()) {
  single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
  single_value->field_gprsCKSN.clean_up();
}
if (other_value.oldRoutingAreaId().is_bound()) {
  single_value->field_oldRoutingAreaId = other_value.oldRoutingAreaId();
} else {
  single_value->field_oldRoutingAreaId.clean_up();
}
if (other_value.msRACap().is_bound()) {
  single_value->field_msRACap = other_value.msRACap();
} else {
  single_value->field_msRACap.clean_up();
}
if (other_value.oldPTMSISignature().is_bound()) {
  if (other_value.oldPTMSISignature().ispresent()) single_value->field_oldPTMSISignature = other_value.oldPTMSISignature()();
  else single_value->field_oldPTMSISignature = OMIT_VALUE;
} else {
  single_value->field_oldPTMSISignature.clean_up();
}
if (other_value.readyTimerValue().is_bound()) {
  if (other_value.readyTimerValue().ispresent()) single_value->field_readyTimerValue = other_value.readyTimerValue()();
  else single_value->field_readyTimerValue = OMIT_VALUE;
} else {
  single_value->field_readyTimerValue.clean_up();
}
if (other_value.drxParameter().is_bound()) {
  if (other_value.drxParameter().ispresent()) single_value->field_drxParameter = other_value.drxParameter()();
  else single_value->field_drxParameter = OMIT_VALUE;
} else {
  single_value->field_drxParameter.clean_up();
}
if (other_value.tmsiStatus().is_bound()) {
  if (other_value.tmsiStatus().ispresent()) single_value->field_tmsiStatus = other_value.tmsiStatus()();
  else single_value->field_tmsiStatus = OMIT_VALUE;
} else {
  single_value->field_tmsiStatus.clean_up();
}
if (other_value.ptmsi().is_bound()) {
  if (other_value.ptmsi().ispresent()) single_value->field_ptmsi = other_value.ptmsi()();
  else single_value->field_ptmsi = OMIT_VALUE;
} else {
  single_value->field_ptmsi.clean_up();
}
if (other_value.mSNetworkCapability().is_bound()) {
  if (other_value.mSNetworkCapability().ispresent()) single_value->field_mSNetworkCapability = other_value.mSNetworkCapability()();
  else single_value->field_mSNetworkCapability = OMIT_VALUE;
} else {
  single_value->field_mSNetworkCapability.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.pC__LCSCapability().is_bound()) {
  if (other_value.pC__LCSCapability().ispresent()) single_value->field_pC__LCSCapability = other_value.pC__LCSCapability()();
  else single_value->field_pC__LCSCapability = OMIT_VALUE;
} else {
  single_value->field_pC__LCSCapability.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
if (other_value.uENetworkCapability().is_bound()) {
  if (other_value.uENetworkCapability().ispresent()) single_value->field_uENetworkCapability = other_value.uENetworkCapability()();
  else single_value->field_uENetworkCapability = OMIT_VALUE;
} else {
  single_value->field_uENetworkCapability.clean_up();
}
if (other_value.additionalMobileIdentity().is_bound()) {
  if (other_value.additionalMobileIdentity().ispresent()) single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity()();
  else single_value->field_additionalMobileIdentity = OMIT_VALUE;
} else {
  single_value->field_additionalMobileIdentity.clean_up();
}
if (other_value.oldRoutingAreaIdentification2().is_bound()) {
  if (other_value.oldRoutingAreaIdentification2().ispresent()) single_value->field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2()();
  else single_value->field_oldRoutingAreaIdentification2 = OMIT_VALUE;
} else {
  single_value->field_oldRoutingAreaIdentification2.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  if (other_value.mobileStationClassmark2().ispresent()) single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2()();
  else single_value->field_mobileStationClassmark2 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileStationClassmark3().is_bound()) {
  if (other_value.mobileStationClassmark3().ispresent()) single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3()();
  else single_value->field_mobileStationClassmark3 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark3.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.voiceDomainUEUsageSetting().is_bound()) {
  if (other_value.voiceDomainUEUsageSetting().ispresent()) single_value->field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting()();
  else single_value->field_voiceDomainUEUsageSetting = OMIT_VALUE;
} else {
  single_value->field_voiceDomainUEUsageSetting.clean_up();
}
if (other_value.p__TMSI__Type().is_bound()) {
  if (other_value.p__TMSI__Type().ispresent()) single_value->field_p__TMSI__Type = other_value.p__TMSI__Type()();
  else single_value->field_p__TMSI__Type = OMIT_VALUE;
} else {
  single_value->field_p__TMSI__Type.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.mS__NetworkFeatureSupport().is_bound()) {
  if (other_value.mS__NetworkFeatureSupport().ispresent()) single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport()();
  else single_value->field_mS__NetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (other_value.oldLocationAreaIdentification().is_bound()) {
  if (other_value.oldLocationAreaIdentification().ispresent()) single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification()();
  else single_value->field_oldLocationAreaIdentification = OMIT_VALUE;
} else {
  single_value->field_oldLocationAreaIdentification.clean_up();
}
if (other_value.additionalUpdateType().is_bound()) {
  if (other_value.additionalUpdateType().ispresent()) single_value->field_additionalUpdateType = other_value.additionalUpdateType()();
  else single_value->field_additionalUpdateType = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateType.clean_up();
}
if (other_value.tMSIBasedNRIcontainer().is_bound()) {
  if (other_value.tMSIBasedNRIcontainer().ispresent()) single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer()();
  else single_value->field_tMSIBasedNRIcontainer = OMIT_VALUE;
} else {
  single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateRequest_template::copy_template(const PDU__GMM__RoutingAreaUpdateRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateType().get_selection()) {
single_value->field_updateType = other_value.updateType();
} else {
single_value->field_updateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsCKSN().get_selection()) {
single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
single_value->field_gprsCKSN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaId().get_selection()) {
single_value->field_oldRoutingAreaId = other_value.oldRoutingAreaId();
} else {
single_value->field_oldRoutingAreaId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msRACap().get_selection()) {
single_value->field_msRACap = other_value.msRACap();
} else {
single_value->field_msRACap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldPTMSISignature().get_selection()) {
single_value->field_oldPTMSISignature = other_value.oldPTMSISignature();
} else {
single_value->field_oldPTMSISignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimerValue().get_selection()) {
single_value->field_readyTimerValue = other_value.readyTimerValue();
} else {
single_value->field_readyTimerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.drxParameter().get_selection()) {
single_value->field_drxParameter = other_value.drxParameter();
} else {
single_value->field_drxParameter.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tmsiStatus().get_selection()) {
single_value->field_tmsiStatus = other_value.tmsiStatus();
} else {
single_value->field_tmsiStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsi().get_selection()) {
single_value->field_ptmsi = other_value.ptmsi();
} else {
single_value->field_ptmsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mSNetworkCapability().get_selection()) {
single_value->field_mSNetworkCapability = other_value.mSNetworkCapability();
} else {
single_value->field_mSNetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapability().get_selection()) {
single_value->field_pC__LCSCapability = other_value.pC__LCSCapability();
} else {
single_value->field_pC__LCSCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapability().get_selection()) {
single_value->field_uENetworkCapability = other_value.uENetworkCapability();
} else {
single_value->field_uENetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalMobileIdentity().get_selection()) {
single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity();
} else {
single_value->field_additionalMobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaIdentification2().get_selection()) {
single_value->field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
} else {
single_value->field_oldRoutingAreaIdentification2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark3().get_selection()) {
single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
} else {
single_value->field_mobileStationClassmark3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.voiceDomainUEUsageSetting().get_selection()) {
single_value->field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
} else {
single_value->field_voiceDomainUEUsageSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSI__Type().get_selection()) {
single_value->field_p__TMSI__Type = other_value.p__TMSI__Type();
} else {
single_value->field_p__TMSI__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__NetworkFeatureSupport().get_selection()) {
single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
} else {
single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldLocationAreaIdentification().get_selection()) {
single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
} else {
single_value->field_oldLocationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateType().get_selection()) {
single_value->field_additionalUpdateType = other_value.additionalUpdateType();
} else {
single_value->field_additionalUpdateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSIBasedNRIcontainer().get_selection()) {
single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
} else {
single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateRequest_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 PDU__GMM__RoutingAreaUpdateRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateRequest_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.PDU_GMM_RoutingAreaUpdateRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateRequest_template::PDU__GMM__RoutingAreaUpdateRequest_template()
{
}

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

PDU__GMM__RoutingAreaUpdateRequest_template::PDU__GMM__RoutingAreaUpdateRequest_template(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__RoutingAreaUpdateRequest_template::match(const PDU__GMM__RoutingAreaUpdateRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.updateType().is_bound()) return FALSE;
if(!single_value->field_updateType.match(other_value.updateType(), legacy))return FALSE;
if(!other_value.gprsCKSN().is_bound()) return FALSE;
if(!single_value->field_gprsCKSN.match(other_value.gprsCKSN(), legacy))return FALSE;
if(!other_value.oldRoutingAreaId().is_bound()) return FALSE;
if(!single_value->field_oldRoutingAreaId.match(other_value.oldRoutingAreaId(), legacy))return FALSE;
if(!other_value.msRACap().is_bound()) return FALSE;
if(!single_value->field_msRACap.match(other_value.msRACap(), legacy))return FALSE;
if(!other_value.oldPTMSISignature().is_bound()) return FALSE;
if((other_value.oldPTMSISignature().ispresent() ? !single_value->field_oldPTMSISignature.match((const P__TMSISignatureTV&)other_value.oldPTMSISignature(), legacy) : !single_value->field_oldPTMSISignature.match_omit(legacy)))return FALSE;
if(!other_value.readyTimerValue().is_bound()) return FALSE;
if((other_value.readyTimerValue().ispresent() ? !single_value->field_readyTimerValue.match((const GPRSTimerTV&)other_value.readyTimerValue(), legacy) : !single_value->field_readyTimerValue.match_omit(legacy)))return FALSE;
if(!other_value.drxParameter().is_bound()) return FALSE;
if((other_value.drxParameter().ispresent() ? !single_value->field_drxParameter.match((const DRXParameterTV&)other_value.drxParameter(), legacy) : !single_value->field_drxParameter.match_omit(legacy)))return FALSE;
if(!other_value.tmsiStatus().is_bound()) return FALSE;
if((other_value.tmsiStatus().ispresent() ? !single_value->field_tmsiStatus.match((const TMSIStatusTV&)other_value.tmsiStatus(), legacy) : !single_value->field_tmsiStatus.match_omit(legacy)))return FALSE;
if(!other_value.ptmsi().is_bound()) return FALSE;
if((other_value.ptmsi().ispresent() ? !single_value->field_ptmsi.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.ptmsi(), legacy) : !single_value->field_ptmsi.match_omit(legacy)))return FALSE;
if(!other_value.mSNetworkCapability().is_bound()) return FALSE;
if((other_value.mSNetworkCapability().ispresent() ? !single_value->field_mSNetworkCapability.match((const MSNetworkCapabilityTLV&)other_value.mSNetworkCapability(), legacy) : !single_value->field_mSNetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.pC__LCSCapability().is_bound()) return FALSE;
if((other_value.pC__LCSCapability().ispresent() ? !single_value->field_pC__LCSCapability.match((const PC__LCSCapability&)other_value.pC__LCSCapability(), legacy) : !single_value->field_pC__LCSCapability.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.uENetworkCapability().is_bound()) return FALSE;
if((other_value.uENetworkCapability().ispresent() ? !single_value->field_uENetworkCapability.match((const UENetworkCapabilityTLV&)other_value.uENetworkCapability(), legacy) : !single_value->field_uENetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.additionalMobileIdentity().is_bound()) return FALSE;
if((other_value.additionalMobileIdentity().ispresent() ? !single_value->field_additionalMobileIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.additionalMobileIdentity(), legacy) : !single_value->field_additionalMobileIdentity.match_omit(legacy)))return FALSE;
if(!other_value.oldRoutingAreaIdentification2().is_bound()) return FALSE;
if((other_value.oldRoutingAreaIdentification2().ispresent() ? !single_value->field_oldRoutingAreaIdentification2.match((const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV&)other_value.oldRoutingAreaIdentification2(), legacy) : !single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2().ispresent() ? !single_value->field_mobileStationClassmark2.match((const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV&)other_value.mobileStationClassmark2(), legacy) : !single_value->field_mobileStationClassmark2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark3().is_bound()) return FALSE;
if((other_value.mobileStationClassmark3().ispresent() ? !single_value->field_mobileStationClassmark3.match((const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV&)other_value.mobileStationClassmark3(), legacy) : !single_value->field_mobileStationClassmark3.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.voiceDomainUEUsageSetting().is_bound()) return FALSE;
if((other_value.voiceDomainUEUsageSetting().ispresent() ? !single_value->field_voiceDomainUEUsageSetting.match((const VoiceDomainPreferenceandUEsUsageSettingTLV&)other_value.voiceDomainUEUsageSetting(), legacy) : !single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)))return FALSE;
if(!other_value.p__TMSI__Type().is_bound()) return FALSE;
if((other_value.p__TMSI__Type().ispresent() ? !single_value->field_p__TMSI__Type.match((const MobileL3__CommonIE__Types::P__TMSI__TypeTV&)other_value.p__TMSI__Type(), legacy) : !single_value->field_p__TMSI__Type.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.mS__NetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.mS__NetworkFeatureSupport().ispresent() ? !single_value->field_mS__NetworkFeatureSupport.match((const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV&)other_value.mS__NetworkFeatureSupport(), legacy) : !single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.oldLocationAreaIdentification().is_bound()) return FALSE;
if((other_value.oldLocationAreaIdentification().ispresent() ? !single_value->field_oldLocationAreaIdentification.match((const LocationAreaIdentification2__TLV&)other_value.oldLocationAreaIdentification(), legacy) : !single_value->field_oldLocationAreaIdentification.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateType().is_bound()) return FALSE;
if((other_value.additionalUpdateType().ispresent() ? !single_value->field_additionalUpdateType.match((const AdditionalUpdateTypeTV&)other_value.additionalUpdateType(), legacy) : !single_value->field_additionalUpdateType.match_omit(legacy)))return FALSE;
if(!other_value.tMSIBasedNRIcontainer().is_bound()) return FALSE;
if((other_value.tMSIBasedNRIcontainer().ispresent() ? !single_value->field_tMSIBasedNRIcontainer.match((const NetworkResourceIdentifierContainerTLV&)other_value.tMSIBasedNRIcontainer(), legacy) : !single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateRequest.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_updateType.is_bound()
 || single_value->field_gprsCKSN.is_bound()
 || single_value->field_oldRoutingAreaId.is_bound()
 || single_value->field_msRACap.is_bound()
 || (single_value->field_oldPTMSISignature.is_omit() || single_value->field_oldPTMSISignature.is_bound())
 || (single_value->field_readyTimerValue.is_omit() || single_value->field_readyTimerValue.is_bound())
 || (single_value->field_drxParameter.is_omit() || single_value->field_drxParameter.is_bound())
 || (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_bound())
 || (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_bound())
 || (single_value->field_mSNetworkCapability.is_omit() || single_value->field_mSNetworkCapability.is_bound())
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound())
 || (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_bound())
 || (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_bound())
 || (single_value->field_oldRoutingAreaIdentification2.is_omit() || single_value->field_oldRoutingAreaIdentification2.is_bound())
 || (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_bound())
 || (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_voiceDomainUEUsageSetting.is_omit() || single_value->field_voiceDomainUEUsageSetting.is_bound())
 || (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_bound())
 || (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_bound())
 || (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_bound())
 || (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_updateType.is_value()
 && single_value->field_gprsCKSN.is_value()
 && single_value->field_oldRoutingAreaId.is_value()
 && single_value->field_msRACap.is_value()
 && (single_value->field_oldPTMSISignature.is_omit() || single_value->field_oldPTMSISignature.is_value())
 && (single_value->field_readyTimerValue.is_omit() || single_value->field_readyTimerValue.is_value())
 && (single_value->field_drxParameter.is_omit() || single_value->field_drxParameter.is_value())
 && (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_value())
 && (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_value())
 && (single_value->field_mSNetworkCapability.is_omit() || single_value->field_mSNetworkCapability.is_value())
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value())
 && (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_value())
 && (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_value())
 && (single_value->field_oldRoutingAreaIdentification2.is_omit() || single_value->field_oldRoutingAreaIdentification2.is_value())
 && (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_value())
 && (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_voiceDomainUEUsageSetting.is_omit() || single_value->field_voiceDomainUEUsageSetting.is_value())
 && (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_value())
 && (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_value())
 && (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_value())
 && (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

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

PDU__GMM__RoutingAreaUpdateRequest PDU__GMM__RoutingAreaUpdateRequest_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.PDU_GMM_RoutingAreaUpdateRequest.");
PDU__GMM__RoutingAreaUpdateRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_updateType.is_bound()) {
ret_val.updateType() = single_value->field_updateType.valueof();
}
if (single_value->field_gprsCKSN.is_bound()) {
ret_val.gprsCKSN() = single_value->field_gprsCKSN.valueof();
}
if (single_value->field_oldRoutingAreaId.is_bound()) {
ret_val.oldRoutingAreaId() = single_value->field_oldRoutingAreaId.valueof();
}
if (single_value->field_msRACap.is_bound()) {
ret_val.msRACap() = single_value->field_msRACap.valueof();
}
if (single_value->field_oldPTMSISignature.is_omit()) ret_val.oldPTMSISignature() = OMIT_VALUE;
else if (single_value->field_oldPTMSISignature.is_bound()) {
ret_val.oldPTMSISignature() = single_value->field_oldPTMSISignature.valueof();
}
if (single_value->field_readyTimerValue.is_omit()) ret_val.readyTimerValue() = OMIT_VALUE;
else if (single_value->field_readyTimerValue.is_bound()) {
ret_val.readyTimerValue() = single_value->field_readyTimerValue.valueof();
}
if (single_value->field_drxParameter.is_omit()) ret_val.drxParameter() = OMIT_VALUE;
else if (single_value->field_drxParameter.is_bound()) {
ret_val.drxParameter() = single_value->field_drxParameter.valueof();
}
if (single_value->field_tmsiStatus.is_omit()) ret_val.tmsiStatus() = OMIT_VALUE;
else if (single_value->field_tmsiStatus.is_bound()) {
ret_val.tmsiStatus() = single_value->field_tmsiStatus.valueof();
}
if (single_value->field_ptmsi.is_omit()) ret_val.ptmsi() = OMIT_VALUE;
else if (single_value->field_ptmsi.is_bound()) {
ret_val.ptmsi() = single_value->field_ptmsi.valueof();
}
if (single_value->field_mSNetworkCapability.is_omit()) ret_val.mSNetworkCapability() = OMIT_VALUE;
else if (single_value->field_mSNetworkCapability.is_bound()) {
ret_val.mSNetworkCapability() = single_value->field_mSNetworkCapability.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_pC__LCSCapability.is_omit()) ret_val.pC__LCSCapability() = OMIT_VALUE;
else if (single_value->field_pC__LCSCapability.is_bound()) {
ret_val.pC__LCSCapability() = single_value->field_pC__LCSCapability.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
if (single_value->field_uENetworkCapability.is_omit()) ret_val.uENetworkCapability() = OMIT_VALUE;
else if (single_value->field_uENetworkCapability.is_bound()) {
ret_val.uENetworkCapability() = single_value->field_uENetworkCapability.valueof();
}
if (single_value->field_additionalMobileIdentity.is_omit()) ret_val.additionalMobileIdentity() = OMIT_VALUE;
else if (single_value->field_additionalMobileIdentity.is_bound()) {
ret_val.additionalMobileIdentity() = single_value->field_additionalMobileIdentity.valueof();
}
if (single_value->field_oldRoutingAreaIdentification2.is_omit()) ret_val.oldRoutingAreaIdentification2() = OMIT_VALUE;
else if (single_value->field_oldRoutingAreaIdentification2.is_bound()) {
ret_val.oldRoutingAreaIdentification2() = single_value->field_oldRoutingAreaIdentification2.valueof();
}
if (single_value->field_mobileStationClassmark2.is_omit()) ret_val.mobileStationClassmark2() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileStationClassmark3.is_omit()) ret_val.mobileStationClassmark3() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark3.is_bound()) {
ret_val.mobileStationClassmark3() = single_value->field_mobileStationClassmark3.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_voiceDomainUEUsageSetting.is_omit()) ret_val.voiceDomainUEUsageSetting() = OMIT_VALUE;
else if (single_value->field_voiceDomainUEUsageSetting.is_bound()) {
ret_val.voiceDomainUEUsageSetting() = single_value->field_voiceDomainUEUsageSetting.valueof();
}
if (single_value->field_p__TMSI__Type.is_omit()) ret_val.p__TMSI__Type() = OMIT_VALUE;
else if (single_value->field_p__TMSI__Type.is_bound()) {
ret_val.p__TMSI__Type() = single_value->field_p__TMSI__Type.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_mS__NetworkFeatureSupport.is_omit()) ret_val.mS__NetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_mS__NetworkFeatureSupport.is_bound()) {
ret_val.mS__NetworkFeatureSupport() = single_value->field_mS__NetworkFeatureSupport.valueof();
}
if (single_value->field_oldLocationAreaIdentification.is_omit()) ret_val.oldLocationAreaIdentification() = OMIT_VALUE;
else if (single_value->field_oldLocationAreaIdentification.is_bound()) {
ret_val.oldLocationAreaIdentification() = single_value->field_oldLocationAreaIdentification.valueof();
}
if (single_value->field_additionalUpdateType.is_omit()) ret_val.additionalUpdateType() = OMIT_VALUE;
else if (single_value->field_additionalUpdateType.is_bound()) {
ret_val.additionalUpdateType() = single_value->field_additionalUpdateType.valueof();
}
if (single_value->field_tMSIBasedNRIcontainer.is_omit()) ret_val.tMSIBasedNRIcontainer() = OMIT_VALUE;
else if (single_value->field_tMSIBasedNRIcontainer.is_bound()) {
ret_val.tMSIBasedNRIcontainer() = single_value->field_tMSIBasedNRIcontainer.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateRequest_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.PDU_GMM_RoutingAreaUpdateRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateRequest_template[list_length];
}

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

BITSTRING_template& PDU__GMM__RoutingAreaUpdateRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_messageType;
}

UpdateTypeV_template& PDU__GMM__RoutingAreaUpdateRequest_template::updateType()
{
set_specific();
return single_value->field_updateType;
}

const UpdateTypeV_template& PDU__GMM__RoutingAreaUpdateRequest_template::updateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_updateType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__RoutingAreaUpdateRequest_template::gprsCKSN()
{
set_specific();
return single_value->field_gprsCKSN;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__RoutingAreaUpdateRequest_template::gprsCKSN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsCKSN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_gprsCKSN;
}

RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaId()
{
set_specific();
return single_value->field_oldRoutingAreaId;
}

const RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaId of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldRoutingAreaId;
}

MSRadioAccessCapabilityLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::msRACap()
{
set_specific();
return single_value->field_msRACap;
}

const MSRadioAccessCapabilityLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::msRACap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msRACap of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_msRACap;
}

P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldPTMSISignature()
{
set_specific();
return single_value->field_oldPTMSISignature;
}

const P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldPTMSISignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldPTMSISignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldPTMSISignature;
}

GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::readyTimerValue()
{
set_specific();
return single_value->field_readyTimerValue;
}

const GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::readyTimerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimerValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_readyTimerValue;
}

DRXParameterTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::drxParameter()
{
set_specific();
return single_value->field_drxParameter;
}

const DRXParameterTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::drxParameter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field drxParameter of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_drxParameter;
}

TMSIStatusTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tmsiStatus()
{
set_specific();
return single_value->field_tmsiStatus;
}

const TMSIStatusTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tmsiStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tmsiStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_tmsiStatus;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::ptmsi()
{
set_specific();
return single_value->field_ptmsi;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::ptmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsi of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_ptmsi;
}

MSNetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mSNetworkCapability()
{
set_specific();
return single_value->field_mSNetworkCapability;
}

const MSNetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mSNetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mSNetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mSNetworkCapability;
}

PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_pdpContextStatus;
}

PC__LCSCapability_template& PDU__GMM__RoutingAreaUpdateRequest_template::pC__LCSCapability()
{
set_specific();
return single_value->field_pC__LCSCapability;
}

const PC__LCSCapability_template& PDU__GMM__RoutingAreaUpdateRequest_template::pC__LCSCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_pC__LCSCapability;
}

MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mBMS__ContextStatus;
}

UENetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::uENetworkCapability()
{
set_specific();
return single_value->field_uENetworkCapability;
}

const UENetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::uENetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_uENetworkCapability;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalMobileIdentity()
{
set_specific();
return single_value->field_additionalMobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalMobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalMobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_additionalMobileIdentity;
}

MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaIdentification2()
{
set_specific();
return single_value->field_oldRoutingAreaIdentification2;
}

const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaIdentification2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaIdentification2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldRoutingAreaIdentification2;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark3()
{
set_specific();
return single_value->field_mobileStationClassmark3;
}

const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark3 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mobileStationClassmark3;
}

MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__RoutingAreaUpdateRequest_template::supportedCodecs()
{
set_specific();
return single_value->field_supportedCodecs;
}

const MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__RoutingAreaUpdateRequest_template::supportedCodecs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supportedCodecs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_supportedCodecs;
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::voiceDomainUEUsageSetting()
{
set_specific();
return single_value->field_voiceDomainUEUsageSetting;
}

const VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::voiceDomainUEUsageSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field voiceDomainUEUsageSetting of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_voiceDomainUEUsageSetting;
}

MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::p__TMSI__Type()
{
set_specific();
return single_value->field_p__TMSI__Type;
}

const MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::p__TMSI__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI_Type of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_p__TMSI__Type;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_deviceProperties;
}

MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mS__NetworkFeatureSupport()
{
set_specific();
return single_value->field_mS__NetworkFeatureSupport;
}

const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mS__NetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_NetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mS__NetworkFeatureSupport;
}

LocationAreaIdentification2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldLocationAreaIdentification()
{
set_specific();
return single_value->field_oldLocationAreaIdentification;
}

const LocationAreaIdentification2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldLocationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldLocationAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldLocationAreaIdentification;
}

AdditionalUpdateTypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalUpdateType()
{
set_specific();
return single_value->field_additionalUpdateType;
}

const AdditionalUpdateTypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalUpdateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_additionalUpdateType;
}

NetworkResourceIdentifierContainerTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tMSIBasedNRIcontainer()
{
set_specific();
return single_value->field_tMSIBasedNRIcontainer;
}

const NetworkResourceIdentifierContainerTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tMSIBasedNRIcontainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSIBasedNRIcontainer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_tMSIBasedNRIcontainer;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_t3324;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_t3312__ExtendedValue;
}

ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__RoutingAreaUpdateRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_oldPTMSISignature.is_present()) ret_val++;
      if (single_value->field_readyTimerValue.is_present()) ret_val++;
      if (single_value->field_drxParameter.is_present()) ret_val++;
      if (single_value->field_tmsiStatus.is_present()) ret_val++;
      if (single_value->field_ptmsi.is_present()) ret_val++;
      if (single_value->field_mSNetworkCapability.is_present()) ret_val++;
      if (single_value->field_pdpContextStatus.is_present()) ret_val++;
      if (single_value->field_pC__LCSCapability.is_present()) ret_val++;
      if (single_value->field_mBMS__ContextStatus.is_present()) ret_val++;
      if (single_value->field_uENetworkCapability.is_present()) ret_val++;
      if (single_value->field_additionalMobileIdentity.is_present()) ret_val++;
      if (single_value->field_oldRoutingAreaIdentification2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark3.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.is_present()) ret_val++;
      if (single_value->field_voiceDomainUEUsageSetting.is_present()) ret_val++;
      if (single_value->field_p__TMSI__Type.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_mS__NetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_oldLocationAreaIdentification.is_present()) ret_val++;
      if (single_value->field_additionalUpdateType.is_present()) ret_val++;
      if (single_value->field_tMSIBasedNRIcontainer.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateRequest 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.PDU_GMM_RoutingAreaUpdateRequest 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.PDU_GMM_RoutingAreaUpdateRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", updateType := ");
single_value->field_updateType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log();
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
single_value->field_oldRoutingAreaId.log();
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log();
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
single_value->field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(", readyTimerValue := ");
single_value->field_readyTimerValue.log();
TTCN_Logger::log_event_str(", drxParameter := ");
single_value->field_drxParameter.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
single_value->field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
single_value->field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
single_value->field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateRequest_template::log_match(const PDU__GMM__RoutingAreaUpdateRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateType.match(match_value.updateType(), legacy)){
TTCN_Logger::log_logmatch_info(".updateType");
single_value->field_updateType.log_match(match_value.updateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsCKSN.match(match_value.gprsCKSN(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsCKSN");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oldRoutingAreaId.match(match_value.oldRoutingAreaId(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaId");
single_value->field_oldRoutingAreaId.log_match(match_value.oldRoutingAreaId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msRACap.match(match_value.msRACap(), legacy)){
TTCN_Logger::log_logmatch_info(".msRACap");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.oldPTMSISignature().ispresent()){
if(!single_value->field_oldPTMSISignature.match(match_value.oldPTMSISignature(), legacy)){
TTCN_Logger::log_logmatch_info(".oldPTMSISignature");
single_value->field_oldPTMSISignature.log_match(match_value.oldPTMSISignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldPTMSISignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldPTMSISignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimerValue().ispresent()){
if(!single_value->field_readyTimerValue.match(match_value.readyTimerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimerValue");
single_value->field_readyTimerValue.log_match(match_value.readyTimerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimerValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimerValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimerValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.drxParameter().ispresent()){
if(!single_value->field_drxParameter.match(match_value.drxParameter(), legacy)){
TTCN_Logger::log_logmatch_info(".drxParameter");
single_value->field_drxParameter.log_match(match_value.drxParameter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_drxParameter.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".drxParameter := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_drxParameter.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tmsiStatus().ispresent()){
if(!single_value->field_tmsiStatus.match(match_value.tmsiStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".tmsiStatus");
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tmsiStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tmsiStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ptmsi().ispresent()){
if(!single_value->field_ptmsi.match(match_value.ptmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsi");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mSNetworkCapability().ispresent()){
if(!single_value->field_mSNetworkCapability.match(match_value.mSNetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".mSNetworkCapability");
single_value->field_mSNetworkCapability.log_match(match_value.mSNetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mSNetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mSNetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pC__LCSCapability().ispresent()){
if(!single_value->field_pC__LCSCapability.match(match_value.pC__LCSCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapability");
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pC__LCSCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pC_LCSCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uENetworkCapability().ispresent()){
if(!single_value->field_uENetworkCapability.match(match_value.uENetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapability");
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uENetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uENetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalMobileIdentity().ispresent()){
if(!single_value->field_additionalMobileIdentity.match(match_value.additionalMobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalMobileIdentity");
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalMobileIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalMobileIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldRoutingAreaIdentification2().ispresent()){
if(!single_value->field_oldRoutingAreaIdentification2.match(match_value.oldRoutingAreaIdentification2(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaIdentification2");
single_value->field_oldRoutingAreaIdentification2.log_match(match_value.oldRoutingAreaIdentification2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldRoutingAreaIdentification2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark2().ispresent()){
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark3().ispresent()){
if(!single_value->field_mobileStationClassmark3.match(match_value.mobileStationClassmark3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark3");
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.voiceDomainUEUsageSetting().ispresent()){
if(!single_value->field_voiceDomainUEUsageSetting.match(match_value.voiceDomainUEUsageSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".voiceDomainUEUsageSetting");
single_value->field_voiceDomainUEUsageSetting.log_match(match_value.voiceDomainUEUsageSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".voiceDomainUEUsageSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.p__TMSI__Type().ispresent()){
if(!single_value->field_p__TMSI__Type.match(match_value.p__TMSI__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI_Type");
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mS__NetworkFeatureSupport().ispresent()){
if(!single_value->field_mS__NetworkFeatureSupport.match(match_value.mS__NetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport");
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldLocationAreaIdentification().ispresent()){
if(!single_value->field_oldLocationAreaIdentification.match(match_value.oldLocationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification");
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldLocationAreaIdentification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateType().ispresent()){
if(!single_value->field_additionalUpdateType.match(match_value.additionalUpdateType(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateType");
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSIBasedNRIcontainer().ispresent()){
if(!single_value->field_tMSIBasedNRIcontainer.match(match_value.tMSIBasedNRIcontainer(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer");
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", updateType := ");
single_value->field_updateType.log_match(match_value.updateType(), legacy);
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
single_value->field_oldRoutingAreaId.log_match(match_value.oldRoutingAreaId(), legacy);
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
if (match_value.oldPTMSISignature().ispresent()) {
single_value->field_oldPTMSISignature.log_match(match_value.oldPTMSISignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldPTMSISignature.log();
if (single_value->field_oldPTMSISignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimerValue := ");
if (match_value.readyTimerValue().ispresent()) {
single_value->field_readyTimerValue.log_match(match_value.readyTimerValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimerValue.log();
if (single_value->field_readyTimerValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", drxParameter := ");
if (match_value.drxParameter().ispresent()) {
single_value->field_drxParameter.log_match(match_value.drxParameter(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_drxParameter.log();
if (single_value->field_drxParameter.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tmsiStatus := ");
if (match_value.tmsiStatus().ispresent()) {
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tmsiStatus.log();
if (single_value->field_tmsiStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ptmsi := ");
if (match_value.ptmsi().ispresent()) {
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsi.log();
if (single_value->field_ptmsi.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
if (match_value.mSNetworkCapability().ispresent()) {
single_value->field_mSNetworkCapability.log_match(match_value.mSNetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mSNetworkCapability.log();
if (single_value->field_mSNetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
if (match_value.pC__LCSCapability().ispresent()) {
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pC__LCSCapability.log();
if (single_value->field_pC__LCSCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uENetworkCapability := ");
if (match_value.uENetworkCapability().ispresent()) {
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uENetworkCapability.log();
if (single_value->field_uENetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
if (match_value.additionalMobileIdentity().ispresent()) {
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalMobileIdentity.log();
if (single_value->field_additionalMobileIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
if (match_value.oldRoutingAreaIdentification2().ispresent()) {
single_value->field_oldRoutingAreaIdentification2.log_match(match_value.oldRoutingAreaIdentification2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldRoutingAreaIdentification2.log();
if (single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
if (match_value.mobileStationClassmark2().ispresent()) {
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2.log();
if (single_value->field_mobileStationClassmark2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
if (match_value.mobileStationClassmark3().ispresent()) {
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark3.log();
if (single_value->field_mobileStationClassmark3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
if (match_value.voiceDomainUEUsageSetting().ispresent()) {
single_value->field_voiceDomainUEUsageSetting.log_match(match_value.voiceDomainUEUsageSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_voiceDomainUEUsageSetting.log();
if (single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
if (match_value.p__TMSI__Type().ispresent()) {
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI__Type.log();
if (single_value->field_p__TMSI__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
if (match_value.mS__NetworkFeatureSupport().ispresent()) {
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__NetworkFeatureSupport.log();
if (single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
if (match_value.oldLocationAreaIdentification().ispresent()) {
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldLocationAreaIdentification.log();
if (single_value->field_oldLocationAreaIdentification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateType := ");
if (match_value.additionalUpdateType().ispresent()) {
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateType.log();
if (single_value->field_additionalUpdateType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
if (match_value.tMSIBasedNRIcontainer().ispresent()) {
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSIBasedNRIcontainer.log();
if (single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_updateType.encode_text(text_buf);
single_value->field_gprsCKSN.encode_text(text_buf);
single_value->field_oldRoutingAreaId.encode_text(text_buf);
single_value->field_msRACap.encode_text(text_buf);
single_value->field_oldPTMSISignature.encode_text(text_buf);
single_value->field_readyTimerValue.encode_text(text_buf);
single_value->field_drxParameter.encode_text(text_buf);
single_value->field_tmsiStatus.encode_text(text_buf);
single_value->field_ptmsi.encode_text(text_buf);
single_value->field_mSNetworkCapability.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_pC__LCSCapability.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.encode_text(text_buf);
single_value->field_uENetworkCapability.encode_text(text_buf);
single_value->field_additionalMobileIdentity.encode_text(text_buf);
single_value->field_oldRoutingAreaIdentification2.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileStationClassmark3.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_voiceDomainUEUsageSetting.encode_text(text_buf);
single_value->field_p__TMSI__Type.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.encode_text(text_buf);
single_value->field_oldLocationAreaIdentification.encode_text(text_buf);
single_value->field_additionalUpdateType.encode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateRequest.");
}
}

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType.decode_text(text_buf);
single_value->field_updateType.decode_text(text_buf);
single_value->field_gprsCKSN.decode_text(text_buf);
single_value->field_oldRoutingAreaId.decode_text(text_buf);
single_value->field_msRACap.decode_text(text_buf);
single_value->field_oldPTMSISignature.decode_text(text_buf);
single_value->field_readyTimerValue.decode_text(text_buf);
single_value->field_drxParameter.decode_text(text_buf);
single_value->field_tmsiStatus.decode_text(text_buf);
single_value->field_ptmsi.decode_text(text_buf);
single_value->field_mSNetworkCapability.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_pC__LCSCapability.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.decode_text(text_buf);
single_value->field_uENetworkCapability.decode_text(text_buf);
single_value->field_additionalMobileIdentity.decode_text(text_buf);
single_value->field_oldRoutingAreaIdentification2.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileStationClassmark3.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_voiceDomainUEUsageSetting.decode_text(text_buf);
single_value->field_p__TMSI__Type.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.decode_text(text_buf);
single_value->field_oldLocationAreaIdentification.decode_text(text_buf);
single_value->field_additionalUpdateType.decode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateRequest_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.PDU_GMM_RoutingAreaUpdateRequest.");
}
}

void PDU__GMM__RoutingAreaUpdateRequest_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: {
    PDU__GMM__RoutingAreaUpdateRequest_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 (30<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest has 30 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) updateType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) oldPTMSISignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) readyTimerValue().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) drxParameter().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mSNetworkCapability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaIdentification2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) voiceDomainUEUsageSetting().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(29));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldPTMSISignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldPTMSISignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParameter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParameter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainUEUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainUEUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_RoutingAreaUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateRequest_template* precondition = new PDU__GMM__RoutingAreaUpdateRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateRequest_template* implied_template = new PDU__GMM__RoutingAreaUpdateRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_updateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_gprsCKSN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldRoutingAreaId.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_msRACap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldPTMSISignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_readyTimerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_drxParameter.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_tmsiStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_ptmsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mSNetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_pC__LCSCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_uENetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_additionalMobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldRoutingAreaIdentification2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mobileStationClassmark3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_voiceDomainUEUsageSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_p__TMSI__Type.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mS__NetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldLocationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_additionalUpdateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_tMSIBasedNRIcontainer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
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.PDU_GMM_RoutingAreaUpdateRequest");
}

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

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

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept()
{
}

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept(const BITSTRING& par_messageType,
    const ForceToStandbyV& par_forceToStandby,
    const UpdateResultV& par_updateResult,
    const GPRSTimerV& par_raUpdateTimer,
    const RoutingAreaIdentificationV& par_routingAreaId,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_allocatedPTMSI,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_msIdentity,
    const OPTIONAL< ReceiveNPDUNumbersListTLV >& par_receiveNPDUNumbers,
    const OPTIONAL< GPRSTimerTV >& par_readyTimer,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< CellNotificationT >& par_cellNotification,
    const OPTIONAL< MobileL3__CommonIE__Types::PLMNListTLV >& par_equivalentPLMNs,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< NetworkFeatureSupportTV >& par_networkFeatureSupport,
    const OPTIONAL< MobileL3__MM__Types::EmergencyNumberListTLV >& par_emergencyNumberList,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus,
    const OPTIONAL< RequestedMSInformationTV >& par_requestedMSInformation,
    const OPTIONAL< GPRSTimer2TLV >& par_t3319,
    const OPTIONAL< GPRSTimer2TLV >& par_t3323,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< AdditionalNetworkFeatureSupportTLV >& par_additionalNetworkFeatureSupport,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_forceToStandby(par_forceToStandby),
  field_updateResult(par_updateResult),
  field_raUpdateTimer(par_raUpdateTimer),
  field_routingAreaId(par_routingAreaId),
  field_ptmsiSignature(par_ptmsiSignature),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_msIdentity(par_msIdentity),
  field_receiveNPDUNumbers(par_receiveNPDUNumbers),
  field_readyTimer(par_readyTimer),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_cellNotification(par_cellNotification),
  field_equivalentPLMNs(par_equivalentPLMNs),
  field_pdpContextStatus(par_pdpContextStatus),
  field_networkFeatureSupport(par_networkFeatureSupport),
  field_emergencyNumberList(par_emergencyNumberList),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus),
  field_requestedMSInformation(par_requestedMSInformation),
  field_t3319(par_t3319),
  field_t3323(par_t3323),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_additionalNetworkFeatureSupport(par_additionalNetworkFeatureSupport),
  field_t3324(par_t3324),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.updateResult().is_bound()) field_updateResult = other_value.updateResult();
else field_updateResult.clean_up();
if (other_value.raUpdateTimer().is_bound()) field_raUpdateTimer = other_value.raUpdateTimer();
else field_raUpdateTimer.clean_up();
if (other_value.routingAreaId().is_bound()) field_routingAreaId = other_value.routingAreaId();
else field_routingAreaId.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
else field_msIdentity.clean_up();
if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
else field_receiveNPDUNumbers.clean_up();
if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
else field_readyTimer.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
else field_cellNotification.clean_up();
if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
else field_equivalentPLMNs.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
else field_networkFeatureSupport.clean_up();
if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
else field_emergencyNumberList.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
else field_requestedMSInformation.clean_up();
if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
else field_t3319.clean_up();
if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
else field_t3323.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
else field_additionalNetworkFeatureSupport.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__RoutingAreaUpdateAccept::clean_up()
{
field_messageType.clean_up();
field_forceToStandby.clean_up();
field_updateResult.clean_up();
field_raUpdateTimer.clean_up();
field_routingAreaId.clean_up();
field_ptmsiSignature.clean_up();
field_allocatedPTMSI.clean_up();
field_msIdentity.clean_up();
field_receiveNPDUNumbers.clean_up();
field_readyTimer.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_cellNotification.clean_up();
field_equivalentPLMNs.clean_up();
field_pdpContextStatus.clean_up();
field_networkFeatureSupport.clean_up();
field_emergencyNumberList.clean_up();
field_mBMS__ContextStatus.clean_up();
field_requestedMSInformation.clean_up();
field_t3319.clean_up();
field_t3323.clean_up();
field_t3312__ExtendedValue.clean_up();
field_additionalNetworkFeatureSupport.clean_up();
field_t3324.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateAccept::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateAccept_descr_; }
PDU__GMM__RoutingAreaUpdateAccept& PDU__GMM__RoutingAreaUpdateAccept::operator=(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.updateResult().is_bound()) field_updateResult = other_value.updateResult();
  else field_updateResult.clean_up();
  if (other_value.raUpdateTimer().is_bound()) field_raUpdateTimer = other_value.raUpdateTimer();
  else field_raUpdateTimer.clean_up();
  if (other_value.routingAreaId().is_bound()) field_routingAreaId = other_value.routingAreaId();
  else field_routingAreaId.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
  else field_msIdentity.clean_up();
  if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
  else field_receiveNPDUNumbers.clean_up();
  if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
  else field_readyTimer.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
  else field_cellNotification.clean_up();
  if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
  else field_equivalentPLMNs.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
  else field_networkFeatureSupport.clean_up();
  if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
  else field_emergencyNumberList.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
  if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
  else field_requestedMSInformation.clean_up();
  if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
  else field_t3319.clean_up();
  if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
  else field_t3323.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
  else field_additionalNetworkFeatureSupport.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateAccept::operator==(const PDU__GMM__RoutingAreaUpdateAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_updateResult==other_value.field_updateResult
  && field_raUpdateTimer==other_value.field_raUpdateTimer
  && field_routingAreaId==other_value.field_routingAreaId
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_msIdentity==other_value.field_msIdentity
  && field_receiveNPDUNumbers==other_value.field_receiveNPDUNumbers
  && field_readyTimer==other_value.field_readyTimer
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_cellNotification==other_value.field_cellNotification
  && field_equivalentPLMNs==other_value.field_equivalentPLMNs
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_networkFeatureSupport==other_value.field_networkFeatureSupport
  && field_emergencyNumberList==other_value.field_emergencyNumberList
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus
  && field_requestedMSInformation==other_value.field_requestedMSInformation
  && field_t3319==other_value.field_t3319
  && field_t3323==other_value.field_t3323
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_additionalNetworkFeatureSupport==other_value.field_additionalNetworkFeatureSupport
  && field_t3324==other_value.field_t3324
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__RoutingAreaUpdateAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_updateResult.is_bound())
  || (field_raUpdateTimer.is_bound())
  || (field_routingAreaId.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_bound())
  || (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_bound())
  || (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_bound())
  || (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_bound())
  || (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_bound())
  || (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_bound())
  || (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateAccept::is_value() const
{
return field_messageType.is_value()
  && field_forceToStandby.is_value()
  && field_updateResult.is_value()
  && field_raUpdateTimer.is_value()
  && field_routingAreaId.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_value())
  && (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_value())
  && (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_value())
  && (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_value())
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value())
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_value())
  && (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_value())
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value())
  && (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_value())
  && (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_value())
  && (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__RoutingAreaUpdateAccept::size_of() const
{
  int ret_val = 5;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_allocatedPTMSI.ispresent()) ret_val++;
  if (field_msIdentity.ispresent()) ret_val++;
  if (field_receiveNPDUNumbers.ispresent()) ret_val++;
  if (field_readyTimer.ispresent()) ret_val++;
  if (field_gmmCause.ispresent()) ret_val++;
  if (field_t3302.ispresent()) ret_val++;
  if (field_cellNotification.ispresent()) ret_val++;
  if (field_equivalentPLMNs.ispresent()) ret_val++;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_networkFeatureSupport.ispresent()) ret_val++;
  if (field_emergencyNumberList.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  if (field_requestedMSInformation.ispresent()) ret_val++;
  if (field_t3319.ispresent()) ret_val++;
  if (field_t3323.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_additionalNetworkFeatureSupport.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateResult := ");
field_updateResult.log();
TTCN_Logger::log_event_str(", raUpdateTimer := ");
field_raUpdateTimer.log();
TTCN_Logger::log_event_str(", routingAreaId := ");
field_routingAreaId.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
field_msIdentity.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", readyTimer := ");
field_readyTimer.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateResult().is_bound()) updateResult().set_implicit_omit();
if (raUpdateTimer().is_bound()) raUpdateTimer().set_implicit_omit();
if (routingAreaId().is_bound()) routingAreaId().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!receiveNPDUNumbers().is_bound()) receiveNPDUNumbers() = OMIT_VALUE;
else receiveNPDUNumbers().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateAccept::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 (25<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept has 25 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) updateResult().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) raUpdateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(24));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "raUpdateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raUpdateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_RoutingAreaUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
  }
}

void PDU__GMM__RoutingAreaUpdateAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_updateResult.encode_text(text_buf);
field_raUpdateTimer.encode_text(text_buf);
field_routingAreaId.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_msIdentity.encode_text(text_buf);
field_receiveNPDUNumbers.encode_text(text_buf);
field_readyTimer.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_cellNotification.encode_text(text_buf);
field_equivalentPLMNs.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_networkFeatureSupport.encode_text(text_buf);
field_emergencyNumberList.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
field_requestedMSInformation.encode_text(text_buf);
field_t3319.encode_text(text_buf);
field_t3323.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_additionalNetworkFeatureSupport.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_updateResult.decode_text(text_buf);
field_raUpdateTimer.decode_text(text_buf);
field_routingAreaId.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_msIdentity.decode_text(text_buf);
field_receiveNPDUNumbers.decode_text(text_buf);
field_readyTimer.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_cellNotification.decode_text(text_buf);
field_equivalentPLMNs.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_networkFeatureSupport.decode_text(text_buf);
field_emergencyNumberList.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
field_requestedMSInformation.decode_text(text_buf);
field_t3319.decode_text(text_buf);
field_t3323.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_additionalNetworkFeatureSupport.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateAccept::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 PDU__GMM__RoutingAreaUpdateAccept::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 PDU__GMM__RoutingAreaUpdateAccept::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_messageType.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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, UpdateResultV_descr_.raw->forceomit);
  decoded_field_length = field_updateResult.RAW_decode(UpdateResultV_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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_raUpdateTimer.RAW_decode(GPRSTimerV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaId.RAW_decode(RoutingAreaIdentificationV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_allocatedPTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_allocatedPTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26){
  field_allocatedPTMSI=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_allocatedPTMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_msIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_msIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_msIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27){
  field_msIdentity=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_msIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_receiveNPDUNumbers = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ReceiveNPDUNumbersListTLV_descr_.raw->forceomit);
  decoded_field_length = field_receiveNPDUNumbers().RAW_decode(ReceiveNPDUNumbersListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_receiveNPDUNumbers = 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_receiveNPDUNumbers=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_readyTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimer = 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_readyTimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_cellNotification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, CellNotificationT_descr_.raw->forceomit);
  decoded_field_length = field_cellNotification().RAW_decode(CellNotificationT_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_cellNotification = 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_cellNotification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_equivalentPLMNs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw->forceomit);
  decoded_field_length = field_equivalentPLMNs().RAW_decode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_equivalentPLMNs = 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_equivalentPLMNs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_networkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_networkFeatureSupport().RAW_decode(NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_networkFeatureSupport = 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_networkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_emergencyNumberList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumberList().RAW_decode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyNumberList = 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_emergencyNumberList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_requestedMSInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, RequestedMSInformationTV_descr_.raw->forceomit);
  decoded_field_length = field_requestedMSInformation().RAW_decode(RequestedMSInformationTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_requestedMSInformation = 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_requestedMSInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_t3319 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3319().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_t3319 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33){
  field_t3319=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_t3319=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_t3323 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3323().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_t3323 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34){
  field_t3323=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_t3323=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_additionalNetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, AdditionalNetworkFeatureSupportTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalNetworkFeatureSupport().RAW_decode(AdditionalNetworkFeatureSupportTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_additionalNetworkFeatureSupport = 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_additionalNetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_41) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__RoutingAreaUpdateAccept::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 = 25;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(25);
  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, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, UpdateResultV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimerV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RoutingAreaIdentificationV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_allocatedPTMSI.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_msIdentity.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_receiveNPDUNumbers.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ReceiveNPDUNumbersListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_readyTimer.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_cellNotification.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, CellNotificationT_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_equivalentPLMNs.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_networkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_emergencyNumberList.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_requestedMSInformation.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, RequestedMSInformationTV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_t3319.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_t3323.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, AdditionalNetworkFeatureSupportTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_updateResult.RAW_encode(UpdateResultV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_raUpdateTimer.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_routingAreaId.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[4]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_allocatedPTMSI.ispresent()) {
  encoded_length += field_allocatedPTMSI().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_msIdentity.ispresent()) {
  encoded_length += field_msIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_receiveNPDUNumbers.ispresent()) {
  encoded_length += field_receiveNPDUNumbers().RAW_encode(ReceiveNPDUNumbersListTLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_readyTimer.ispresent()) {
  encoded_length += field_readyTimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_cellNotification.ispresent()) {
  encoded_length += field_cellNotification().RAW_encode(CellNotificationT_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_equivalentPLMNs.ispresent()) {
  encoded_length += field_equivalentPLMNs().RAW_encode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_networkFeatureSupport.ispresent()) {
  encoded_length += field_networkFeatureSupport().RAW_encode(NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_emergencyNumberList.ispresent()) {
  encoded_length += field_emergencyNumberList().RAW_encode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_requestedMSInformation.ispresent()) {
  encoded_length += field_requestedMSInformation().RAW_encode(RequestedMSInformationTV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_t3319.ispresent()) {
  encoded_length += field_t3319().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_t3323.ispresent()) {
  encoded_length += field_t3323().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  encoded_length += field_additionalNetworkFeatureSupport().RAW_encode(AdditionalNetworkFeatureSupportTLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_allocatedPTMSI.ispresent() && (!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_msIdentity.ispresent() && (!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_27.RAW_encode(General__Types::BIT7_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_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3319.ispresent() && (!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_33.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);
  }
  }
  if (field_t3323.ispresent() && (!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_34.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={23,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_messageType !=  bs_41) {
  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_41.RAW_encode(General__Types::BIT8_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 PDU__GMM__RoutingAreaUpdateAccept_template::single_value_struct {
BITSTRING_template field_messageType;
ForceToStandbyV_template field_forceToStandby;
UpdateResultV_template field_updateResult;
GPRSTimerV_template field_raUpdateTimer;
RoutingAreaIdentificationV_template field_routingAreaId;
P__TMSISignatureTV_template field_ptmsiSignature;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_allocatedPTMSI;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_msIdentity;
ReceiveNPDUNumbersListTLV_template field_receiveNPDUNumbers;
GPRSTimerTV_template field_readyTimer;
GMM__CauseTV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
CellNotificationT_template field_cellNotification;
MobileL3__CommonIE__Types::PLMNListTLV_template field_equivalentPLMNs;
PDPContextStatusTLV_template field_pdpContextStatus;
NetworkFeatureSupportTV_template field_networkFeatureSupport;
MobileL3__MM__Types::EmergencyNumberListTLV_template field_emergencyNumberList;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
RequestedMSInformationTV_template field_requestedMSInformation;
GPRSTimer2TLV_template field_t3319;
GPRSTimer2TLV_template field_t3323;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
AdditionalNetworkFeatureSupportTLV_template field_additionalNetworkFeatureSupport;
GPRSTimer2TLV_template field_t3324;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_updateResult = ANY_VALUE;
single_value->field_raUpdateTimer = ANY_VALUE;
single_value->field_routingAreaId = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_allocatedPTMSI = ANY_OR_OMIT;
single_value->field_msIdentity = ANY_OR_OMIT;
single_value->field_receiveNPDUNumbers = ANY_OR_OMIT;
single_value->field_readyTimer = ANY_OR_OMIT;
single_value->field_gmmCause = ANY_OR_OMIT;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_cellNotification = ANY_OR_OMIT;
single_value->field_equivalentPLMNs = ANY_OR_OMIT;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_networkFeatureSupport = ANY_OR_OMIT;
single_value->field_emergencyNumberList = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
single_value->field_requestedMSInformation = ANY_OR_OMIT;
single_value->field_t3319 = ANY_OR_OMIT;
single_value->field_t3323 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_additionalNetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateAccept_template::copy_value(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.updateResult().is_bound()) {
  single_value->field_updateResult = other_value.updateResult();
} else {
  single_value->field_updateResult.clean_up();
}
if (other_value.raUpdateTimer().is_bound()) {
  single_value->field_raUpdateTimer = other_value.raUpdateTimer();
} else {
  single_value->field_raUpdateTimer.clean_up();
}
if (other_value.routingAreaId().is_bound()) {
  single_value->field_routingAreaId = other_value.routingAreaId();
} else {
  single_value->field_routingAreaId.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  if (other_value.allocatedPTMSI().ispresent()) single_value->field_allocatedPTMSI = other_value.allocatedPTMSI()();
  else single_value->field_allocatedPTMSI = OMIT_VALUE;
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.msIdentity().is_bound()) {
  if (other_value.msIdentity().ispresent()) single_value->field_msIdentity = other_value.msIdentity()();
  else single_value->field_msIdentity = OMIT_VALUE;
} else {
  single_value->field_msIdentity.clean_up();
}
if (other_value.receiveNPDUNumbers().is_bound()) {
  if (other_value.receiveNPDUNumbers().ispresent()) single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers()();
  else single_value->field_receiveNPDUNumbers = OMIT_VALUE;
} else {
  single_value->field_receiveNPDUNumbers.clean_up();
}
if (other_value.readyTimer().is_bound()) {
  if (other_value.readyTimer().ispresent()) single_value->field_readyTimer = other_value.readyTimer()();
  else single_value->field_readyTimer = OMIT_VALUE;
} else {
  single_value->field_readyTimer.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.cellNotification().is_bound()) {
  if (other_value.cellNotification().ispresent()) single_value->field_cellNotification = other_value.cellNotification()();
  else single_value->field_cellNotification = OMIT_VALUE;
} else {
  single_value->field_cellNotification.clean_up();
}
if (other_value.equivalentPLMNs().is_bound()) {
  if (other_value.equivalentPLMNs().ispresent()) single_value->field_equivalentPLMNs = other_value.equivalentPLMNs()();
  else single_value->field_equivalentPLMNs = OMIT_VALUE;
} else {
  single_value->field_equivalentPLMNs.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.networkFeatureSupport().is_bound()) {
  if (other_value.networkFeatureSupport().ispresent()) single_value->field_networkFeatureSupport = other_value.networkFeatureSupport()();
  else single_value->field_networkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_networkFeatureSupport.clean_up();
}
if (other_value.emergencyNumberList().is_bound()) {
  if (other_value.emergencyNumberList().ispresent()) single_value->field_emergencyNumberList = other_value.emergencyNumberList()();
  else single_value->field_emergencyNumberList = OMIT_VALUE;
} else {
  single_value->field_emergencyNumberList.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
if (other_value.requestedMSInformation().is_bound()) {
  if (other_value.requestedMSInformation().ispresent()) single_value->field_requestedMSInformation = other_value.requestedMSInformation()();
  else single_value->field_requestedMSInformation = OMIT_VALUE;
} else {
  single_value->field_requestedMSInformation.clean_up();
}
if (other_value.t3319().is_bound()) {
  if (other_value.t3319().ispresent()) single_value->field_t3319 = other_value.t3319()();
  else single_value->field_t3319 = OMIT_VALUE;
} else {
  single_value->field_t3319.clean_up();
}
if (other_value.t3323().is_bound()) {
  if (other_value.t3323().ispresent()) single_value->field_t3323 = other_value.t3323()();
  else single_value->field_t3323 = OMIT_VALUE;
} else {
  single_value->field_t3323.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.additionalNetworkFeatureSupport().is_bound()) {
  if (other_value.additionalNetworkFeatureSupport().ispresent()) single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport()();
  else single_value->field_additionalNetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateAccept_template::copy_template(const PDU__GMM__RoutingAreaUpdateAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateResult().get_selection()) {
single_value->field_updateResult = other_value.updateResult();
} else {
single_value->field_updateResult.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.raUpdateTimer().get_selection()) {
single_value->field_raUpdateTimer = other_value.raUpdateTimer();
} else {
single_value->field_raUpdateTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaId().get_selection()) {
single_value->field_routingAreaId = other_value.routingAreaId();
} else {
single_value->field_routingAreaId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msIdentity().get_selection()) {
single_value->field_msIdentity = other_value.msIdentity();
} else {
single_value->field_msIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.receiveNPDUNumbers().get_selection()) {
single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
} else {
single_value->field_receiveNPDUNumbers.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimer().get_selection()) {
single_value->field_readyTimer = other_value.readyTimer();
} else {
single_value->field_readyTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellNotification().get_selection()) {
single_value->field_cellNotification = other_value.cellNotification();
} else {
single_value->field_cellNotification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.equivalentPLMNs().get_selection()) {
single_value->field_equivalentPLMNs = other_value.equivalentPLMNs();
} else {
single_value->field_equivalentPLMNs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkFeatureSupport().get_selection()) {
single_value->field_networkFeatureSupport = other_value.networkFeatureSupport();
} else {
single_value->field_networkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumberList().get_selection()) {
single_value->field_emergencyNumberList = other_value.emergencyNumberList();
} else {
single_value->field_emergencyNumberList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedMSInformation().get_selection()) {
single_value->field_requestedMSInformation = other_value.requestedMSInformation();
} else {
single_value->field_requestedMSInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3319().get_selection()) {
single_value->field_t3319 = other_value.t3319();
} else {
single_value->field_t3319.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3323().get_selection()) {
single_value->field_t3323 = other_value.t3323();
} else {
single_value->field_t3323.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalNetworkFeatureSupport().get_selection()) {
single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
} else {
single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateAccept_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 PDU__GMM__RoutingAreaUpdateAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateAccept_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.PDU_GMM_RoutingAreaUpdateAccept.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateAccept_template::PDU__GMM__RoutingAreaUpdateAccept_template()
{
}

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

PDU__GMM__RoutingAreaUpdateAccept_template::PDU__GMM__RoutingAreaUpdateAccept_template(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__RoutingAreaUpdateAccept_template::match(const PDU__GMM__RoutingAreaUpdateAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.updateResult().is_bound()) return FALSE;
if(!single_value->field_updateResult.match(other_value.updateResult(), legacy))return FALSE;
if(!other_value.raUpdateTimer().is_bound()) return FALSE;
if(!single_value->field_raUpdateTimer.match(other_value.raUpdateTimer(), legacy))return FALSE;
if(!other_value.routingAreaId().is_bound()) return FALSE;
if(!single_value->field_routingAreaId.match(other_value.routingAreaId(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if((other_value.allocatedPTMSI().ispresent() ? !single_value->field_allocatedPTMSI.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.allocatedPTMSI(), legacy) : !single_value->field_allocatedPTMSI.match_omit(legacy)))return FALSE;
if(!other_value.msIdentity().is_bound()) return FALSE;
if((other_value.msIdentity().ispresent() ? !single_value->field_msIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.msIdentity(), legacy) : !single_value->field_msIdentity.match_omit(legacy)))return FALSE;
if(!other_value.receiveNPDUNumbers().is_bound()) return FALSE;
if((other_value.receiveNPDUNumbers().ispresent() ? !single_value->field_receiveNPDUNumbers.match((const ReceiveNPDUNumbersListTLV&)other_value.receiveNPDUNumbers(), legacy) : !single_value->field_receiveNPDUNumbers.match_omit(legacy)))return FALSE;
if(!other_value.readyTimer().is_bound()) return FALSE;
if((other_value.readyTimer().ispresent() ? !single_value->field_readyTimer.match((const GPRSTimerTV&)other_value.readyTimer(), legacy) : !single_value->field_readyTimer.match_omit(legacy)))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.match_omit(legacy)))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.cellNotification().is_bound()) return FALSE;
if((other_value.cellNotification().ispresent() ? !single_value->field_cellNotification.match((const CellNotificationT&)other_value.cellNotification(), legacy) : !single_value->field_cellNotification.match_omit(legacy)))return FALSE;
if(!other_value.equivalentPLMNs().is_bound()) return FALSE;
if((other_value.equivalentPLMNs().ispresent() ? !single_value->field_equivalentPLMNs.match((const MobileL3__CommonIE__Types::PLMNListTLV&)other_value.equivalentPLMNs(), legacy) : !single_value->field_equivalentPLMNs.match_omit(legacy)))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.networkFeatureSupport().is_bound()) return FALSE;
if((other_value.networkFeatureSupport().ispresent() ? !single_value->field_networkFeatureSupport.match((const NetworkFeatureSupportTV&)other_value.networkFeatureSupport(), legacy) : !single_value->field_networkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.emergencyNumberList().is_bound()) return FALSE;
if((other_value.emergencyNumberList().ispresent() ? !single_value->field_emergencyNumberList.match((const MobileL3__MM__Types::EmergencyNumberListTLV&)other_value.emergencyNumberList(), legacy) : !single_value->field_emergencyNumberList.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.requestedMSInformation().is_bound()) return FALSE;
if((other_value.requestedMSInformation().ispresent() ? !single_value->field_requestedMSInformation.match((const RequestedMSInformationTV&)other_value.requestedMSInformation(), legacy) : !single_value->field_requestedMSInformation.match_omit(legacy)))return FALSE;
if(!other_value.t3319().is_bound()) return FALSE;
if((other_value.t3319().ispresent() ? !single_value->field_t3319.match((const GPRSTimer2TLV&)other_value.t3319(), legacy) : !single_value->field_t3319.match_omit(legacy)))return FALSE;
if(!other_value.t3323().is_bound()) return FALSE;
if((other_value.t3323().ispresent() ? !single_value->field_t3323.match((const GPRSTimer2TLV&)other_value.t3323(), legacy) : !single_value->field_t3323.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.additionalNetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.additionalNetworkFeatureSupport().ispresent() ? !single_value->field_additionalNetworkFeatureSupport.match((const AdditionalNetworkFeatureSupportTLV&)other_value.additionalNetworkFeatureSupport(), legacy) : !single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateAccept.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_updateResult.is_bound()
 || single_value->field_raUpdateTimer.is_bound()
 || single_value->field_routingAreaId.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_bound())
 || (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_bound())
 || (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_bound())
 || (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_bound())
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound())
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_bound())
 || (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_bound())
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_bound())
 || (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound())
 || (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_bound())
 || (single_value->field_t3319.is_omit() || single_value->field_t3319.is_bound())
 || (single_value->field_t3323.is_omit() || single_value->field_t3323.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_updateResult.is_value()
 && single_value->field_raUpdateTimer.is_value()
 && single_value->field_routingAreaId.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_value())
 && (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_value())
 && (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_value())
 && (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_value())
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value())
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_value())
 && (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_value())
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_value())
 && (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value())
 && (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_value())
 && (single_value->field_t3319.is_omit() || single_value->field_t3319.is_value())
 && (single_value->field_t3323.is_omit() || single_value->field_t3323.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

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

PDU__GMM__RoutingAreaUpdateAccept PDU__GMM__RoutingAreaUpdateAccept_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.PDU_GMM_RoutingAreaUpdateAccept.");
PDU__GMM__RoutingAreaUpdateAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_updateResult.is_bound()) {
ret_val.updateResult() = single_value->field_updateResult.valueof();
}
if (single_value->field_raUpdateTimer.is_bound()) {
ret_val.raUpdateTimer() = single_value->field_raUpdateTimer.valueof();
}
if (single_value->field_routingAreaId.is_bound()) {
ret_val.routingAreaId() = single_value->field_routingAreaId.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_allocatedPTMSI.is_omit()) ret_val.allocatedPTMSI() = OMIT_VALUE;
else if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_msIdentity.is_omit()) ret_val.msIdentity() = OMIT_VALUE;
else if (single_value->field_msIdentity.is_bound()) {
ret_val.msIdentity() = single_value->field_msIdentity.valueof();
}
if (single_value->field_receiveNPDUNumbers.is_omit()) ret_val.receiveNPDUNumbers() = OMIT_VALUE;
else if (single_value->field_receiveNPDUNumbers.is_bound()) {
ret_val.receiveNPDUNumbers() = single_value->field_receiveNPDUNumbers.valueof();
}
if (single_value->field_readyTimer.is_omit()) ret_val.readyTimer() = OMIT_VALUE;
else if (single_value->field_readyTimer.is_bound()) {
ret_val.readyTimer() = single_value->field_readyTimer.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_cellNotification.is_omit()) ret_val.cellNotification() = OMIT_VALUE;
else if (single_value->field_cellNotification.is_bound()) {
ret_val.cellNotification() = single_value->field_cellNotification.valueof();
}
if (single_value->field_equivalentPLMNs.is_omit()) ret_val.equivalentPLMNs() = OMIT_VALUE;
else if (single_value->field_equivalentPLMNs.is_bound()) {
ret_val.equivalentPLMNs() = single_value->field_equivalentPLMNs.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_networkFeatureSupport.is_omit()) ret_val.networkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_networkFeatureSupport.is_bound()) {
ret_val.networkFeatureSupport() = single_value->field_networkFeatureSupport.valueof();
}
if (single_value->field_emergencyNumberList.is_omit()) ret_val.emergencyNumberList() = OMIT_VALUE;
else if (single_value->field_emergencyNumberList.is_bound()) {
ret_val.emergencyNumberList() = single_value->field_emergencyNumberList.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
if (single_value->field_requestedMSInformation.is_omit()) ret_val.requestedMSInformation() = OMIT_VALUE;
else if (single_value->field_requestedMSInformation.is_bound()) {
ret_val.requestedMSInformation() = single_value->field_requestedMSInformation.valueof();
}
if (single_value->field_t3319.is_omit()) ret_val.t3319() = OMIT_VALUE;
else if (single_value->field_t3319.is_bound()) {
ret_val.t3319() = single_value->field_t3319.valueof();
}
if (single_value->field_t3323.is_omit()) ret_val.t3323() = OMIT_VALUE;
else if (single_value->field_t3323.is_bound()) {
ret_val.t3323() = single_value->field_t3323.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_additionalNetworkFeatureSupport.is_omit()) ret_val.additionalNetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_additionalNetworkFeatureSupport.is_bound()) {
ret_val.additionalNetworkFeatureSupport() = single_value->field_additionalNetworkFeatureSupport.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateAccept_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.PDU_GMM_RoutingAreaUpdateAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateAccept_template[list_length];
}

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

BITSTRING_template& PDU__GMM__RoutingAreaUpdateAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_messageType;
}

ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateAccept_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateAccept_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_forceToStandby;
}

UpdateResultV_template& PDU__GMM__RoutingAreaUpdateAccept_template::updateResult()
{
set_specific();
return single_value->field_updateResult;
}

const UpdateResultV_template& PDU__GMM__RoutingAreaUpdateAccept_template::updateResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateResult of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_updateResult;
}

GPRSTimerV_template& PDU__GMM__RoutingAreaUpdateAccept_template::raUpdateTimer()
{
set_specific();
return single_value->field_raUpdateTimer;
}

const GPRSTimerV_template& PDU__GMM__RoutingAreaUpdateAccept_template::raUpdateTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field raUpdateTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_raUpdateTimer;
}

RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateAccept_template::routingAreaId()
{
set_specific();
return single_value->field_routingAreaId;
}

const RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateAccept_template::routingAreaId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaId of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_routingAreaId;
}

P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_ptmsiSignature;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_allocatedPTMSI;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::msIdentity()
{
set_specific();
return single_value->field_msIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::msIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_msIdentity;
}

ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::receiveNPDUNumbers()
{
set_specific();
return single_value->field_receiveNPDUNumbers;
}

const ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::receiveNPDUNumbers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field receiveNPDUNumbers of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_receiveNPDUNumbers;
}

GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::readyTimer()
{
set_specific();
return single_value->field_readyTimer;
}

const GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::readyTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_readyTimer;
}

GMM__CauseTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3302;
}

CellNotificationT_template& PDU__GMM__RoutingAreaUpdateAccept_template::cellNotification()
{
set_specific();
return single_value->field_cellNotification;
}

const CellNotificationT_template& PDU__GMM__RoutingAreaUpdateAccept_template::cellNotification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellNotification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_cellNotification;
}

MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::equivalentPLMNs()
{
set_specific();
return single_value->field_equivalentPLMNs;
}

const MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::equivalentPLMNs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field equivalentPLMNs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_equivalentPLMNs;
}

PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_pdpContextStatus;
}

NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::networkFeatureSupport()
{
set_specific();
return single_value->field_networkFeatureSupport;
}

const NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::networkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_networkFeatureSupport;
}

MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::emergencyNumberList()
{
set_specific();
return single_value->field_emergencyNumberList;
}

const MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::emergencyNumberList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumberList of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_emergencyNumberList;
}

MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_mBMS__ContextStatus;
}

RequestedMSInformationTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::requestedMSInformation()
{
set_specific();
return single_value->field_requestedMSInformation;
}

const RequestedMSInformationTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::requestedMSInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedMSInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_requestedMSInformation;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3319()
{
set_specific();
return single_value->field_t3319;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3319() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3319 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3319;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3323()
{
set_specific();
return single_value->field_t3323;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3323() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3323 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3323;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3312__ExtendedValue;
}

AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::additionalNetworkFeatureSupport()
{
set_specific();
return single_value->field_additionalNetworkFeatureSupport;
}

const AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::additionalNetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalNetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_additionalNetworkFeatureSupport;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3324;
}

ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__RoutingAreaUpdateAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_allocatedPTMSI.is_present()) ret_val++;
      if (single_value->field_msIdentity.is_present()) ret_val++;
      if (single_value->field_receiveNPDUNumbers.is_present()) ret_val++;
      if (single_value->field_readyTimer.is_present()) ret_val++;
      if (single_value->field_gmmCause.is_present()) ret_val++;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_cellNotification.is_present()) ret_val++;
      if (single_value->field_equivalentPLMNs.is_present()) ret_val++;
      if (single_value->field_pdpContextStatus.is_present()) ret_val++;
      if (single_value->field_networkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_emergencyNumberList.is_present()) ret_val++;
      if (single_value->field_mBMS__ContextStatus.is_present()) ret_val++;
      if (single_value->field_requestedMSInformation.is_present()) ret_val++;
      if (single_value->field_t3319.is_present()) ret_val++;
      if (single_value->field_t3323.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_additionalNetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateAccept 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.PDU_GMM_RoutingAreaUpdateAccept 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.PDU_GMM_RoutingAreaUpdateAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateResult := ");
single_value->field_updateResult.log();
TTCN_Logger::log_event_str(", raUpdateTimer := ");
single_value->field_raUpdateTimer.log();
TTCN_Logger::log_event_str(", routingAreaId := ");
single_value->field_routingAreaId.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", readyTimer := ");
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
single_value->field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
single_value->field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateAccept_template::log_match(const PDU__GMM__RoutingAreaUpdateAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateResult.match(match_value.updateResult(), legacy)){
TTCN_Logger::log_logmatch_info(".updateResult");
single_value->field_updateResult.log_match(match_value.updateResult(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_raUpdateTimer.match(match_value.raUpdateTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".raUpdateTimer");
single_value->field_raUpdateTimer.log_match(match_value.raUpdateTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaId.match(match_value.routingAreaId(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaId");
single_value->field_routingAreaId.log_match(match_value.routingAreaId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allocatedPTMSI().ispresent()){
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocatedPTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocatedPTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.msIdentity().ispresent()){
if(!single_value->field_msIdentity.match(match_value.msIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".msIdentity");
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_msIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".msIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.receiveNPDUNumbers().ispresent()){
if(!single_value->field_receiveNPDUNumbers.match(match_value.receiveNPDUNumbers(), legacy)){
TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers");
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_receiveNPDUNumbers.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimer().ispresent()){
if(!single_value->field_readyTimer.match(match_value.readyTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimer");
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cellNotification().ispresent()){
if(!single_value->field_cellNotification.match(match_value.cellNotification(), legacy)){
TTCN_Logger::log_logmatch_info(".cellNotification");
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellNotification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellNotification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.equivalentPLMNs().ispresent()){
if(!single_value->field_equivalentPLMNs.match(match_value.equivalentPLMNs(), legacy)){
TTCN_Logger::log_logmatch_info(".equivalentPLMNs");
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_equivalentPLMNs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".equivalentPLMNs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkFeatureSupport().ispresent()){
if(!single_value->field_networkFeatureSupport.match(match_value.networkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".networkFeatureSupport");
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.emergencyNumberList().ispresent()){
if(!single_value->field_emergencyNumberList.match(match_value.emergencyNumberList(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyNumberList");
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_emergencyNumberList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".emergencyNumberList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requestedMSInformation().ispresent()){
if(!single_value->field_requestedMSInformation.match(match_value.requestedMSInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedMSInformation");
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requestedMSInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requestedMSInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3319().ispresent()){
if(!single_value->field_t3319.match(match_value.t3319(), legacy)){
TTCN_Logger::log_logmatch_info(".t3319");
single_value->field_t3319.log_match(match_value.t3319(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3319.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3319 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3319.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3323().ispresent()){
if(!single_value->field_t3323.match(match_value.t3323(), legacy)){
TTCN_Logger::log_logmatch_info(".t3323");
single_value->field_t3323.log_match(match_value.t3323(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3323.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3323 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3323.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalNetworkFeatureSupport().ispresent()){
if(!single_value->field_additionalNetworkFeatureSupport.match(match_value.additionalNetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport");
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", updateResult := ");
single_value->field_updateResult.log_match(match_value.updateResult(), legacy);
TTCN_Logger::log_event_str(", raUpdateTimer := ");
single_value->field_raUpdateTimer.log_match(match_value.raUpdateTimer(), legacy);
TTCN_Logger::log_event_str(", routingAreaId := ");
single_value->field_routingAreaId.log_match(match_value.routingAreaId(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
if (match_value.allocatedPTMSI().ispresent()) {
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocatedPTMSI.log();
if (single_value->field_allocatedPTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", msIdentity := ");
if (match_value.msIdentity().ispresent()) {
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_msIdentity.log();
if (single_value->field_msIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
if (match_value.receiveNPDUNumbers().ispresent()) {
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_receiveNPDUNumbers.log();
if (single_value->field_receiveNPDUNumbers.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimer := ");
if (match_value.readyTimer().ispresent()) {
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimer.log();
if (single_value->field_readyTimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cellNotification := ");
if (match_value.cellNotification().ispresent()) {
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellNotification.log();
if (single_value->field_cellNotification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
if (match_value.equivalentPLMNs().ispresent()) {
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_equivalentPLMNs.log();
if (single_value->field_equivalentPLMNs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
if (match_value.networkFeatureSupport().ispresent()) {
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkFeatureSupport.log();
if (single_value->field_networkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", emergencyNumberList := ");
if (match_value.emergencyNumberList().ispresent()) {
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_emergencyNumberList.log();
if (single_value->field_emergencyNumberList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestedMSInformation := ");
if (match_value.requestedMSInformation().ispresent()) {
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requestedMSInformation.log();
if (single_value->field_requestedMSInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3319 := ");
if (match_value.t3319().ispresent()) {
single_value->field_t3319.log_match(match_value.t3319(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3319.log();
if (single_value->field_t3319.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3323 := ");
if (match_value.t3323().ispresent()) {
single_value->field_t3323.log_match(match_value.t3323(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3323.log();
if (single_value->field_t3323.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
if (match_value.additionalNetworkFeatureSupport().ispresent()) {
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalNetworkFeatureSupport.log();
if (single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_updateResult.encode_text(text_buf);
single_value->field_raUpdateTimer.encode_text(text_buf);
single_value->field_routingAreaId.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_msIdentity.encode_text(text_buf);
single_value->field_receiveNPDUNumbers.encode_text(text_buf);
single_value->field_readyTimer.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_cellNotification.encode_text(text_buf);
single_value->field_equivalentPLMNs.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_networkFeatureSupport.encode_text(text_buf);
single_value->field_emergencyNumberList.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.encode_text(text_buf);
single_value->field_requestedMSInformation.encode_text(text_buf);
single_value->field_t3319.encode_text(text_buf);
single_value->field_t3323.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_extendedDRXParameters.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.PDU_GMM_RoutingAreaUpdateAccept.");
}
}

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_updateResult.decode_text(text_buf);
single_value->field_raUpdateTimer.decode_text(text_buf);
single_value->field_routingAreaId.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_msIdentity.decode_text(text_buf);
single_value->field_receiveNPDUNumbers.decode_text(text_buf);
single_value->field_readyTimer.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_cellNotification.decode_text(text_buf);
single_value->field_equivalentPLMNs.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_networkFeatureSupport.decode_text(text_buf);
single_value->field_emergencyNumberList.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.decode_text(text_buf);
single_value->field_requestedMSInformation.decode_text(text_buf);
single_value->field_t3319.decode_text(text_buf);
single_value->field_t3323.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateAccept_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.PDU_GMM_RoutingAreaUpdateAccept.");
}
}

void PDU__GMM__RoutingAreaUpdateAccept_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: {
    PDU__GMM__RoutingAreaUpdateAccept_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 (25<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept has 25 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) updateResult().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) raUpdateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(24));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "raUpdateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raUpdateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().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.PDU_GMM_RoutingAreaUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateAccept_template* precondition = new PDU__GMM__RoutingAreaUpdateAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateAccept_template* implied_template = new PDU__GMM__RoutingAreaUpdateAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_updateResult.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_raUpdateTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_routingAreaId.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_msIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_receiveNPDUNumbers.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_readyTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_cellNotification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_equivalentPLMNs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_networkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_emergencyNumberList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_requestedMSInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3319.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3323.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_additionalNetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
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.PDU_GMM_RoutingAreaUpdateAccept");
}

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

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

PDU__GMM__RoutingAreaUpdateComplete::PDU__GMM__RoutingAreaUpdateComplete()
{
}

PDU__GMM__RoutingAreaUpdateComplete::PDU__GMM__RoutingAreaUpdateComplete(const BITSTRING& par_messageType,
    const OPTIONAL< ReceiveNPDUNumbersListTLV >& par_receiveNPDUNumbers,
    const OPTIONAL< InterRATInformationContainerTLV >& par_interRATHandoverInformation,
    const OPTIONAL< EUTRANinterRATInformationContainerTLV >& par_eUTRANinterRATHandoverInformation)
  :   field_messageType(par_messageType),
  field_receiveNPDUNumbers(par_receiveNPDUNumbers),
  field_interRATHandoverInformation(par_interRATHandoverInformation),
  field_eUTRANinterRATHandoverInformation(par_eUTRANinterRATHandoverInformation)
{
}

PDU__GMM__RoutingAreaUpdateComplete::PDU__GMM__RoutingAreaUpdateComplete(const PDU__GMM__RoutingAreaUpdateComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
else field_receiveNPDUNumbers.clean_up();
if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
else field_interRATHandoverInformation.clean_up();
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
else field_eUTRANinterRATHandoverInformation.clean_up();
}

void PDU__GMM__RoutingAreaUpdateComplete::clean_up()
{
field_messageType.clean_up();
field_receiveNPDUNumbers.clean_up();
field_interRATHandoverInformation.clean_up();
field_eUTRANinterRATHandoverInformation.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateComplete::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateComplete_descr_; }
PDU__GMM__RoutingAreaUpdateComplete& PDU__GMM__RoutingAreaUpdateComplete::operator=(const PDU__GMM__RoutingAreaUpdateComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
  else field_receiveNPDUNumbers.clean_up();
  if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
  else field_interRATHandoverInformation.clean_up();
  if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
  else field_eUTRANinterRATHandoverInformation.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateComplete::operator==(const PDU__GMM__RoutingAreaUpdateComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_receiveNPDUNumbers==other_value.field_receiveNPDUNumbers
  && field_interRATHandoverInformation==other_value.field_interRATHandoverInformation
  && field_eUTRANinterRATHandoverInformation==other_value.field_eUTRANinterRATHandoverInformation;
}

boolean PDU__GMM__RoutingAreaUpdateComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_bound())
  || (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_bound())
  || (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateComplete::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_value())
  && (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_value())
  && (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_value());
}
int PDU__GMM__RoutingAreaUpdateComplete::size_of() const
{
  int ret_val = 1;
  if (field_receiveNPDUNumbers.ispresent()) ret_val++;
  if (field_interRATHandoverInformation.ispresent()) ret_val++;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
field_eUTRANinterRATHandoverInformation.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!receiveNPDUNumbers().is_bound()) receiveNPDUNumbers() = OMIT_VALUE;
else receiveNPDUNumbers().set_implicit_omit();
if (!interRATHandoverInformation().is_bound()) interRATHandoverInformation() = OMIT_VALUE;
else interRATHandoverInformation().set_implicit_omit();
if (!eUTRANinterRATHandoverInformation().is_bound()) eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else eUTRANinterRATHandoverInformation().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateComplete::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.PDU_GMM_RoutingAreaUpdateComplete 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInformation().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInformation().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInformation().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.PDU_GMM_RoutingAreaUpdateComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
  }
}

void PDU__GMM__RoutingAreaUpdateComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_receiveNPDUNumbers.encode_text(text_buf);
field_interRATHandoverInformation.encode_text(text_buf);
field_eUTRANinterRATHandoverInformation.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_receiveNPDUNumbers.decode_text(text_buf);
field_interRATHandoverInformation.decode_text(text_buf);
field_eUTRANinterRATHandoverInformation.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateComplete::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 PDU__GMM__RoutingAreaUpdateComplete::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 PDU__GMM__RoutingAreaUpdateComplete::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_messageType.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_receiveNPDUNumbers = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, ReceiveNPDUNumbersListTLV_descr_.raw->forceomit);
  decoded_field_length = field_receiveNPDUNumbers().RAW_decode(ReceiveNPDUNumbersListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_receiveNPDUNumbers = 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_receiveNPDUNumbers=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_interRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, InterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_interRATHandoverInformation().RAW_decode(InterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_interRATHandoverInformation = 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_interRATHandoverInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, EUTRANinterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_eUTRANinterRATHandoverInformation().RAW_decode(EUTRANinterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_eUTRANinterRATHandoverInformation = 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_eUTRANinterRATHandoverInformation=OMIT_VALUE;
  if (field_messageType !=  bs_42) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__RoutingAreaUpdateComplete::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::BIT8_descr_.raw);
  if (field_receiveNPDUNumbers.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ReceiveNPDUNumbersListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_interRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, InterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, EUTRANinterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_receiveNPDUNumbers.ispresent()) {
  encoded_length += field_receiveNPDUNumbers().RAW_encode(ReceiveNPDUNumbersListTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_interRATHandoverInformation.ispresent()) {
  encoded_length += field_interRATHandoverInformation().RAW_encode(InterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  encoded_length += field_eUTRANinterRATHandoverInformation().RAW_encode(EUTRANinterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_messageType !=  bs_42) {
  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_42.RAW_encode(General__Types::BIT8_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 PDU__GMM__RoutingAreaUpdateComplete_template::single_value_struct {
BITSTRING_template field_messageType;
ReceiveNPDUNumbersListTLV_template field_receiveNPDUNumbers;
InterRATInformationContainerTLV_template field_interRATHandoverInformation;
EUTRANinterRATInformationContainerTLV_template field_eUTRANinterRATHandoverInformation;
};

void PDU__GMM__RoutingAreaUpdateComplete_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_messageType = ANY_VALUE;
single_value->field_receiveNPDUNumbers = ANY_OR_OMIT;
single_value->field_interRATHandoverInformation = ANY_OR_OMIT;
single_value->field_eUTRANinterRATHandoverInformation = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateComplete_template::copy_value(const PDU__GMM__RoutingAreaUpdateComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.receiveNPDUNumbers().is_bound()) {
  if (other_value.receiveNPDUNumbers().ispresent()) single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers()();
  else single_value->field_receiveNPDUNumbers = OMIT_VALUE;
} else {
  single_value->field_receiveNPDUNumbers.clean_up();
}
if (other_value.interRATHandoverInformation().is_bound()) {
  if (other_value.interRATHandoverInformation().ispresent()) single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation()();
  else single_value->field_interRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_interRATHandoverInformation.clean_up();
}
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) {
  if (other_value.eUTRANinterRATHandoverInformation().ispresent()) single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation()();
  else single_value->field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_eUTRANinterRATHandoverInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateComplete_template::copy_template(const PDU__GMM__RoutingAreaUpdateComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.receiveNPDUNumbers().get_selection()) {
single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
} else {
single_value->field_receiveNPDUNumbers.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interRATHandoverInformation().get_selection()) {
single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation();
} else {
single_value->field_interRATHandoverInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANinterRATHandoverInformation().get_selection()) {
single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
} else {
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__RoutingAreaUpdateComplete_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 PDU__GMM__RoutingAreaUpdateComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateComplete_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.PDU_GMM_RoutingAreaUpdateComplete.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateComplete_template::PDU__GMM__RoutingAreaUpdateComplete_template()
{
}

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

PDU__GMM__RoutingAreaUpdateComplete_template::PDU__GMM__RoutingAreaUpdateComplete_template(const PDU__GMM__RoutingAreaUpdateComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__RoutingAreaUpdateComplete_template::match(const PDU__GMM__RoutingAreaUpdateComplete& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.receiveNPDUNumbers().is_bound()) return FALSE;
if((other_value.receiveNPDUNumbers().ispresent() ? !single_value->field_receiveNPDUNumbers.match((const ReceiveNPDUNumbersListTLV&)other_value.receiveNPDUNumbers(), legacy) : !single_value->field_receiveNPDUNumbers.match_omit(legacy)))return FALSE;
if(!other_value.interRATHandoverInformation().is_bound()) return FALSE;
if((other_value.interRATHandoverInformation().ispresent() ? !single_value->field_interRATHandoverInformation.match((const InterRATInformationContainerTLV&)other_value.interRATHandoverInformation(), legacy) : !single_value->field_interRATHandoverInformation.match_omit(legacy)))return FALSE;
if(!other_value.eUTRANinterRATHandoverInformation().is_bound()) return FALSE;
if((other_value.eUTRANinterRATHandoverInformation().ispresent() ? !single_value->field_eUTRANinterRATHandoverInformation.match((const EUTRANinterRATInformationContainerTLV&)other_value.eUTRANinterRATHandoverInformation(), legacy) : !single_value->field_eUTRANinterRATHandoverInformation.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.PDU_GMM_RoutingAreaUpdateComplete.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateComplete_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_bound())
 || (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_bound())
 || (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateComplete_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_value())
 && (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_value())
 && (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_value());
}

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

PDU__GMM__RoutingAreaUpdateComplete PDU__GMM__RoutingAreaUpdateComplete_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.PDU_GMM_RoutingAreaUpdateComplete.");
PDU__GMM__RoutingAreaUpdateComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_receiveNPDUNumbers.is_omit()) ret_val.receiveNPDUNumbers() = OMIT_VALUE;
else if (single_value->field_receiveNPDUNumbers.is_bound()) {
ret_val.receiveNPDUNumbers() = single_value->field_receiveNPDUNumbers.valueof();
}
if (single_value->field_interRATHandoverInformation.is_omit()) ret_val.interRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_interRATHandoverInformation.is_bound()) {
ret_val.interRATHandoverInformation() = single_value->field_interRATHandoverInformation.valueof();
}
if (single_value->field_eUTRANinterRATHandoverInformation.is_omit()) ret_val.eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_eUTRANinterRATHandoverInformation.is_bound()) {
ret_val.eUTRANinterRATHandoverInformation() = single_value->field_eUTRANinterRATHandoverInformation.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateComplete_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.PDU_GMM_RoutingAreaUpdateComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateComplete_template[list_length];
}

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

BITSTRING_template& PDU__GMM__RoutingAreaUpdateComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
return single_value->field_messageType;
}

ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::receiveNPDUNumbers()
{
set_specific();
return single_value->field_receiveNPDUNumbers;
}

const ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::receiveNPDUNumbers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field receiveNPDUNumbers of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
return single_value->field_receiveNPDUNumbers;
}

InterRATInformationContainerTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::interRATHandoverInformation()
{
set_specific();
return single_value->field_interRATHandoverInformation;
}

const InterRATInformationContainerTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::interRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
return single_value->field_interRATHandoverInformation;
}

EUTRANinterRATInformationContainerTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::eUTRANinterRATHandoverInformation()
{
set_specific();
return single_value->field_eUTRANinterRATHandoverInformation;
}

const EUTRANinterRATInformationContainerTLV_template& PDU__GMM__RoutingAreaUpdateComplete_template::eUTRANinterRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANinterRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
return single_value->field_eUTRANinterRATHandoverInformation;
}

int PDU__GMM__RoutingAreaUpdateComplete_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_receiveNPDUNumbers.is_present()) ret_val++;
      if (single_value->field_interRATHandoverInformation.is_present()) ret_val++;
      if (single_value->field_eUTRANinterRATHandoverInformation.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.PDU_GMM_RoutingAreaUpdateComplete 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.PDU_GMM_RoutingAreaUpdateComplete 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.PDU_GMM_RoutingAreaUpdateComplete containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateComplete_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__RoutingAreaUpdateComplete_template::log_match(const PDU__GMM__RoutingAreaUpdateComplete& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.receiveNPDUNumbers().ispresent()){
if(!single_value->field_receiveNPDUNumbers.match(match_value.receiveNPDUNumbers(), legacy)){
TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers");
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_receiveNPDUNumbers.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.interRATHandoverInformation().ispresent()){
if(!single_value->field_interRATHandoverInformation.match(match_value.interRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".interRATHandoverInformation");
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_interRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".interRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eUTRANinterRATHandoverInformation().ispresent()){
if(!single_value->field_eUTRANinterRATHandoverInformation.match(match_value.eUTRANinterRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation");
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eUTRANinterRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eUTRANinterRATHandoverInformation.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
if (match_value.receiveNPDUNumbers().ispresent()) {
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_receiveNPDUNumbers.log();
if (single_value->field_receiveNPDUNumbers.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
if (match_value.interRATHandoverInformation().ispresent()) {
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_interRATHandoverInformation.log();
if (single_value->field_interRATHandoverInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
if (match_value.eUTRANinterRATHandoverInformation().ispresent()) {
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eUTRANinterRATHandoverInformation.log();
if (single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__RoutingAreaUpdateComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_receiveNPDUNumbers.encode_text(text_buf);
single_value->field_interRATHandoverInformation.encode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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.PDU_GMM_RoutingAreaUpdateComplete.");
}
}

void PDU__GMM__RoutingAreaUpdateComplete_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_messageType.decode_text(text_buf);
single_value->field_receiveNPDUNumbers.decode_text(text_buf);
single_value->field_interRATHandoverInformation.decode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__RoutingAreaUpdateComplete_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.PDU_GMM_RoutingAreaUpdateComplete.");
}
}

void PDU__GMM__RoutingAreaUpdateComplete_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: {
    PDU__GMM__RoutingAreaUpdateComplete_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.PDU_GMM_RoutingAreaUpdateComplete 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInformation().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInformation().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInformation().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.PDU_GMM_RoutingAreaUpdateComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateComplete_template* precondition = new PDU__GMM__RoutingAreaUpdateComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateComplete_template* implied_template = new PDU__GMM__RoutingAreaUpdateComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateComplete_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
single_value->field_receiveNPDUNumbers.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
single_value->field_interRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
single_value->field_eUTRANinterRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateComplete");
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.PDU_GMM_RoutingAreaUpdateComplete");
}

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

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

PDU__GMM__RoutingAreaUpdateReject::PDU__GMM__RoutingAreaUpdateReject()
{
}

PDU__GMM__RoutingAreaUpdateReject::PDU__GMM__RoutingAreaUpdateReject(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const ForceToStandbyV& par_forceToStandby,
    const BITSTRING& par_spare,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< GPRSTimer2TLV >& par_t3346)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_forceToStandby(par_forceToStandby),
  field_spare(par_spare),
  field_t3302(par_t3302),
  field_t3346(par_t3346)
{
}

PDU__GMM__RoutingAreaUpdateReject::PDU__GMM__RoutingAreaUpdateReject(const PDU__GMM__RoutingAreaUpdateReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
else field_t3346.clean_up();
}

void PDU__GMM__RoutingAreaUpdateReject::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_forceToStandby.clean_up();
field_spare.clean_up();
field_t3302.clean_up();
field_t3346.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateReject::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateReject_descr_; }
PDU__GMM__RoutingAreaUpdateReject& PDU__GMM__RoutingAreaUpdateReject::operator=(const PDU__GMM__RoutingAreaUpdateReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
  else field_t3346.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateReject::operator==(const PDU__GMM__RoutingAreaUpdateReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_forceToStandby==other_value.field_forceToStandby
  && field_spare==other_value.field_spare
  && field_t3302==other_value.field_t3302
  && field_t3346==other_value.field_t3346;
}

boolean PDU__GMM__RoutingAreaUpdateReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateReject::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && field_forceToStandby.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_value());
}
int PDU__GMM__RoutingAreaUpdateReject::size_of() const
{
  int ret_val = 4;
  if (field_t3302.ispresent()) ret_val++;
  if (field_t3346.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
field_t3346.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!t3346().is_bound()) t3346() = OMIT_VALUE;
else t3346().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateReject::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.PDU_GMM_RoutingAreaUpdateReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_RoutingAreaUpdateReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
  }
}

void PDU__GMM__RoutingAreaUpdateReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_t3346.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_t3346.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateReject::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 PDU__GMM__RoutingAreaUpdateReject::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 PDU__GMM__RoutingAreaUpdateReject::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_messageType.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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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_spare.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 (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_t3346 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3346().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_t3346 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35){
  field_t3346=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_t3346=OMIT_VALUE;
  if (field_messageType !=  bs_43) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__RoutingAreaUpdateReject::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_t3346.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_t3346.ispresent()) {
  encoded_length += field_t3346().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3346.ispresent() && (!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_35.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);
  }
  }
  if (field_messageType !=  bs_43) {
  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_43.RAW_encode(General__Types::BIT8_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 PDU__GMM__RoutingAreaUpdateReject_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
ForceToStandbyV_template field_forceToStandby;
BITSTRING_template field_spare;
GPRSTimer2TLV_template field_t3302;
GPRSTimer2TLV_template field_t3346;
};

void PDU__GMM__RoutingAreaUpdateReject_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_t3346 = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateReject_template::copy_value(const PDU__GMM__RoutingAreaUpdateReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.t3346().is_bound()) {
  if (other_value.t3346().ispresent()) single_value->field_t3346 = other_value.t3346()();
  else single_value->field_t3346 = OMIT_VALUE;
} else {
  single_value->field_t3346.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateReject_template::copy_template(const PDU__GMM__RoutingAreaUpdateReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3346().get_selection()) {
single_value->field_t3346 = other_value.t3346();
} else {
single_value->field_t3346.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 PDU__GMM__RoutingAreaUpdateReject_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 PDU__GMM__RoutingAreaUpdateReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateReject_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.PDU_GMM_RoutingAreaUpdateReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateReject_template::PDU__GMM__RoutingAreaUpdateReject_template()
{
}

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

PDU__GMM__RoutingAreaUpdateReject_template::PDU__GMM__RoutingAreaUpdateReject_template(const PDU__GMM__RoutingAreaUpdateReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__RoutingAreaUpdateReject_template::match(const PDU__GMM__RoutingAreaUpdateReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.t3346().is_bound()) return FALSE;
if((other_value.t3346().ispresent() ? !single_value->field_t3346.match((const GPRSTimer2TLV&)other_value.t3346(), legacy) : !single_value->field_t3346.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.PDU_GMM_RoutingAreaUpdateReject.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_t3346.is_omit() || single_value->field_t3346.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_t3346.is_omit() || single_value->field_t3346.is_value());
}

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

PDU__GMM__RoutingAreaUpdateReject PDU__GMM__RoutingAreaUpdateReject_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.PDU_GMM_RoutingAreaUpdateReject.");
PDU__GMM__RoutingAreaUpdateReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_t3346.is_omit()) ret_val.t3346() = OMIT_VALUE;
else if (single_value->field_t3346.is_bound()) {
ret_val.t3346() = single_value->field_t3346.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateReject_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.PDU_GMM_RoutingAreaUpdateReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateReject_template[list_length];
}

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

BITSTRING_template& PDU__GMM__RoutingAreaUpdateReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__RoutingAreaUpdateReject_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__RoutingAreaUpdateReject_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_gmmCause;
}

ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateReject_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateReject_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_forceToStandby;
}

BITSTRING_template& PDU__GMM__RoutingAreaUpdateReject_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateReject_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_spare;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateReject_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateReject_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_t3302;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateReject_template::t3346()
{
set_specific();
return single_value->field_t3346;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateReject_template::t3346() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3346 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
return single_value->field_t3346;
}

int PDU__GMM__RoutingAreaUpdateReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_t3346.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.PDU_GMM_RoutingAreaUpdateReject 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.PDU_GMM_RoutingAreaUpdateReject 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.PDU_GMM_RoutingAreaUpdateReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
single_value->field_t3346.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 PDU__GMM__RoutingAreaUpdateReject_template::log_match(const PDU__GMM__RoutingAreaUpdateReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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);
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3346().ispresent()){
if(!single_value->field_t3346.match(match_value.t3346(), legacy)){
TTCN_Logger::log_logmatch_info(".t3346");
single_value->field_t3346.log_match(match_value.t3346(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3346.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3346 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3346.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3346 := ");
if (match_value.t3346().ispresent()) {
single_value->field_t3346.log_match(match_value.t3346(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3346.log();
if (single_value->field_t3346.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 PDU__GMM__RoutingAreaUpdateReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_t3346.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.PDU_GMM_RoutingAreaUpdateReject.");
}
}

void PDU__GMM__RoutingAreaUpdateReject_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_t3346.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 PDU__GMM__RoutingAreaUpdateReject_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.PDU_GMM_RoutingAreaUpdateReject.");
}
}

void PDU__GMM__RoutingAreaUpdateReject_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: {
    PDU__GMM__RoutingAreaUpdateReject_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.PDU_GMM_RoutingAreaUpdateReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_RoutingAreaUpdateReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateReject_template* precondition = new PDU__GMM__RoutingAreaUpdateReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateReject_template* implied_template = new PDU__GMM__RoutingAreaUpdateReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
single_value->field_t3346.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateReject");
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.PDU_GMM_RoutingAreaUpdateReject");
}

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

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

PDU__GMM__GMM__Status::PDU__GMM__GMM__Status()
{
}

PDU__GMM__GMM__Status::PDU__GMM__GMM__Status(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause)
{
}

PDU__GMM__GMM__Status::PDU__GMM__GMM__Status(const PDU__GMM__GMM__Status& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
}

void PDU__GMM__GMM__Status::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__GMM__Status::get_descriptor() const { return &PDU__GMM__GMM__Status_descr_; }
PDU__GMM__GMM__Status& PDU__GMM__GMM__Status::operator=(const PDU__GMM__GMM__Status& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
}
return *this;
}

boolean PDU__GMM__GMM__Status::operator==(const PDU__GMM__GMM__Status& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause;
}

boolean PDU__GMM__GMM__Status::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound());
}
boolean PDU__GMM__GMM__Status::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value();
}
void PDU__GMM__GMM__Status::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__GMM__Status::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
}

void PDU__GMM__GMM__Status::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.PDU_GMM_GMM_Status 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().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.PDU_GMM_GMM_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status");
  }
}

void PDU__GMM__GMM__Status::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
}

void PDU__GMM__GMM__Status::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
}

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

int PDU__GMM__GMM__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* 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_messageType.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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.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_messageType !=  bs_44) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__GMM__Status::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_messageType !=  bs_44) {
  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_44.RAW_encode(General__Types::BIT8_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 PDU__GMM__GMM__Status_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
};

void PDU__GMM__GMM__Status_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
}
}
}

void PDU__GMM__GMM__Status_template::copy_value(const PDU__GMM__GMM__Status& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__GMM__Status_template::copy_template(const PDU__GMM__GMM__Status_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.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 PDU__GMM__GMM__Status_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__GMM__GMM__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__GMM__Status_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
break;
}
set_selection(other_value);
}

PDU__GMM__GMM__Status_template::PDU__GMM__GMM__Status_template()
{
}

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

PDU__GMM__GMM__Status_template::PDU__GMM__GMM__Status_template(const PDU__GMM__GMM__Status& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__GMM__Status_template& PDU__GMM__GMM__Status_template::operator=(const OPTIONAL<PDU__GMM__GMM__Status>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__GMM__Status&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
}
return *this;
}

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

boolean PDU__GMM__GMM__Status_template::match(const PDU__GMM__GMM__Status& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), 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.PDU_GMM_GMM_Status.");
}
return FALSE;
}

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

boolean PDU__GMM__GMM__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value();
}

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

PDU__GMM__GMM__Status PDU__GMM__GMM__Status_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
PDU__GMM__GMM__Status ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
return ret_val;
}

void PDU__GMM__GMM__Status_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.PDU_GMM_GMM_Status.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__GMM__Status_template[list_length];
}

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

BITSTRING_template& PDU__GMM__GMM__Status_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__GMM__Status_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__GMM__Status_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__GMM__Status_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status.");
return single_value->field_gmmCause;
}

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

void PDU__GMM__GMM__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.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 PDU__GMM__GMM__Status_template::log_match(const PDU__GMM__GMM__Status& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), 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 PDU__GMM__GMM__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.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.PDU_GMM_GMM_Status.");
}
}

void PDU__GMM__GMM__Status_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.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 PDU__GMM__GMM__Status_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].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.PDU_GMM_GMM_Status.");
}
}

void PDU__GMM__GMM__Status_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: {
    PDU__GMM__GMM__Status_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.PDU_GMM_GMM_Status 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().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.PDU_GMM_GMM_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__GMM__Status_template* precondition = new PDU__GMM__GMM__Status_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__GMM__Status_template* implied_template = new PDU__GMM__GMM__Status_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__GMM__Status_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__GMM__Status_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Status");
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.PDU_GMM_GMM_Status");
}

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

boolean PDU__GMM__GMM__Status_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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;
}

PDU__GMM__GMM__Information::PDU__GMM__GMM__Information()
{
}

PDU__GMM__GMM__Information::PDU__GMM__GMM__Information(const BITSTRING& par_messageType,
    const OPTIONAL< MobileL3__MM__Types::NetworkNameTLV >& par_fullNetworkName,
    const OPTIONAL< MobileL3__MM__Types::NetworkNameTLV >& par_shortNetworkName,
    const OPTIONAL< MobileL3__MM__Types::TimeZoneTV >& par_networkTimeZone,
    const OPTIONAL< MobileL3__MM__Types::TimeZoneAndTimeTV >& par_networkTimeAndTimeZone,
    const OPTIONAL< MobileL3__MM__Types::LSA__IdentifierTLV >& par_lsaIdentity,
    const OPTIONAL< MobileL3__MM__Types::DaylightSavingTimeTLV >& par_networkDaylightSavingTime)
  :   field_messageType(par_messageType),
  field_fullNetworkName(par_fullNetworkName),
  field_shortNetworkName(par_shortNetworkName),
  field_networkTimeZone(par_networkTimeZone),
  field_networkTimeAndTimeZone(par_networkTimeAndTimeZone),
  field_lsaIdentity(par_lsaIdentity),
  field_networkDaylightSavingTime(par_networkDaylightSavingTime)
{
}

PDU__GMM__GMM__Information::PDU__GMM__GMM__Information(const PDU__GMM__GMM__Information& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.fullNetworkName().is_bound()) field_fullNetworkName = other_value.fullNetworkName();
else field_fullNetworkName.clean_up();
if (other_value.shortNetworkName().is_bound()) field_shortNetworkName = other_value.shortNetworkName();
else field_shortNetworkName.clean_up();
if (other_value.networkTimeZone().is_bound()) field_networkTimeZone = other_value.networkTimeZone();
else field_networkTimeZone.clean_up();
if (other_value.networkTimeAndTimeZone().is_bound()) field_networkTimeAndTimeZone = other_value.networkTimeAndTimeZone();
else field_networkTimeAndTimeZone.clean_up();
if (other_value.lsaIdentity().is_bound()) field_lsaIdentity = other_value.lsaIdentity();
else field_lsaIdentity.clean_up();
if (other_value.networkDaylightSavingTime().is_bound()) field_networkDaylightSavingTime = other_value.networkDaylightSavingTime();
else field_networkDaylightSavingTime.clean_up();
}

void PDU__GMM__GMM__Information::clean_up()
{
field_messageType.clean_up();
field_fullNetworkName.clean_up();
field_shortNetworkName.clean_up();
field_networkTimeZone.clean_up();
field_networkTimeAndTimeZone.clean_up();
field_lsaIdentity.clean_up();
field_networkDaylightSavingTime.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__GMM__Information::get_descriptor() const { return &PDU__GMM__GMM__Information_descr_; }
PDU__GMM__GMM__Information& PDU__GMM__GMM__Information::operator=(const PDU__GMM__GMM__Information& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.fullNetworkName().is_bound()) field_fullNetworkName = other_value.fullNetworkName();
  else field_fullNetworkName.clean_up();
  if (other_value.shortNetworkName().is_bound()) field_shortNetworkName = other_value.shortNetworkName();
  else field_shortNetworkName.clean_up();
  if (other_value.networkTimeZone().is_bound()) field_networkTimeZone = other_value.networkTimeZone();
  else field_networkTimeZone.clean_up();
  if (other_value.networkTimeAndTimeZone().is_bound()) field_networkTimeAndTimeZone = other_value.networkTimeAndTimeZone();
  else field_networkTimeAndTimeZone.clean_up();
  if (other_value.lsaIdentity().is_bound()) field_lsaIdentity = other_value.lsaIdentity();
  else field_lsaIdentity.clean_up();
  if (other_value.networkDaylightSavingTime().is_bound()) field_networkDaylightSavingTime = other_value.networkDaylightSavingTime();
  else field_networkDaylightSavingTime.clean_up();
}
return *this;
}

boolean PDU__GMM__GMM__Information::operator==(const PDU__GMM__GMM__Information& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_fullNetworkName==other_value.field_fullNetworkName
  && field_shortNetworkName==other_value.field_shortNetworkName
  && field_networkTimeZone==other_value.field_networkTimeZone
  && field_networkTimeAndTimeZone==other_value.field_networkTimeAndTimeZone
  && field_lsaIdentity==other_value.field_lsaIdentity
  && field_networkDaylightSavingTime==other_value.field_networkDaylightSavingTime;
}

boolean PDU__GMM__GMM__Information::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_fullNetworkName.get_selection() || field_fullNetworkName.is_bound())
  || (OPTIONAL_OMIT == field_shortNetworkName.get_selection() || field_shortNetworkName.is_bound())
  || (OPTIONAL_OMIT == field_networkTimeZone.get_selection() || field_networkTimeZone.is_bound())
  || (OPTIONAL_OMIT == field_networkTimeAndTimeZone.get_selection() || field_networkTimeAndTimeZone.is_bound())
  || (OPTIONAL_OMIT == field_lsaIdentity.get_selection() || field_lsaIdentity.is_bound())
  || (OPTIONAL_OMIT == field_networkDaylightSavingTime.get_selection() || field_networkDaylightSavingTime.is_bound());
}
boolean PDU__GMM__GMM__Information::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_fullNetworkName.get_selection() || field_fullNetworkName.is_value())
  && (OPTIONAL_OMIT == field_shortNetworkName.get_selection() || field_shortNetworkName.is_value())
  && (OPTIONAL_OMIT == field_networkTimeZone.get_selection() || field_networkTimeZone.is_value())
  && (OPTIONAL_OMIT == field_networkTimeAndTimeZone.get_selection() || field_networkTimeAndTimeZone.is_value())
  && (OPTIONAL_OMIT == field_lsaIdentity.get_selection() || field_lsaIdentity.is_value())
  && (OPTIONAL_OMIT == field_networkDaylightSavingTime.get_selection() || field_networkDaylightSavingTime.is_value());
}
int PDU__GMM__GMM__Information::size_of() const
{
  int ret_val = 1;
  if (field_fullNetworkName.ispresent()) ret_val++;
  if (field_shortNetworkName.ispresent()) ret_val++;
  if (field_networkTimeZone.ispresent()) ret_val++;
  if (field_networkTimeAndTimeZone.ispresent()) ret_val++;
  if (field_lsaIdentity.ispresent()) ret_val++;
  if (field_networkDaylightSavingTime.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__GMM__Information::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", fullNetworkName := ");
field_fullNetworkName.log();
TTCN_Logger::log_event_str(", shortNetworkName := ");
field_shortNetworkName.log();
TTCN_Logger::log_event_str(", networkTimeZone := ");
field_networkTimeZone.log();
TTCN_Logger::log_event_str(", networkTimeAndTimeZone := ");
field_networkTimeAndTimeZone.log();
TTCN_Logger::log_event_str(", lsaIdentity := ");
field_lsaIdentity.log();
TTCN_Logger::log_event_str(", networkDaylightSavingTime := ");
field_networkDaylightSavingTime.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__GMM__Information::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!fullNetworkName().is_bound()) fullNetworkName() = OMIT_VALUE;
else fullNetworkName().set_implicit_omit();
if (!shortNetworkName().is_bound()) shortNetworkName() = OMIT_VALUE;
else shortNetworkName().set_implicit_omit();
if (!networkTimeZone().is_bound()) networkTimeZone() = OMIT_VALUE;
else networkTimeZone().set_implicit_omit();
if (!networkTimeAndTimeZone().is_bound()) networkTimeAndTimeZone() = OMIT_VALUE;
else networkTimeAndTimeZone().set_implicit_omit();
if (!lsaIdentity().is_bound()) lsaIdentity() = OMIT_VALUE;
else lsaIdentity().set_implicit_omit();
if (!networkDaylightSavingTime().is_bound()) networkDaylightSavingTime() = OMIT_VALUE;
else networkDaylightSavingTime().set_implicit_omit();
}

void PDU__GMM__GMM__Information::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.PDU_GMM_GMM_Information 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fullNetworkName().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) shortNetworkName().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) networkTimeZone().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) networkTimeAndTimeZone().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lsaIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) networkDaylightSavingTime().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fullNetworkName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fullNetworkName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "shortNetworkName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          shortNetworkName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkTimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkTimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkTimeAndTimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkTimeAndTimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lsaIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lsaIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkDaylightSavingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkDaylightSavingTime().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.PDU_GMM_GMM_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
  }
}

void PDU__GMM__GMM__Information::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_fullNetworkName.encode_text(text_buf);
field_shortNetworkName.encode_text(text_buf);
field_networkTimeZone.encode_text(text_buf);
field_networkTimeAndTimeZone.encode_text(text_buf);
field_lsaIdentity.encode_text(text_buf);
field_networkDaylightSavingTime.encode_text(text_buf);
}

void PDU__GMM__GMM__Information::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_fullNetworkName.decode_text(text_buf);
field_shortNetworkName.decode_text(text_buf);
field_networkTimeZone.decode_text(text_buf);
field_networkTimeAndTimeZone.decode_text(text_buf);
field_lsaIdentity.decode_text(text_buf);
field_networkDaylightSavingTime.decode_text(text_buf);
}

void PDU__GMM__GMM__Information::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 PDU__GMM__GMM__Information::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 PDU__GMM__GMM__Information::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_messageType.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_fullNetworkName = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, MobileL3__MM__Types::NetworkNameTLV_descr_.raw->forceomit);
  decoded_field_length = field_fullNetworkName().RAW_decode(MobileL3__MM__Types::NetworkNameTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_fullNetworkName = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_fullNetworkName.ispresent() || field_fullNetworkName().elementIdentifier() !=  bs_46){
  field_fullNetworkName=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_fullNetworkName=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_shortNetworkName = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__MM__Types::NetworkNameTLV_descr_.raw->forceomit);
  decoded_field_length = field_shortNetworkName().RAW_decode(MobileL3__MM__Types::NetworkNameTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_shortNetworkName = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_shortNetworkName.ispresent() || field_shortNetworkName().elementIdentifier() !=  bs_47){
  field_shortNetworkName=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_shortNetworkName=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_networkTimeZone = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__MM__Types::TimeZoneTV_descr_.raw->forceomit);
  decoded_field_length = field_networkTimeZone().RAW_decode(MobileL3__MM__Types::TimeZoneTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_networkTimeZone = 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_networkTimeZone=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_networkTimeAndTimeZone = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__MM__Types::TimeZoneAndTimeTV_descr_.raw->forceomit);
  decoded_field_length = field_networkTimeAndTimeZone().RAW_decode(MobileL3__MM__Types::TimeZoneAndTimeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_networkTimeAndTimeZone = 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_networkTimeAndTimeZone=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_lsaIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__MM__Types::LSA__IdentifierTLV_descr_.raw->forceomit);
  decoded_field_length = field_lsaIdentity().RAW_decode(MobileL3__MM__Types::LSA__IdentifierTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_lsaIdentity = 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_lsaIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_networkDaylightSavingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__MM__Types::DaylightSavingTimeTLV_descr_.raw->forceomit);
  decoded_field_length = field_networkDaylightSavingTime().RAW_decode(MobileL3__MM__Types::DaylightSavingTimeTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_networkDaylightSavingTime = 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_networkDaylightSavingTime=OMIT_VALUE;
  if (field_messageType !=  bs_45) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__GMM__Information::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::BIT8_descr_.raw);
  if (field_fullNetworkName.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__MM__Types::NetworkNameTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_shortNetworkName.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__MM__Types::NetworkNameTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_networkTimeZone.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__MM__Types::TimeZoneTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_networkTimeAndTimeZone.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__MM__Types::TimeZoneAndTimeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_lsaIdentity.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__MM__Types::LSA__IdentifierTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_networkDaylightSavingTime.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__MM__Types::DaylightSavingTimeTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_fullNetworkName.ispresent()) {
  encoded_length += field_fullNetworkName().RAW_encode(MobileL3__MM__Types::NetworkNameTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_shortNetworkName.ispresent()) {
  encoded_length += field_shortNetworkName().RAW_encode(MobileL3__MM__Types::NetworkNameTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_networkTimeZone.ispresent()) {
  encoded_length += field_networkTimeZone().RAW_encode(MobileL3__MM__Types::TimeZoneTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_networkTimeAndTimeZone.ispresent()) {
  encoded_length += field_networkTimeAndTimeZone().RAW_encode(MobileL3__MM__Types::TimeZoneAndTimeTV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_lsaIdentity.ispresent()) {
  encoded_length += field_lsaIdentity().RAW_encode(MobileL3__MM__Types::LSA__IdentifierTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_networkDaylightSavingTime.ispresent()) {
  encoded_length += field_networkDaylightSavingTime().RAW_encode(MobileL3__MM__Types::DaylightSavingTimeTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_fullNetworkName.ispresent() && (!field_fullNetworkName.ispresent() || field_fullNetworkName().elementIdentifier() !=  bs_46)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_46.RAW_encode(General__Types::BIT7_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_shortNetworkName.ispresent() && (!field_shortNetworkName.ispresent() || field_shortNetworkName().elementIdentifier() !=  bs_47)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_47.RAW_encode(General__Types::BIT7_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_messageType !=  bs_45) {
  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_45.RAW_encode(General__Types::BIT8_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 PDU__GMM__GMM__Information_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__MM__Types::NetworkNameTLV_template field_fullNetworkName;
MobileL3__MM__Types::NetworkNameTLV_template field_shortNetworkName;
MobileL3__MM__Types::TimeZoneTV_template field_networkTimeZone;
MobileL3__MM__Types::TimeZoneAndTimeTV_template field_networkTimeAndTimeZone;
MobileL3__MM__Types::LSA__IdentifierTLV_template field_lsaIdentity;
MobileL3__MM__Types::DaylightSavingTimeTLV_template field_networkDaylightSavingTime;
};

void PDU__GMM__GMM__Information_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_messageType = ANY_VALUE;
single_value->field_fullNetworkName = ANY_OR_OMIT;
single_value->field_shortNetworkName = ANY_OR_OMIT;
single_value->field_networkTimeZone = ANY_OR_OMIT;
single_value->field_networkTimeAndTimeZone = ANY_OR_OMIT;
single_value->field_lsaIdentity = ANY_OR_OMIT;
single_value->field_networkDaylightSavingTime = ANY_OR_OMIT;
}
}
}

void PDU__GMM__GMM__Information_template::copy_value(const PDU__GMM__GMM__Information& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.fullNetworkName().is_bound()) {
  if (other_value.fullNetworkName().ispresent()) single_value->field_fullNetworkName = other_value.fullNetworkName()();
  else single_value->field_fullNetworkName = OMIT_VALUE;
} else {
  single_value->field_fullNetworkName.clean_up();
}
if (other_value.shortNetworkName().is_bound()) {
  if (other_value.shortNetworkName().ispresent()) single_value->field_shortNetworkName = other_value.shortNetworkName()();
  else single_value->field_shortNetworkName = OMIT_VALUE;
} else {
  single_value->field_shortNetworkName.clean_up();
}
if (other_value.networkTimeZone().is_bound()) {
  if (other_value.networkTimeZone().ispresent()) single_value->field_networkTimeZone = other_value.networkTimeZone()();
  else single_value->field_networkTimeZone = OMIT_VALUE;
} else {
  single_value->field_networkTimeZone.clean_up();
}
if (other_value.networkTimeAndTimeZone().is_bound()) {
  if (other_value.networkTimeAndTimeZone().ispresent()) single_value->field_networkTimeAndTimeZone = other_value.networkTimeAndTimeZone()();
  else single_value->field_networkTimeAndTimeZone = OMIT_VALUE;
} else {
  single_value->field_networkTimeAndTimeZone.clean_up();
}
if (other_value.lsaIdentity().is_bound()) {
  if (other_value.lsaIdentity().ispresent()) single_value->field_lsaIdentity = other_value.lsaIdentity()();
  else single_value->field_lsaIdentity = OMIT_VALUE;
} else {
  single_value->field_lsaIdentity.clean_up();
}
if (other_value.networkDaylightSavingTime().is_bound()) {
  if (other_value.networkDaylightSavingTime().ispresent()) single_value->field_networkDaylightSavingTime = other_value.networkDaylightSavingTime()();
  else single_value->field_networkDaylightSavingTime = OMIT_VALUE;
} else {
  single_value->field_networkDaylightSavingTime.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__GMM__Information_template::copy_template(const PDU__GMM__GMM__Information_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fullNetworkName().get_selection()) {
single_value->field_fullNetworkName = other_value.fullNetworkName();
} else {
single_value->field_fullNetworkName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.shortNetworkName().get_selection()) {
single_value->field_shortNetworkName = other_value.shortNetworkName();
} else {
single_value->field_shortNetworkName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkTimeZone().get_selection()) {
single_value->field_networkTimeZone = other_value.networkTimeZone();
} else {
single_value->field_networkTimeZone.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkTimeAndTimeZone().get_selection()) {
single_value->field_networkTimeAndTimeZone = other_value.networkTimeAndTimeZone();
} else {
single_value->field_networkTimeAndTimeZone.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lsaIdentity().get_selection()) {
single_value->field_lsaIdentity = other_value.lsaIdentity();
} else {
single_value->field_lsaIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkDaylightSavingTime().get_selection()) {
single_value->field_networkDaylightSavingTime = other_value.networkDaylightSavingTime();
} else {
single_value->field_networkDaylightSavingTime.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 PDU__GMM__GMM__Information_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 PDU__GMM__GMM__Information_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__GMM__Information_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.PDU_GMM_GMM_Information.");
break;
}
set_selection(other_value);
}

PDU__GMM__GMM__Information_template::PDU__GMM__GMM__Information_template()
{
}

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

PDU__GMM__GMM__Information_template::PDU__GMM__GMM__Information_template(const PDU__GMM__GMM__Information& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__GMM__Information_template::match(const PDU__GMM__GMM__Information& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.fullNetworkName().is_bound()) return FALSE;
if((other_value.fullNetworkName().ispresent() ? !single_value->field_fullNetworkName.match((const MobileL3__MM__Types::NetworkNameTLV&)other_value.fullNetworkName(), legacy) : !single_value->field_fullNetworkName.match_omit(legacy)))return FALSE;
if(!other_value.shortNetworkName().is_bound()) return FALSE;
if((other_value.shortNetworkName().ispresent() ? !single_value->field_shortNetworkName.match((const MobileL3__MM__Types::NetworkNameTLV&)other_value.shortNetworkName(), legacy) : !single_value->field_shortNetworkName.match_omit(legacy)))return FALSE;
if(!other_value.networkTimeZone().is_bound()) return FALSE;
if((other_value.networkTimeZone().ispresent() ? !single_value->field_networkTimeZone.match((const MobileL3__MM__Types::TimeZoneTV&)other_value.networkTimeZone(), legacy) : !single_value->field_networkTimeZone.match_omit(legacy)))return FALSE;
if(!other_value.networkTimeAndTimeZone().is_bound()) return FALSE;
if((other_value.networkTimeAndTimeZone().ispresent() ? !single_value->field_networkTimeAndTimeZone.match((const MobileL3__MM__Types::TimeZoneAndTimeTV&)other_value.networkTimeAndTimeZone(), legacy) : !single_value->field_networkTimeAndTimeZone.match_omit(legacy)))return FALSE;
if(!other_value.lsaIdentity().is_bound()) return FALSE;
if((other_value.lsaIdentity().ispresent() ? !single_value->field_lsaIdentity.match((const MobileL3__MM__Types::LSA__IdentifierTLV&)other_value.lsaIdentity(), legacy) : !single_value->field_lsaIdentity.match_omit(legacy)))return FALSE;
if(!other_value.networkDaylightSavingTime().is_bound()) return FALSE;
if((other_value.networkDaylightSavingTime().ispresent() ? !single_value->field_networkDaylightSavingTime.match((const MobileL3__MM__Types::DaylightSavingTimeTLV&)other_value.networkDaylightSavingTime(), legacy) : !single_value->field_networkDaylightSavingTime.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.PDU_GMM_GMM_Information.");
}
return FALSE;
}

boolean PDU__GMM__GMM__Information_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_fullNetworkName.is_omit() || single_value->field_fullNetworkName.is_bound())
 || (single_value->field_shortNetworkName.is_omit() || single_value->field_shortNetworkName.is_bound())
 || (single_value->field_networkTimeZone.is_omit() || single_value->field_networkTimeZone.is_bound())
 || (single_value->field_networkTimeAndTimeZone.is_omit() || single_value->field_networkTimeAndTimeZone.is_bound())
 || (single_value->field_lsaIdentity.is_omit() || single_value->field_lsaIdentity.is_bound())
 || (single_value->field_networkDaylightSavingTime.is_omit() || single_value->field_networkDaylightSavingTime.is_bound());
}

boolean PDU__GMM__GMM__Information_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_fullNetworkName.is_omit() || single_value->field_fullNetworkName.is_value())
 && (single_value->field_shortNetworkName.is_omit() || single_value->field_shortNetworkName.is_value())
 && (single_value->field_networkTimeZone.is_omit() || single_value->field_networkTimeZone.is_value())
 && (single_value->field_networkTimeAndTimeZone.is_omit() || single_value->field_networkTimeAndTimeZone.is_value())
 && (single_value->field_lsaIdentity.is_omit() || single_value->field_lsaIdentity.is_value())
 && (single_value->field_networkDaylightSavingTime.is_omit() || single_value->field_networkDaylightSavingTime.is_value());
}

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

PDU__GMM__GMM__Information PDU__GMM__GMM__Information_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.PDU_GMM_GMM_Information.");
PDU__GMM__GMM__Information ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_fullNetworkName.is_omit()) ret_val.fullNetworkName() = OMIT_VALUE;
else if (single_value->field_fullNetworkName.is_bound()) {
ret_val.fullNetworkName() = single_value->field_fullNetworkName.valueof();
}
if (single_value->field_shortNetworkName.is_omit()) ret_val.shortNetworkName() = OMIT_VALUE;
else if (single_value->field_shortNetworkName.is_bound()) {
ret_val.shortNetworkName() = single_value->field_shortNetworkName.valueof();
}
if (single_value->field_networkTimeZone.is_omit()) ret_val.networkTimeZone() = OMIT_VALUE;
else if (single_value->field_networkTimeZone.is_bound()) {
ret_val.networkTimeZone() = single_value->field_networkTimeZone.valueof();
}
if (single_value->field_networkTimeAndTimeZone.is_omit()) ret_val.networkTimeAndTimeZone() = OMIT_VALUE;
else if (single_value->field_networkTimeAndTimeZone.is_bound()) {
ret_val.networkTimeAndTimeZone() = single_value->field_networkTimeAndTimeZone.valueof();
}
if (single_value->field_lsaIdentity.is_omit()) ret_val.lsaIdentity() = OMIT_VALUE;
else if (single_value->field_lsaIdentity.is_bound()) {
ret_val.lsaIdentity() = single_value->field_lsaIdentity.valueof();
}
if (single_value->field_networkDaylightSavingTime.is_omit()) ret_val.networkDaylightSavingTime() = OMIT_VALUE;
else if (single_value->field_networkDaylightSavingTime.is_bound()) {
ret_val.networkDaylightSavingTime() = single_value->field_networkDaylightSavingTime.valueof();
}
return ret_val;
}

void PDU__GMM__GMM__Information_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.PDU_GMM_GMM_Information.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__GMM__Information_template[list_length];
}

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

BITSTRING_template& PDU__GMM__GMM__Information_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__GMM__Information_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_messageType;
}

MobileL3__MM__Types::NetworkNameTLV_template& PDU__GMM__GMM__Information_template::fullNetworkName()
{
set_specific();
return single_value->field_fullNetworkName;
}

const MobileL3__MM__Types::NetworkNameTLV_template& PDU__GMM__GMM__Information_template::fullNetworkName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fullNetworkName of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_fullNetworkName;
}

MobileL3__MM__Types::NetworkNameTLV_template& PDU__GMM__GMM__Information_template::shortNetworkName()
{
set_specific();
return single_value->field_shortNetworkName;
}

const MobileL3__MM__Types::NetworkNameTLV_template& PDU__GMM__GMM__Information_template::shortNetworkName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field shortNetworkName of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_shortNetworkName;
}

MobileL3__MM__Types::TimeZoneTV_template& PDU__GMM__GMM__Information_template::networkTimeZone()
{
set_specific();
return single_value->field_networkTimeZone;
}

const MobileL3__MM__Types::TimeZoneTV_template& PDU__GMM__GMM__Information_template::networkTimeZone() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkTimeZone of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_networkTimeZone;
}

MobileL3__MM__Types::TimeZoneAndTimeTV_template& PDU__GMM__GMM__Information_template::networkTimeAndTimeZone()
{
set_specific();
return single_value->field_networkTimeAndTimeZone;
}

const MobileL3__MM__Types::TimeZoneAndTimeTV_template& PDU__GMM__GMM__Information_template::networkTimeAndTimeZone() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkTimeAndTimeZone of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_networkTimeAndTimeZone;
}

MobileL3__MM__Types::LSA__IdentifierTLV_template& PDU__GMM__GMM__Information_template::lsaIdentity()
{
set_specific();
return single_value->field_lsaIdentity;
}

const MobileL3__MM__Types::LSA__IdentifierTLV_template& PDU__GMM__GMM__Information_template::lsaIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lsaIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_lsaIdentity;
}

MobileL3__MM__Types::DaylightSavingTimeTLV_template& PDU__GMM__GMM__Information_template::networkDaylightSavingTime()
{
set_specific();
return single_value->field_networkDaylightSavingTime;
}

const MobileL3__MM__Types::DaylightSavingTimeTLV_template& PDU__GMM__GMM__Information_template::networkDaylightSavingTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkDaylightSavingTime of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
return single_value->field_networkDaylightSavingTime;
}

int PDU__GMM__GMM__Information_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_fullNetworkName.is_present()) ret_val++;
      if (single_value->field_shortNetworkName.is_present()) ret_val++;
      if (single_value->field_networkTimeZone.is_present()) ret_val++;
      if (single_value->field_networkTimeAndTimeZone.is_present()) ret_val++;
      if (single_value->field_lsaIdentity.is_present()) ret_val++;
      if (single_value->field_networkDaylightSavingTime.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.PDU_GMM_GMM_Information 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.PDU_GMM_GMM_Information 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.PDU_GMM_GMM_Information containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information.");
  }
  return 0;
}

void PDU__GMM__GMM__Information_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", fullNetworkName := ");
single_value->field_fullNetworkName.log();
TTCN_Logger::log_event_str(", shortNetworkName := ");
single_value->field_shortNetworkName.log();
TTCN_Logger::log_event_str(", networkTimeZone := ");
single_value->field_networkTimeZone.log();
TTCN_Logger::log_event_str(", networkTimeAndTimeZone := ");
single_value->field_networkTimeAndTimeZone.log();
TTCN_Logger::log_event_str(", lsaIdentity := ");
single_value->field_lsaIdentity.log();
TTCN_Logger::log_event_str(", networkDaylightSavingTime := ");
single_value->field_networkDaylightSavingTime.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 PDU__GMM__GMM__Information_template::log_match(const PDU__GMM__GMM__Information& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.fullNetworkName().ispresent()){
if(!single_value->field_fullNetworkName.match(match_value.fullNetworkName(), legacy)){
TTCN_Logger::log_logmatch_info(".fullNetworkName");
single_value->field_fullNetworkName.log_match(match_value.fullNetworkName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_fullNetworkName.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".fullNetworkName := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_fullNetworkName.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.shortNetworkName().ispresent()){
if(!single_value->field_shortNetworkName.match(match_value.shortNetworkName(), legacy)){
TTCN_Logger::log_logmatch_info(".shortNetworkName");
single_value->field_shortNetworkName.log_match(match_value.shortNetworkName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_shortNetworkName.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".shortNetworkName := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_shortNetworkName.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkTimeZone().ispresent()){
if(!single_value->field_networkTimeZone.match(match_value.networkTimeZone(), legacy)){
TTCN_Logger::log_logmatch_info(".networkTimeZone");
single_value->field_networkTimeZone.log_match(match_value.networkTimeZone(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkTimeZone.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkTimeZone := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkTimeZone.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkTimeAndTimeZone().ispresent()){
if(!single_value->field_networkTimeAndTimeZone.match(match_value.networkTimeAndTimeZone(), legacy)){
TTCN_Logger::log_logmatch_info(".networkTimeAndTimeZone");
single_value->field_networkTimeAndTimeZone.log_match(match_value.networkTimeAndTimeZone(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkTimeAndTimeZone.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkTimeAndTimeZone := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkTimeAndTimeZone.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lsaIdentity().ispresent()){
if(!single_value->field_lsaIdentity.match(match_value.lsaIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".lsaIdentity");
single_value->field_lsaIdentity.log_match(match_value.lsaIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lsaIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lsaIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lsaIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkDaylightSavingTime().ispresent()){
if(!single_value->field_networkDaylightSavingTime.match(match_value.networkDaylightSavingTime(), legacy)){
TTCN_Logger::log_logmatch_info(".networkDaylightSavingTime");
single_value->field_networkDaylightSavingTime.log_match(match_value.networkDaylightSavingTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkDaylightSavingTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkDaylightSavingTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkDaylightSavingTime.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", fullNetworkName := ");
if (match_value.fullNetworkName().ispresent()) {
single_value->field_fullNetworkName.log_match(match_value.fullNetworkName(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_fullNetworkName.log();
if (single_value->field_fullNetworkName.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", shortNetworkName := ");
if (match_value.shortNetworkName().ispresent()) {
single_value->field_shortNetworkName.log_match(match_value.shortNetworkName(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_shortNetworkName.log();
if (single_value->field_shortNetworkName.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkTimeZone := ");
if (match_value.networkTimeZone().ispresent()) {
single_value->field_networkTimeZone.log_match(match_value.networkTimeZone(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkTimeZone.log();
if (single_value->field_networkTimeZone.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkTimeAndTimeZone := ");
if (match_value.networkTimeAndTimeZone().ispresent()) {
single_value->field_networkTimeAndTimeZone.log_match(match_value.networkTimeAndTimeZone(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkTimeAndTimeZone.log();
if (single_value->field_networkTimeAndTimeZone.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lsaIdentity := ");
if (match_value.lsaIdentity().ispresent()) {
single_value->field_lsaIdentity.log_match(match_value.lsaIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lsaIdentity.log();
if (single_value->field_lsaIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkDaylightSavingTime := ");
if (match_value.networkDaylightSavingTime().ispresent()) {
single_value->field_networkDaylightSavingTime.log_match(match_value.networkDaylightSavingTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkDaylightSavingTime.log();
if (single_value->field_networkDaylightSavingTime.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 PDU__GMM__GMM__Information_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_fullNetworkName.encode_text(text_buf);
single_value->field_shortNetworkName.encode_text(text_buf);
single_value->field_networkTimeZone.encode_text(text_buf);
single_value->field_networkTimeAndTimeZone.encode_text(text_buf);
single_value->field_lsaIdentity.encode_text(text_buf);
single_value->field_networkDaylightSavingTime.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.PDU_GMM_GMM_Information.");
}
}

void PDU__GMM__GMM__Information_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_messageType.decode_text(text_buf);
single_value->field_fullNetworkName.decode_text(text_buf);
single_value->field_shortNetworkName.decode_text(text_buf);
single_value->field_networkTimeZone.decode_text(text_buf);
single_value->field_networkTimeAndTimeZone.decode_text(text_buf);
single_value->field_lsaIdentity.decode_text(text_buf);
single_value->field_networkDaylightSavingTime.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 PDU__GMM__GMM__Information_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.PDU_GMM_GMM_Information.");
}
}

void PDU__GMM__GMM__Information_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: {
    PDU__GMM__GMM__Information_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.PDU_GMM_GMM_Information 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fullNetworkName().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) shortNetworkName().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) networkTimeZone().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) networkTimeAndTimeZone().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lsaIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) networkDaylightSavingTime().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fullNetworkName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fullNetworkName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "shortNetworkName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          shortNetworkName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkTimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkTimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkTimeAndTimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkTimeAndTimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lsaIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lsaIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkDaylightSavingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkDaylightSavingTime().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.PDU_GMM_GMM_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__GMM__Information_template* precondition = new PDU__GMM__GMM__Information_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__GMM__Information_template* implied_template = new PDU__GMM__GMM__Information_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__GMM__Information_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__GMM__Information_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_fullNetworkName.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_shortNetworkName.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_networkTimeZone.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_networkTimeAndTimeZone.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_lsaIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
single_value->field_networkDaylightSavingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_GMM_Information");
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.PDU_GMM_GMM_Information");
}

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

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

PDU__GMM__ServiceRequest::PDU__GMM__ServiceRequest()
{
}

PDU__GMM__ServiceRequest::PDU__GMM__ServiceRequest(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySeqNum,
    const ServiceTypeV& par_serviceType,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_ptmsi,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus,
    const OPTIONAL< UplinkDataStatusTLV >& par_uplinkDataStatus,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties)
  :   field_messageType(par_messageType),
  field_cipheringKeySeqNum(par_cipheringKeySeqNum),
  field_serviceType(par_serviceType),
  field_ptmsi(par_ptmsi),
  field_pdpContextStatus(par_pdpContextStatus),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus),
  field_uplinkDataStatus(par_uplinkDataStatus),
  field_deviceProperties(par_deviceProperties)
{
}

PDU__GMM__ServiceRequest::PDU__GMM__ServiceRequest(const PDU__GMM__ServiceRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cipheringKeySeqNum().is_bound()) field_cipheringKeySeqNum = other_value.cipheringKeySeqNum();
else field_cipheringKeySeqNum.clean_up();
if (other_value.serviceType().is_bound()) field_serviceType = other_value.serviceType();
else field_serviceType.clean_up();
if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
else field_ptmsi.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
if (other_value.uplinkDataStatus().is_bound()) field_uplinkDataStatus = other_value.uplinkDataStatus();
else field_uplinkDataStatus.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
}

void PDU__GMM__ServiceRequest::clean_up()
{
field_messageType.clean_up();
field_cipheringKeySeqNum.clean_up();
field_serviceType.clean_up();
field_ptmsi.clean_up();
field_pdpContextStatus.clean_up();
field_mBMS__ContextStatus.clean_up();
field_uplinkDataStatus.clean_up();
field_deviceProperties.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__ServiceRequest::get_descriptor() const { return &PDU__GMM__ServiceRequest_descr_; }
PDU__GMM__ServiceRequest& PDU__GMM__ServiceRequest::operator=(const PDU__GMM__ServiceRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cipheringKeySeqNum().is_bound()) field_cipheringKeySeqNum = other_value.cipheringKeySeqNum();
  else field_cipheringKeySeqNum.clean_up();
  if (other_value.serviceType().is_bound()) field_serviceType = other_value.serviceType();
  else field_serviceType.clean_up();
  if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
  else field_ptmsi.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
  if (other_value.uplinkDataStatus().is_bound()) field_uplinkDataStatus = other_value.uplinkDataStatus();
  else field_uplinkDataStatus.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
}
return *this;
}

boolean PDU__GMM__ServiceRequest::operator==(const PDU__GMM__ServiceRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cipheringKeySeqNum==other_value.field_cipheringKeySeqNum
  && field_serviceType==other_value.field_serviceType
  && field_ptmsi==other_value.field_ptmsi
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus
  && field_uplinkDataStatus==other_value.field_uplinkDataStatus
  && field_deviceProperties==other_value.field_deviceProperties;
}

boolean PDU__GMM__ServiceRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cipheringKeySeqNum.is_bound())
  || (field_serviceType.is_bound())
  || (field_ptmsi.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_uplinkDataStatus.get_selection() || field_uplinkDataStatus.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound());
}
boolean PDU__GMM__ServiceRequest::is_value() const
{
return field_messageType.is_value()
  && field_cipheringKeySeqNum.is_value()
  && field_serviceType.is_value()
  && field_ptmsi.is_value()
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value())
  && (OPTIONAL_OMIT == field_uplinkDataStatus.get_selection() || field_uplinkDataStatus.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value());
}
int PDU__GMM__ServiceRequest::size_of() const
{
  int ret_val = 4;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  if (field_uplinkDataStatus.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__ServiceRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", cipheringKeySeqNum := ");
field_cipheringKeySeqNum.log();
TTCN_Logger::log_event_str(", serviceType := ");
field_serviceType.log();
TTCN_Logger::log_event_str(", ptmsi := ");
field_ptmsi.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uplinkDataStatus := ");
field_uplinkDataStatus.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__ServiceRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipheringKeySeqNum().is_bound()) cipheringKeySeqNum().set_implicit_omit();
if (serviceType().is_bound()) serviceType().set_implicit_omit();
if (ptmsi().is_bound()) ptmsi().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!uplinkDataStatus().is_bound()) uplinkDataStatus() = OMIT_VALUE;
else uplinkDataStatus().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
}

void PDU__GMM__ServiceRequest::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.PDU_GMM_ServiceRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySeqNum().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) serviceType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) uplinkDataStatus().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySeqNum")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySeqNum().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkDataStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkDataStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().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.PDU_GMM_ServiceRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
  }
}

void PDU__GMM__ServiceRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cipheringKeySeqNum.encode_text(text_buf);
field_serviceType.encode_text(text_buf);
field_ptmsi.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
field_uplinkDataStatus.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
}

void PDU__GMM__ServiceRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cipheringKeySeqNum.decode_text(text_buf);
field_serviceType.decode_text(text_buf);
field_ptmsi.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
field_uplinkDataStatus.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
}

void PDU__GMM__ServiceRequest::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 PDU__GMM__ServiceRequest::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 PDU__GMM__ServiceRequest::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_messageType.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, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySeqNum.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, ServiceTypeV_descr_.raw->forceomit);
  decoded_field_length = field_serviceType.RAW_decode(ServiceTypeV_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsi.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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 (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_uplinkDataStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, UplinkDataStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_uplinkDataStatus().RAW_decode(UplinkDataStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_uplinkDataStatus = 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_uplinkDataStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (field_messageType !=  bs_48) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__ServiceRequest::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ServiceTypeV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_uplinkDataStatus.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, UplinkDataStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cipheringKeySeqNum.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_serviceType.RAW_encode(ServiceTypeV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ptmsi.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[3]);
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_uplinkDataStatus.ispresent()) {
  encoded_length += field_uplinkDataStatus().RAW_encode(UplinkDataStatusTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.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);
  }
  }
  if (field_messageType !=  bs_48) {
  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_48.RAW_encode(General__Types::BIT8_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 PDU__GMM__ServiceRequest_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySeqNum;
ServiceTypeV_template field_serviceType;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_ptmsi;
PDPContextStatusTLV_template field_pdpContextStatus;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
UplinkDataStatusTLV_template field_uplinkDataStatus;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
};

void PDU__GMM__ServiceRequest_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_messageType = ANY_VALUE;
single_value->field_cipheringKeySeqNum = ANY_VALUE;
single_value->field_serviceType = ANY_VALUE;
single_value->field_ptmsi = ANY_VALUE;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
single_value->field_uplinkDataStatus = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
}
}
}

void PDU__GMM__ServiceRequest_template::copy_value(const PDU__GMM__ServiceRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.cipheringKeySeqNum().is_bound()) {
  single_value->field_cipheringKeySeqNum = other_value.cipheringKeySeqNum();
} else {
  single_value->field_cipheringKeySeqNum.clean_up();
}
if (other_value.serviceType().is_bound()) {
  single_value->field_serviceType = other_value.serviceType();
} else {
  single_value->field_serviceType.clean_up();
}
if (other_value.ptmsi().is_bound()) {
  single_value->field_ptmsi = other_value.ptmsi();
} else {
  single_value->field_ptmsi.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
if (other_value.uplinkDataStatus().is_bound()) {
  if (other_value.uplinkDataStatus().ispresent()) single_value->field_uplinkDataStatus = other_value.uplinkDataStatus()();
  else single_value->field_uplinkDataStatus = OMIT_VALUE;
} else {
  single_value->field_uplinkDataStatus.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__ServiceRequest_template::copy_template(const PDU__GMM__ServiceRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySeqNum().get_selection()) {
single_value->field_cipheringKeySeqNum = other_value.cipheringKeySeqNum();
} else {
single_value->field_cipheringKeySeqNum.clean_up();
}
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.ptmsi().get_selection()) {
single_value->field_ptmsi = other_value.ptmsi();
} else {
single_value->field_ptmsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uplinkDataStatus().get_selection()) {
single_value->field_uplinkDataStatus = other_value.uplinkDataStatus();
} else {
single_value->field_uplinkDataStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.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 PDU__GMM__ServiceRequest_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 PDU__GMM__ServiceRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__ServiceRequest_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.PDU_GMM_ServiceRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__ServiceRequest_template::PDU__GMM__ServiceRequest_template()
{
}

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

PDU__GMM__ServiceRequest_template::PDU__GMM__ServiceRequest_template(const PDU__GMM__ServiceRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__ServiceRequest_template::match(const PDU__GMM__ServiceRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.cipheringKeySeqNum().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySeqNum.match(other_value.cipheringKeySeqNum(), legacy))return FALSE;
if(!other_value.serviceType().is_bound()) return FALSE;
if(!single_value->field_serviceType.match(other_value.serviceType(), legacy))return FALSE;
if(!other_value.ptmsi().is_bound()) return FALSE;
if(!single_value->field_ptmsi.match(other_value.ptmsi(), legacy))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.uplinkDataStatus().is_bound()) return FALSE;
if((other_value.uplinkDataStatus().ispresent() ? !single_value->field_uplinkDataStatus.match((const UplinkDataStatusTLV&)other_value.uplinkDataStatus(), legacy) : !single_value->field_uplinkDataStatus.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.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.PDU_GMM_ServiceRequest.");
}
return FALSE;
}

boolean PDU__GMM__ServiceRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_cipheringKeySeqNum.is_bound()
 || single_value->field_serviceType.is_bound()
 || single_value->field_ptmsi.is_bound()
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound())
 || (single_value->field_uplinkDataStatus.is_omit() || single_value->field_uplinkDataStatus.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound());
}

boolean PDU__GMM__ServiceRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_cipheringKeySeqNum.is_value()
 && single_value->field_serviceType.is_value()
 && single_value->field_ptmsi.is_value()
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value())
 && (single_value->field_uplinkDataStatus.is_omit() || single_value->field_uplinkDataStatus.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value());
}

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

PDU__GMM__ServiceRequest PDU__GMM__ServiceRequest_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.PDU_GMM_ServiceRequest.");
PDU__GMM__ServiceRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cipheringKeySeqNum.is_bound()) {
ret_val.cipheringKeySeqNum() = single_value->field_cipheringKeySeqNum.valueof();
}
if (single_value->field_serviceType.is_bound()) {
ret_val.serviceType() = single_value->field_serviceType.valueof();
}
if (single_value->field_ptmsi.is_bound()) {
ret_val.ptmsi() = single_value->field_ptmsi.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
if (single_value->field_uplinkDataStatus.is_omit()) ret_val.uplinkDataStatus() = OMIT_VALUE;
else if (single_value->field_uplinkDataStatus.is_bound()) {
ret_val.uplinkDataStatus() = single_value->field_uplinkDataStatus.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
return ret_val;
}

void PDU__GMM__ServiceRequest_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.PDU_GMM_ServiceRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__ServiceRequest_template[list_length];
}

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

BITSTRING_template& PDU__GMM__ServiceRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__ServiceRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__ServiceRequest_template::cipheringKeySeqNum()
{
set_specific();
return single_value->field_cipheringKeySeqNum;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__ServiceRequest_template::cipheringKeySeqNum() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySeqNum of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_cipheringKeySeqNum;
}

ServiceTypeV_template& PDU__GMM__ServiceRequest_template::serviceType()
{
set_specific();
return single_value->field_serviceType;
}

const ServiceTypeV_template& PDU__GMM__ServiceRequest_template::serviceType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field serviceType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_serviceType;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__ServiceRequest_template::ptmsi()
{
set_specific();
return single_value->field_ptmsi;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__ServiceRequest_template::ptmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsi of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_ptmsi;
}

PDPContextStatusTLV_template& PDU__GMM__ServiceRequest_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__ServiceRequest_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_pdpContextStatus;
}

MBMS__ContextStatusTLV_template& PDU__GMM__ServiceRequest_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__ServiceRequest_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_mBMS__ContextStatus;
}

UplinkDataStatusTLV_template& PDU__GMM__ServiceRequest_template::uplinkDataStatus()
{
set_specific();
return single_value->field_uplinkDataStatus;
}

const UplinkDataStatusTLV_template& PDU__GMM__ServiceRequest_template::uplinkDataStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uplinkDataStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_uplinkDataStatus;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__ServiceRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__ServiceRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
return single_value->field_deviceProperties;
}

int PDU__GMM__ServiceRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_pdpContextStatus.is_present()) ret_val++;
      if (single_value->field_mBMS__ContextStatus.is_present()) ret_val++;
      if (single_value->field_uplinkDataStatus.is_present()) ret_val++;
      if (single_value->field_deviceProperties.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.PDU_GMM_ServiceRequest 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.PDU_GMM_ServiceRequest 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.PDU_GMM_ServiceRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest.");
  }
  return 0;
}

void PDU__GMM__ServiceRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", cipheringKeySeqNum := ");
single_value->field_cipheringKeySeqNum.log();
TTCN_Logger::log_event_str(", serviceType := ");
single_value->field_serviceType.log();
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uplinkDataStatus := ");
single_value->field_uplinkDataStatus.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.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 PDU__GMM__ServiceRequest_template::log_match(const PDU__GMM__ServiceRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringKeySeqNum.match(match_value.cipheringKeySeqNum(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySeqNum");
single_value->field_cipheringKeySeqNum.log_match(match_value.cipheringKeySeqNum(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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_ptmsi.match(match_value.ptmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsi");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uplinkDataStatus().ispresent()){
if(!single_value->field_uplinkDataStatus.match(match_value.uplinkDataStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".uplinkDataStatus");
single_value->field_uplinkDataStatus.log_match(match_value.uplinkDataStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uplinkDataStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uplinkDataStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uplinkDataStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", cipheringKeySeqNum := ");
single_value->field_cipheringKeySeqNum.log_match(match_value.cipheringKeySeqNum(), legacy);
TTCN_Logger::log_event_str(", serviceType := ");
single_value->field_serviceType.log_match(match_value.serviceType(), legacy);
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uplinkDataStatus := ");
if (match_value.uplinkDataStatus().ispresent()) {
single_value->field_uplinkDataStatus.log_match(match_value.uplinkDataStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uplinkDataStatus.log();
if (single_value->field_uplinkDataStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.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 PDU__GMM__ServiceRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_cipheringKeySeqNum.encode_text(text_buf);
single_value->field_serviceType.encode_text(text_buf);
single_value->field_ptmsi.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.encode_text(text_buf);
single_value->field_uplinkDataStatus.encode_text(text_buf);
single_value->field_deviceProperties.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.PDU_GMM_ServiceRequest.");
}
}

void PDU__GMM__ServiceRequest_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_messageType.decode_text(text_buf);
single_value->field_cipheringKeySeqNum.decode_text(text_buf);
single_value->field_serviceType.decode_text(text_buf);
single_value->field_ptmsi.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.decode_text(text_buf);
single_value->field_uplinkDataStatus.decode_text(text_buf);
single_value->field_deviceProperties.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 PDU__GMM__ServiceRequest_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.PDU_GMM_ServiceRequest.");
}
}

void PDU__GMM__ServiceRequest_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: {
    PDU__GMM__ServiceRequest_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.PDU_GMM_ServiceRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySeqNum().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) serviceType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) uplinkDataStatus().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySeqNum")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySeqNum().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkDataStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkDataStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().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.PDU_GMM_ServiceRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__ServiceRequest_template* precondition = new PDU__GMM__ServiceRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__ServiceRequest_template* implied_template = new PDU__GMM__ServiceRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__ServiceRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__ServiceRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_cipheringKeySeqNum.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_serviceType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_ptmsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_uplinkDataStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceRequest");
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.PDU_GMM_ServiceRequest");
}

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

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

PDU__GMM__ServiceAccept::PDU__GMM__ServiceAccept()
{
}

PDU__GMM__ServiceAccept::PDU__GMM__ServiceAccept(const BITSTRING& par_messageType,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus)
  :   field_messageType(par_messageType),
  field_pdpContextStatus(par_pdpContextStatus),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus)
{
}

PDU__GMM__ServiceAccept::PDU__GMM__ServiceAccept(const PDU__GMM__ServiceAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
}

void PDU__GMM__ServiceAccept::clean_up()
{
field_messageType.clean_up();
field_pdpContextStatus.clean_up();
field_mBMS__ContextStatus.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__ServiceAccept::get_descriptor() const { return &PDU__GMM__ServiceAccept_descr_; }
PDU__GMM__ServiceAccept& PDU__GMM__ServiceAccept::operator=(const PDU__GMM__ServiceAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
}
return *this;
}

boolean PDU__GMM__ServiceAccept::operator==(const PDU__GMM__ServiceAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus;
}

boolean PDU__GMM__ServiceAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound());
}
boolean PDU__GMM__ServiceAccept::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value());
}
int PDU__GMM__ServiceAccept::size_of() const
{
  int ret_val = 1;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__ServiceAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__ServiceAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
}

void PDU__GMM__ServiceAccept::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.PDU_GMM_ServiceAccept 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().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.PDU_GMM_ServiceAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept");
  }
}

void PDU__GMM__ServiceAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
}

void PDU__GMM__ServiceAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
}

void PDU__GMM__ServiceAccept::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 PDU__GMM__ServiceAccept::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 PDU__GMM__ServiceAccept::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_messageType.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (field_messageType !=  bs_49) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__ServiceAccept::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::BIT8_descr_.raw);
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_messageType !=  bs_49) {
  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_49.RAW_encode(General__Types::BIT8_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 PDU__GMM__ServiceAccept_template::single_value_struct {
BITSTRING_template field_messageType;
PDPContextStatusTLV_template field_pdpContextStatus;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
};

void PDU__GMM__ServiceAccept_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_messageType = ANY_VALUE;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
}
}
}

void PDU__GMM__ServiceAccept_template::copy_value(const PDU__GMM__ServiceAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__ServiceAccept_template::copy_template(const PDU__GMM__ServiceAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.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 PDU__GMM__ServiceAccept_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 PDU__GMM__ServiceAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__ServiceAccept_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.PDU_GMM_ServiceAccept.");
break;
}
set_selection(other_value);
}

PDU__GMM__ServiceAccept_template::PDU__GMM__ServiceAccept_template()
{
}

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

PDU__GMM__ServiceAccept_template::PDU__GMM__ServiceAccept_template(const PDU__GMM__ServiceAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__ServiceAccept_template::match(const PDU__GMM__ServiceAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.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.PDU_GMM_ServiceAccept.");
}
return FALSE;
}

boolean PDU__GMM__ServiceAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound());
}

boolean PDU__GMM__ServiceAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value());
}

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

PDU__GMM__ServiceAccept PDU__GMM__ServiceAccept_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.PDU_GMM_ServiceAccept.");
PDU__GMM__ServiceAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
return ret_val;
}

void PDU__GMM__ServiceAccept_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.PDU_GMM_ServiceAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__ServiceAccept_template[list_length];
}

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

BITSTRING_template& PDU__GMM__ServiceAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__ServiceAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept.");
return single_value->field_messageType;
}

PDPContextStatusTLV_template& PDU__GMM__ServiceAccept_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__ServiceAccept_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept.");
return single_value->field_pdpContextStatus;
}

MBMS__ContextStatusTLV_template& PDU__GMM__ServiceAccept_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__ServiceAccept_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept.");
return single_value->field_mBMS__ContextStatus;
}

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

void PDU__GMM__ServiceAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.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 PDU__GMM__ServiceAccept_template::log_match(const PDU__GMM__ServiceAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.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 PDU__GMM__ServiceAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.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.PDU_GMM_ServiceAccept.");
}
}

void PDU__GMM__ServiceAccept_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_messageType.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.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 PDU__GMM__ServiceAccept_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.PDU_GMM_ServiceAccept.");
}
}

void PDU__GMM__ServiceAccept_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: {
    PDU__GMM__ServiceAccept_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.PDU_GMM_ServiceAccept 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().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.PDU_GMM_ServiceAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__ServiceAccept_template* precondition = new PDU__GMM__ServiceAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__ServiceAccept_template* implied_template = new PDU__GMM__ServiceAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__ServiceAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__ServiceAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceAccept");
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.PDU_GMM_ServiceAccept");
}

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

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

PDU__GMM__ServiceReject::PDU__GMM__ServiceReject()
{
}

PDU__GMM__ServiceReject::PDU__GMM__ServiceReject(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3346)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_t3346(par_t3346)
{
}

PDU__GMM__ServiceReject::PDU__GMM__ServiceReject(const PDU__GMM__ServiceReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
else field_t3346.clean_up();
}

void PDU__GMM__ServiceReject::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_t3346.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__ServiceReject::get_descriptor() const { return &PDU__GMM__ServiceReject_descr_; }
PDU__GMM__ServiceReject& PDU__GMM__ServiceReject::operator=(const PDU__GMM__ServiceReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
  else field_t3346.clean_up();
}
return *this;
}

boolean PDU__GMM__ServiceReject::operator==(const PDU__GMM__ServiceReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_t3346==other_value.field_t3346;
}

boolean PDU__GMM__ServiceReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_bound());
}
boolean PDU__GMM__ServiceReject::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_value());
}
int PDU__GMM__ServiceReject::size_of() const
{
  int ret_val = 2;
  if (field_t3346.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__ServiceReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3346 := ");
field_t3346.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__ServiceReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!t3346().is_bound()) t3346() = OMIT_VALUE;
else t3346().set_implicit_omit();
}

void PDU__GMM__ServiceReject::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.PDU_GMM_ServiceReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_ServiceReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject");
  }
}

void PDU__GMM__ServiceReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3346.encode_text(text_buf);
}

void PDU__GMM__ServiceReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3346.decode_text(text_buf);
}

void PDU__GMM__ServiceReject::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 PDU__GMM__ServiceReject::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 PDU__GMM__ServiceReject::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_messageType.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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.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 (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_t3346 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3346().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_t3346 = 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_t3346=OMIT_VALUE;
  if (field_messageType !=  bs_50) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__GMM__ServiceReject::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  if (field_t3346.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_t3346.ispresent()) {
  encoded_length += field_t3346().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_messageType !=  bs_50) {
  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_50.RAW_encode(General__Types::BIT8_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 PDU__GMM__ServiceReject_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
GPRSTimer2TLV_template field_t3346;
};

void PDU__GMM__ServiceReject_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_t3346 = ANY_OR_OMIT;
}
}
}

void PDU__GMM__ServiceReject_template::copy_value(const PDU__GMM__ServiceReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3346().is_bound()) {
  if (other_value.t3346().ispresent()) single_value->field_t3346 = other_value.t3346()();
  else single_value->field_t3346 = OMIT_VALUE;
} else {
  single_value->field_t3346.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__ServiceReject_template::copy_template(const PDU__GMM__ServiceReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3346().get_selection()) {
single_value->field_t3346 = other_value.t3346();
} else {
single_value->field_t3346.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 PDU__GMM__ServiceReject_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 PDU__GMM__ServiceReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__ServiceReject_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.PDU_GMM_ServiceReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__ServiceReject_template::PDU__GMM__ServiceReject_template()
{
}

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

PDU__GMM__ServiceReject_template::PDU__GMM__ServiceReject_template(const PDU__GMM__ServiceReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__GMM__ServiceReject_template::match(const PDU__GMM__ServiceReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.t3346().is_bound()) return FALSE;
if((other_value.t3346().ispresent() ? !single_value->field_t3346.match((const GPRSTimer2TLV&)other_value.t3346(), legacy) : !single_value->field_t3346.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.PDU_GMM_ServiceReject.");
}
return FALSE;
}

boolean PDU__GMM__ServiceReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || (single_value->field_t3346.is_omit() || single_value->field_t3346.is_bound());
}

boolean PDU__GMM__ServiceReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && (single_value->field_t3346.is_omit() || single_value->field_t3346.is_value());
}

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

PDU__GMM__ServiceReject PDU__GMM__ServiceReject_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.PDU_GMM_ServiceReject.");
PDU__GMM__ServiceReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3346.is_omit()) ret_val.t3346() = OMIT_VALUE;
else if (single_value->field_t3346.is_bound()) {
ret_val.t3346() = single_value->field_t3346.valueof();
}
return ret_val;
}

void PDU__GMM__ServiceReject_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.PDU_GMM_ServiceReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__ServiceReject_template[list_length];
}

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

BITSTRING_template& PDU__GMM__ServiceReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__ServiceReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__ServiceReject_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__ServiceReject_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__ServiceReject_template::t3346()
{
set_specific();
return single_value->field_t3346;
}

const GPRSTimer2TLV_template& PDU__GMM__ServiceReject_template::t3346() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3346 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
return single_value->field_t3346;
}

int PDU__GMM__ServiceReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_t3346.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.PDU_GMM_ServiceReject 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.PDU_GMM_ServiceReject 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.PDU_GMM_ServiceReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject.");
  }
  return 0;
}

void PDU__GMM__ServiceReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3346 := ");
single_value->field_t3346.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 PDU__GMM__ServiceReject_template::log_match(const PDU__GMM__ServiceReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.t3346().ispresent()){
if(!single_value->field_t3346.match(match_value.t3346(), legacy)){
TTCN_Logger::log_logmatch_info(".t3346");
single_value->field_t3346.log_match(match_value.t3346(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3346.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3346 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3346.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", t3346 := ");
if (match_value.t3346().ispresent()) {
single_value->field_t3346.log_match(match_value.t3346(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3346.log();
if (single_value->field_t3346.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 PDU__GMM__ServiceReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3346.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.PDU_GMM_ServiceReject.");
}
}

void PDU__GMM__ServiceReject_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3346.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 PDU__GMM__ServiceReject_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.PDU_GMM_ServiceReject.");
}
}

void PDU__GMM__ServiceReject_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: {
    PDU__GMM__ServiceReject_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.PDU_GMM_ServiceReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3346().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().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.PDU_GMM_ServiceReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__ServiceReject_template* precondition = new PDU__GMM__ServiceReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__ServiceReject_template* implied_template = new PDU__GMM__ServiceReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__ServiceReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__ServiceReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject");
single_value->field_t3346.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_ServiceReject");
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.PDU_GMM_ServiceReject");
}

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

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

PDU__SM__ActivatePDPContextRequest::PDU__SM__ActivatePDPContextRequest()
{
}

PDU__SM__ActivatePDPContextRequest::PDU__SM__ActivatePDPContextRequest(const BITSTRING& par_messageType,
    const NSAPIV& par_requestedNSAPI,
    const LLC__SAPIV& par_requestedLLCSAPI,
    const QoSLV& par_requestedQoS,
    const PDPAddressLV& par_requestedPDPaddress,
    const OPTIONAL< AccessPointNameTLV >& par_accessPointName,
    const OPTIONAL< ProtocolConfigOptionsTLV >& par_protocolConfigOpts,
    const OPTIONAL< RequestTypeTV >& par_requestType,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< NBIFOM__ContainerTLV >& par_nBIFOM__Container)
  :   field_messageType(par_messageType),
  field_requestedNSAPI(par_requestedNSAPI),
  field_requestedLLCSAPI(par_requestedLLCSAPI),
  field_requestedQoS(par_requestedQoS),
  field_requestedPDPaddress(par_requestedPDPaddress),
  field_accessPointName(par_accessPointName),
  field_protocolConfigOpts(par_protocolConfigOpts),
  field_requestType(par_requestType),
  field_deviceProperties(par_deviceProperties),
  field_nBIFOM__Container(par_nBIFOM__Container)
{
}

PDU__SM__ActivatePDPContextRequest::PDU__SM__ActivatePDPContextRequest(const PDU__SM__ActivatePDPContextRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.requestedNSAPI().is_bound()) field_requestedNSAPI = other_value.requestedNSAPI();
else field_requestedNSAPI.clean_up();
if (other_value.requestedLLCSAPI().is_bound()) field_requestedLLCSAPI = other_value.requestedLLCSAPI();
else field_requestedLLCSAPI.clean_up();
if (other_value.requestedQoS().is_bound()) field_requestedQoS = other_value.requestedQoS();
else field_requestedQoS.clean_up();
if (other_value.requestedPDPaddress().is_bound()) field_requestedPDPaddress = other_value.requestedPDPaddress();
else field_requestedPDPaddress.clean_up();
if (other_value.accessPointName().is_bound()) field_accessPointName = other_value.accessPointName();
else field_accessPointName.clean_up();
if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
else field_protocolConfigOpts.clean_up();
if (other_value.requestType().is_bound()) field_requestType = other_value.requestType();
else field_requestType.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
else field_nBIFOM__Container.clean_up();
}

void PDU__SM__ActivatePDPContextRequest::clean_up()
{
field_messageType.clean_up();
field_requestedNSAPI.clean_up();
field_requestedLLCSAPI.clean_up();
field_requestedQoS.clean_up();
field_requestedPDPaddress.clean_up();
field_accessPointName.clean_up();
field_protocolConfigOpts.clean_up();
field_requestType.clean_up();
field_deviceProperties.clean_up();
field_nBIFOM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SM__ActivatePDPContextRequest::get_descriptor() const { return &PDU__SM__ActivatePDPContextRequest_descr_; }
PDU__SM__ActivatePDPContextRequest& PDU__SM__ActivatePDPContextRequest::operator=(const PDU__SM__ActivatePDPContextRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.requestedNSAPI().is_bound()) field_requestedNSAPI = other_value.requestedNSAPI();
  else field_requestedNSAPI.clean_up();
  if (other_value.requestedLLCSAPI().is_bound()) field_requestedLLCSAPI = other_value.requestedLLCSAPI();
  else field_requestedLLCSAPI.clean_up();
  if (other_value.requestedQoS().is_bound()) field_requestedQoS = other_value.requestedQoS();
  else field_requestedQoS.clean_up();
  if (other_value.requestedPDPaddress().is_bound()) field_requestedPDPaddress = other_value.requestedPDPaddress();
  else field_requestedPDPaddress.clean_up();
  if (other_value.accessPointName().is_bound()) field_accessPointName = other_value.accessPointName();
  else field_accessPointName.clean_up();
  if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
  else field_protocolConfigOpts.clean_up();
  if (other_value.requestType().is_bound()) field_requestType = other_value.requestType();
  else field_requestType.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
  else field_nBIFOM__Container.clean_up();
}
return *this;
}

boolean PDU__SM__ActivatePDPContextRequest::operator==(const PDU__SM__ActivatePDPContextRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_requestedNSAPI==other_value.field_requestedNSAPI
  && field_requestedLLCSAPI==other_value.field_requestedLLCSAPI
  && field_requestedQoS==other_value.field_requestedQoS
  && field_requestedPDPaddress==other_value.field_requestedPDPaddress
  && field_accessPointName==other_value.field_accessPointName
  && field_protocolConfigOpts==other_value.field_protocolConfigOpts
  && field_requestType==other_value.field_requestType
  && field_deviceProperties==other_value.field_deviceProperties
  && field_nBIFOM__Container==other_value.field_nBIFOM__Container;
}

boolean PDU__SM__ActivatePDPContextRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_requestedNSAPI.is_bound())
  || (field_requestedLLCSAPI.is_bound())
  || (field_requestedQoS.is_bound())
  || (field_requestedPDPaddress.is_bound())
  || (OPTIONAL_OMIT == field_accessPointName.get_selection() || field_accessPointName.is_bound())
  || (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_bound())
  || (OPTIONAL_OMIT == field_requestType.get_selection() || field_requestType.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_bound());
}
boolean PDU__SM__ActivatePDPContextRequest::is_value() const
{
return field_messageType.is_value()
  && field_requestedNSAPI.is_value()
  && field_requestedLLCSAPI.is_value()
  && field_requestedQoS.is_value()
  && field_requestedPDPaddress.is_value()
  && (OPTIONAL_OMIT == field_accessPointName.get_selection() || field_accessPointName.is_value())
  && (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_value())
  && (OPTIONAL_OMIT == field_requestType.get_selection() || field_requestType.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_value());
}
int PDU__SM__ActivatePDPContextRequest::size_of() const
{
  int ret_val = 5;
  if (field_accessPointName.ispresent()) ret_val++;
  if (field_protocolConfigOpts.ispresent()) ret_val++;
  if (field_requestType.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_nBIFOM__Container.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SM__ActivatePDPContextRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", requestedNSAPI := ");
field_requestedNSAPI.log();
TTCN_Logger::log_event_str(", requestedLLCSAPI := ");
field_requestedLLCSAPI.log();
TTCN_Logger::log_event_str(", requestedQoS := ");
field_requestedQoS.log();
TTCN_Logger::log_event_str(", requestedPDPaddress := ");
field_requestedPDPaddress.log();
TTCN_Logger::log_event_str(", accessPointName := ");
field_accessPointName.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", requestType := ");
field_requestType.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
field_nBIFOM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SM__ActivatePDPContextRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (requestedNSAPI().is_bound()) requestedNSAPI().set_implicit_omit();
if (requestedLLCSAPI().is_bound()) requestedLLCSAPI().set_implicit_omit();
if (requestedQoS().is_bound()) requestedQoS().set_implicit_omit();
if (requestedPDPaddress().is_bound()) requestedPDPaddress().set_implicit_omit();
if (!accessPointName().is_bound()) accessPointName() = OMIT_VALUE;
else accessPointName().set_implicit_omit();
if (!protocolConfigOpts().is_bound()) protocolConfigOpts() = OMIT_VALUE;
else protocolConfigOpts().set_implicit_omit();
if (!requestType().is_bound()) requestType() = OMIT_VALUE;
else requestType().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!nBIFOM__Container().is_bound()) nBIFOM__Container() = OMIT_VALUE;
else nBIFOM__Container().set_implicit_omit();
}

void PDU__SM__ActivatePDPContextRequest::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 (10<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest has 10 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) requestedNSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) requestedLLCSAPI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestedQoS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) requestedPDPaddress().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) accessPointName().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestType().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().set_param(*param.get_elem(9));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedNSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedNSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedLLCSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedLLCSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedPDPaddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedPDPaddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "accessPointName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
  }
}

void PDU__SM__ActivatePDPContextRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_requestedNSAPI.encode_text(text_buf);
field_requestedLLCSAPI.encode_text(text_buf);
field_requestedQoS.encode_text(text_buf);
field_requestedPDPaddress.encode_text(text_buf);
field_accessPointName.encode_text(text_buf);
field_protocolConfigOpts.encode_text(text_buf);
field_requestType.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_nBIFOM__Container.encode_text(text_buf);
}

void PDU__SM__ActivatePDPContextRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_requestedNSAPI.decode_text(text_buf);
field_requestedLLCSAPI.decode_text(text_buf);
field_requestedQoS.decode_text(text_buf);
field_requestedPDPaddress.decode_text(text_buf);
field_accessPointName.decode_text(text_buf);
field_protocolConfigOpts.decode_text(text_buf);
field_requestType.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_nBIFOM__Container.decode_text(text_buf);
}

void PDU__SM__ActivatePDPContextRequest::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 PDU__SM__ActivatePDPContextRequest::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 PDU__SM__ActivatePDPContextRequest::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_messageType.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, NSAPIV_descr_.raw->forceomit);
  decoded_field_length = field_requestedNSAPI.RAW_decode(NSAPIV_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, LLC__SAPIV_descr_.raw->forceomit);
  decoded_field_length = field_requestedLLCSAPI.RAW_decode(LLC__SAPIV_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, QoSLV_descr_.raw->forceomit);
  decoded_field_length = field_requestedQoS.RAW_decode(QoSLV_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, PDPAddressLV_descr_.raw->forceomit);
  decoded_field_length = field_requestedPDPaddress.RAW_decode(PDPAddressLV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_accessPointName = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, AccessPointNameTLV_descr_.raw->forceomit);
  decoded_field_length = field_accessPointName().RAW_decode(AccessPointNameTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_accessPointName = 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_accessPointName=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_protocolConfigOpts = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ProtocolConfigOptionsTLV_descr_.raw->forceomit);
  decoded_field_length = field_protocolConfigOpts().RAW_decode(ProtocolConfigOptionsTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_protocolConfigOpts = 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_protocolConfigOpts=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_requestType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, RequestTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_requestType().RAW_decode(RequestTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_requestType = 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_requestType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_21){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_nBIFOM__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, NBIFOM__ContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_nBIFOM__Container().RAW_decode(NBIFOM__ContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_nBIFOM__Container = 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_nBIFOM__Container=OMIT_VALUE;
  if (field_messageType !=  bs_51) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SM__ActivatePDPContextRequest::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 = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  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, NSAPIV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LLC__SAPIV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, QoSLV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDPAddressLV_descr_.raw);
  if (field_accessPointName.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessPointNameTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_protocolConfigOpts.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ProtocolConfigOptionsTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_requestType.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RequestTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_nBIFOM__Container.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, NBIFOM__ContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_requestedNSAPI.RAW_encode(NSAPIV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_requestedLLCSAPI.RAW_encode(LLC__SAPIV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_requestedQoS.RAW_encode(QoSLV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_requestedPDPaddress.RAW_encode(PDPAddressLV_descr_, *myleaf.body.node.nodes[4]);
  if (field_accessPointName.ispresent()) {
  encoded_length += field_accessPointName().RAW_encode(AccessPointNameTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_protocolConfigOpts.ispresent()) {
  encoded_length += field_protocolConfigOpts().RAW_encode(ProtocolConfigOptionsTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_requestType.ispresent()) {
  encoded_length += field_requestType().RAW_encode(RequestTypeTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_nBIFOM__Container.ispresent()) {
  encoded_length += field_nBIFOM__Container().RAW_encode(NBIFOM__ContainerTLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.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);
  }
  }
  if (field_messageType !=  bs_51) {
  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_51.RAW_encode(General__Types::BIT8_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 PDU__SM__ActivatePDPContextRequest_template::single_value_struct {
BITSTRING_template field_messageType;
NSAPIV_template field_requestedNSAPI;
LLC__SAPIV_template field_requestedLLCSAPI;
QoSLV_template field_requestedQoS;
PDPAddressLV_template field_requestedPDPaddress;
AccessPointNameTLV_template field_accessPointName;
ProtocolConfigOptionsTLV_template field_protocolConfigOpts;
RequestTypeTV_template field_requestType;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
NBIFOM__ContainerTLV_template field_nBIFOM__Container;
};

void PDU__SM__ActivatePDPContextRequest_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_messageType = ANY_VALUE;
single_value->field_requestedNSAPI = ANY_VALUE;
single_value->field_requestedLLCSAPI = ANY_VALUE;
single_value->field_requestedQoS = ANY_VALUE;
single_value->field_requestedPDPaddress = ANY_VALUE;
single_value->field_accessPointName = ANY_OR_OMIT;
single_value->field_protocolConfigOpts = ANY_OR_OMIT;
single_value->field_requestType = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_nBIFOM__Container = ANY_OR_OMIT;
}
}
}

void PDU__SM__ActivatePDPContextRequest_template::copy_value(const PDU__SM__ActivatePDPContextRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.requestedNSAPI().is_bound()) {
  single_value->field_requestedNSAPI = other_value.requestedNSAPI();
} else {
  single_value->field_requestedNSAPI.clean_up();
}
if (other_value.requestedLLCSAPI().is_bound()) {
  single_value->field_requestedLLCSAPI = other_value.requestedLLCSAPI();
} else {
  single_value->field_requestedLLCSAPI.clean_up();
}
if (other_value.requestedQoS().is_bound()) {
  single_value->field_requestedQoS = other_value.requestedQoS();
} else {
  single_value->field_requestedQoS.clean_up();
}
if (other_value.requestedPDPaddress().is_bound()) {
  single_value->field_requestedPDPaddress = other_value.requestedPDPaddress();
} else {
  single_value->field_requestedPDPaddress.clean_up();
}
if (other_value.accessPointName().is_bound()) {
  if (other_value.accessPointName().ispresent()) single_value->field_accessPointName = other_value.accessPointName()();
  else single_value->field_accessPointName = OMIT_VALUE;
} else {
  single_value->field_accessPointName.clean_up();
}
if (other_value.protocolConfigOpts().is_bound()) {
  if (other_value.protocolConfigOpts().ispresent()) single_value->field_protocolConfigOpts = other_value.protocolConfigOpts()();
  else single_value->field_protocolConfigOpts = OMIT_VALUE;
} else {
  single_value->field_protocolConfigOpts.clean_up();
}
if (other_value.requestType().is_bound()) {
  if (other_value.requestType().ispresent()) single_value->field_requestType = other_value.requestType()();
  else single_value->field_requestType = OMIT_VALUE;
} else {
  single_value->field_requestType.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.nBIFOM__Container().is_bound()) {
  if (other_value.nBIFOM__Container().ispresent()) single_value->field_nBIFOM__Container = other_value.nBIFOM__Container()();
  else single_value->field_nBIFOM__Container = OMIT_VALUE;
} else {
  single_value->field_nBIFOM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SM__ActivatePDPContextRequest_template::copy_template(const PDU__SM__ActivatePDPContextRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedNSAPI().get_selection()) {
single_value->field_requestedNSAPI = other_value.requestedNSAPI();
} else {
single_value->field_requestedNSAPI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedLLCSAPI().get_selection()) {
single_value->field_requestedLLCSAPI = other_value.requestedLLCSAPI();
} else {
single_value->field_requestedLLCSAPI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedQoS().get_selection()) {
single_value->field_requestedQoS = other_value.requestedQoS();
} else {
single_value->field_requestedQoS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedPDPaddress().get_selection()) {
single_value->field_requestedPDPaddress = other_value.requestedPDPaddress();
} else {
single_value->field_requestedPDPaddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessPointName().get_selection()) {
single_value->field_accessPointName = other_value.accessPointName();
} else {
single_value->field_accessPointName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolConfigOpts().get_selection()) {
single_value->field_protocolConfigOpts = other_value.protocolConfigOpts();
} else {
single_value->field_protocolConfigOpts.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestType().get_selection()) {
single_value->field_requestType = other_value.requestType();
} else {
single_value->field_requestType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nBIFOM__Container().get_selection()) {
single_value->field_nBIFOM__Container = other_value.nBIFOM__Container();
} else {
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextRequest_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 PDU__SM__ActivatePDPContextRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SM__ActivatePDPContextRequest_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.PDU_SM_ActivatePDPContextRequest.");
break;
}
set_selection(other_value);
}

PDU__SM__ActivatePDPContextRequest_template::PDU__SM__ActivatePDPContextRequest_template()
{
}

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

PDU__SM__ActivatePDPContextRequest_template::PDU__SM__ActivatePDPContextRequest_template(const PDU__SM__ActivatePDPContextRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SM__ActivatePDPContextRequest_template::match(const PDU__SM__ActivatePDPContextRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.requestedNSAPI().is_bound()) return FALSE;
if(!single_value->field_requestedNSAPI.match(other_value.requestedNSAPI(), legacy))return FALSE;
if(!other_value.requestedLLCSAPI().is_bound()) return FALSE;
if(!single_value->field_requestedLLCSAPI.match(other_value.requestedLLCSAPI(), legacy))return FALSE;
if(!other_value.requestedQoS().is_bound()) return FALSE;
if(!single_value->field_requestedQoS.match(other_value.requestedQoS(), legacy))return FALSE;
if(!other_value.requestedPDPaddress().is_bound()) return FALSE;
if(!single_value->field_requestedPDPaddress.match(other_value.requestedPDPaddress(), legacy))return FALSE;
if(!other_value.accessPointName().is_bound()) return FALSE;
if((other_value.accessPointName().ispresent() ? !single_value->field_accessPointName.match((const AccessPointNameTLV&)other_value.accessPointName(), legacy) : !single_value->field_accessPointName.match_omit(legacy)))return FALSE;
if(!other_value.protocolConfigOpts().is_bound()) return FALSE;
if((other_value.protocolConfigOpts().ispresent() ? !single_value->field_protocolConfigOpts.match((const ProtocolConfigOptionsTLV&)other_value.protocolConfigOpts(), legacy) : !single_value->field_protocolConfigOpts.match_omit(legacy)))return FALSE;
if(!other_value.requestType().is_bound()) return FALSE;
if((other_value.requestType().ispresent() ? !single_value->field_requestType.match((const RequestTypeTV&)other_value.requestType(), legacy) : !single_value->field_requestType.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.nBIFOM__Container().is_bound()) return FALSE;
if((other_value.nBIFOM__Container().ispresent() ? !single_value->field_nBIFOM__Container.match((const NBIFOM__ContainerTLV&)other_value.nBIFOM__Container(), legacy) : !single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextRequest.");
}
return FALSE;
}

boolean PDU__SM__ActivatePDPContextRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_requestedNSAPI.is_bound()
 || single_value->field_requestedLLCSAPI.is_bound()
 || single_value->field_requestedQoS.is_bound()
 || single_value->field_requestedPDPaddress.is_bound()
 || (single_value->field_accessPointName.is_omit() || single_value->field_accessPointName.is_bound())
 || (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_bound())
 || (single_value->field_requestType.is_omit() || single_value->field_requestType.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_bound());
}

boolean PDU__SM__ActivatePDPContextRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_requestedNSAPI.is_value()
 && single_value->field_requestedLLCSAPI.is_value()
 && single_value->field_requestedQoS.is_value()
 && single_value->field_requestedPDPaddress.is_value()
 && (single_value->field_accessPointName.is_omit() || single_value->field_accessPointName.is_value())
 && (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_value())
 && (single_value->field_requestType.is_omit() || single_value->field_requestType.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_value());
}

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

PDU__SM__ActivatePDPContextRequest PDU__SM__ActivatePDPContextRequest_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.PDU_SM_ActivatePDPContextRequest.");
PDU__SM__ActivatePDPContextRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_requestedNSAPI.is_bound()) {
ret_val.requestedNSAPI() = single_value->field_requestedNSAPI.valueof();
}
if (single_value->field_requestedLLCSAPI.is_bound()) {
ret_val.requestedLLCSAPI() = single_value->field_requestedLLCSAPI.valueof();
}
if (single_value->field_requestedQoS.is_bound()) {
ret_val.requestedQoS() = single_value->field_requestedQoS.valueof();
}
if (single_value->field_requestedPDPaddress.is_bound()) {
ret_val.requestedPDPaddress() = single_value->field_requestedPDPaddress.valueof();
}
if (single_value->field_accessPointName.is_omit()) ret_val.accessPointName() = OMIT_VALUE;
else if (single_value->field_accessPointName.is_bound()) {
ret_val.accessPointName() = single_value->field_accessPointName.valueof();
}
if (single_value->field_protocolConfigOpts.is_omit()) ret_val.protocolConfigOpts() = OMIT_VALUE;
else if (single_value->field_protocolConfigOpts.is_bound()) {
ret_val.protocolConfigOpts() = single_value->field_protocolConfigOpts.valueof();
}
if (single_value->field_requestType.is_omit()) ret_val.requestType() = OMIT_VALUE;
else if (single_value->field_requestType.is_bound()) {
ret_val.requestType() = single_value->field_requestType.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_nBIFOM__Container.is_omit()) ret_val.nBIFOM__Container() = OMIT_VALUE;
else if (single_value->field_nBIFOM__Container.is_bound()) {
ret_val.nBIFOM__Container() = single_value->field_nBIFOM__Container.valueof();
}
return ret_val;
}

void PDU__SM__ActivatePDPContextRequest_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.PDU_SM_ActivatePDPContextRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SM__ActivatePDPContextRequest_template[list_length];
}

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

BITSTRING_template& PDU__SM__ActivatePDPContextRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__SM__ActivatePDPContextRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_messageType;
}

NSAPIV_template& PDU__SM__ActivatePDPContextRequest_template::requestedNSAPI()
{
set_specific();
return single_value->field_requestedNSAPI;
}

const NSAPIV_template& PDU__SM__ActivatePDPContextRequest_template::requestedNSAPI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedNSAPI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_requestedNSAPI;
}

LLC__SAPIV_template& PDU__SM__ActivatePDPContextRequest_template::requestedLLCSAPI()
{
set_specific();
return single_value->field_requestedLLCSAPI;
}

const LLC__SAPIV_template& PDU__SM__ActivatePDPContextRequest_template::requestedLLCSAPI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedLLCSAPI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_requestedLLCSAPI;
}

QoSLV_template& PDU__SM__ActivatePDPContextRequest_template::requestedQoS()
{
set_specific();
return single_value->field_requestedQoS;
}

const QoSLV_template& PDU__SM__ActivatePDPContextRequest_template::requestedQoS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedQoS of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_requestedQoS;
}

PDPAddressLV_template& PDU__SM__ActivatePDPContextRequest_template::requestedPDPaddress()
{
set_specific();
return single_value->field_requestedPDPaddress;
}

const PDPAddressLV_template& PDU__SM__ActivatePDPContextRequest_template::requestedPDPaddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedPDPaddress of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_requestedPDPaddress;
}

AccessPointNameTLV_template& PDU__SM__ActivatePDPContextRequest_template::accessPointName()
{
set_specific();
return single_value->field_accessPointName;
}

const AccessPointNameTLV_template& PDU__SM__ActivatePDPContextRequest_template::accessPointName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessPointName of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_accessPointName;
}

ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextRequest_template::protocolConfigOpts()
{
set_specific();
return single_value->field_protocolConfigOpts;
}

const ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextRequest_template::protocolConfigOpts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolConfigOpts of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_protocolConfigOpts;
}

RequestTypeTV_template& PDU__SM__ActivatePDPContextRequest_template::requestType()
{
set_specific();
return single_value->field_requestType;
}

const RequestTypeTV_template& PDU__SM__ActivatePDPContextRequest_template::requestType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_requestType;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__SM__ActivatePDPContextRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__SM__ActivatePDPContextRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_deviceProperties;
}

NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextRequest_template::nBIFOM__Container()
{
set_specific();
return single_value->field_nBIFOM__Container;
}

const NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextRequest_template::nBIFOM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nBIFOM_Container of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
return single_value->field_nBIFOM__Container;
}

int PDU__SM__ActivatePDPContextRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_accessPointName.is_present()) ret_val++;
      if (single_value->field_protocolConfigOpts.is_present()) ret_val++;
      if (single_value->field_requestType.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextRequest 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.PDU_SM_ActivatePDPContextRequest 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.PDU_SM_ActivatePDPContextRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest.");
  }
  return 0;
}

void PDU__SM__ActivatePDPContextRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", requestedNSAPI := ");
single_value->field_requestedNSAPI.log();
TTCN_Logger::log_event_str(", requestedLLCSAPI := ");
single_value->field_requestedLLCSAPI.log();
TTCN_Logger::log_event_str(", requestedQoS := ");
single_value->field_requestedQoS.log();
TTCN_Logger::log_event_str(", requestedPDPaddress := ");
single_value->field_requestedPDPaddress.log();
TTCN_Logger::log_event_str(", accessPointName := ");
single_value->field_accessPointName.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", requestType := ");
single_value->field_requestType.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextRequest_template::log_match(const PDU__SM__ActivatePDPContextRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedNSAPI.match(match_value.requestedNSAPI(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedNSAPI");
single_value->field_requestedNSAPI.log_match(match_value.requestedNSAPI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedLLCSAPI.match(match_value.requestedLLCSAPI(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedLLCSAPI");
single_value->field_requestedLLCSAPI.log_match(match_value.requestedLLCSAPI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedQoS.match(match_value.requestedQoS(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedQoS");
single_value->field_requestedQoS.log_match(match_value.requestedQoS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedPDPaddress.match(match_value.requestedPDPaddress(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedPDPaddress");
single_value->field_requestedPDPaddress.log_match(match_value.requestedPDPaddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessPointName().ispresent()){
if(!single_value->field_accessPointName.match(match_value.accessPointName(), legacy)){
TTCN_Logger::log_logmatch_info(".accessPointName");
single_value->field_accessPointName.log_match(match_value.accessPointName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessPointName.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessPointName := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessPointName.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.protocolConfigOpts().ispresent()){
if(!single_value->field_protocolConfigOpts.match(match_value.protocolConfigOpts(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolConfigOpts");
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolConfigOpts.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolConfigOpts := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requestType().ispresent()){
if(!single_value->field_requestType.match(match_value.requestType(), legacy)){
TTCN_Logger::log_logmatch_info(".requestType");
single_value->field_requestType.log_match(match_value.requestType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requestType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requestType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requestType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nBIFOM__Container().ispresent()){
if(!single_value->field_nBIFOM__Container.match(match_value.nBIFOM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".nBIFOM_Container");
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nBIFOM__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nBIFOM_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nBIFOM__Container.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", requestedNSAPI := ");
single_value->field_requestedNSAPI.log_match(match_value.requestedNSAPI(), legacy);
TTCN_Logger::log_event_str(", requestedLLCSAPI := ");
single_value->field_requestedLLCSAPI.log_match(match_value.requestedLLCSAPI(), legacy);
TTCN_Logger::log_event_str(", requestedQoS := ");
single_value->field_requestedQoS.log_match(match_value.requestedQoS(), legacy);
TTCN_Logger::log_event_str(", requestedPDPaddress := ");
single_value->field_requestedPDPaddress.log_match(match_value.requestedPDPaddress(), legacy);
TTCN_Logger::log_event_str(", accessPointName := ");
if (match_value.accessPointName().ispresent()) {
single_value->field_accessPointName.log_match(match_value.accessPointName(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessPointName.log();
if (single_value->field_accessPointName.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
if (match_value.protocolConfigOpts().ispresent()) {
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolConfigOpts.log();
if (single_value->field_protocolConfigOpts.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestType := ");
if (match_value.requestType().ispresent()) {
single_value->field_requestType.log_match(match_value.requestType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requestType.log();
if (single_value->field_requestType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
if (match_value.nBIFOM__Container().ispresent()) {
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nBIFOM__Container.log();
if (single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_requestedNSAPI.encode_text(text_buf);
single_value->field_requestedLLCSAPI.encode_text(text_buf);
single_value->field_requestedQoS.encode_text(text_buf);
single_value->field_requestedPDPaddress.encode_text(text_buf);
single_value->field_accessPointName.encode_text(text_buf);
single_value->field_protocolConfigOpts.encode_text(text_buf);
single_value->field_requestType.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextRequest.");
}
}

void PDU__SM__ActivatePDPContextRequest_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_messageType.decode_text(text_buf);
single_value->field_requestedNSAPI.decode_text(text_buf);
single_value->field_requestedLLCSAPI.decode_text(text_buf);
single_value->field_requestedQoS.decode_text(text_buf);
single_value->field_requestedPDPaddress.decode_text(text_buf);
single_value->field_accessPointName.decode_text(text_buf);
single_value->field_protocolConfigOpts.decode_text(text_buf);
single_value->field_requestType.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextRequest_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.PDU_SM_ActivatePDPContextRequest.");
}
}

void PDU__SM__ActivatePDPContextRequest_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: {
    PDU__SM__ActivatePDPContextRequest_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 (10<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest has 10 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) requestedNSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) requestedLLCSAPI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestedQoS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) requestedPDPaddress().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) accessPointName().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestType().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().set_param(*param.get_elem(9));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedNSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedNSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedLLCSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedLLCSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedPDPaddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedPDPaddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "accessPointName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessPointName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SM__ActivatePDPContextRequest_template* precondition = new PDU__SM__ActivatePDPContextRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SM__ActivatePDPContextRequest_template* implied_template = new PDU__SM__ActivatePDPContextRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SM__ActivatePDPContextRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SM__ActivatePDPContextRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_requestedNSAPI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_requestedLLCSAPI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_requestedQoS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_requestedPDPaddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_accessPointName.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_protocolConfigOpts.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_requestType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
single_value->field_nBIFOM__Container.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextRequest");
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.PDU_SM_ActivatePDPContextRequest");
}

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

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

PDU__SM__ActivatePDPContextAccept::PDU__SM__ActivatePDPContextAccept()
{
}

PDU__SM__ActivatePDPContextAccept::PDU__SM__ActivatePDPContextAccept(const BITSTRING& par_messageType,
    const LLC__SAPIV& par_negotiatedLLCSAPI,
    const QoSLV& par_negotiatedQoS,
    const RadioPriorityV& par_radioPriority,
    const BITSTRING& par_spare,
    const OPTIONAL< PDPAddressTLV >& par_pdpAddress,
    const OPTIONAL< ProtocolConfigOptionsTLV >& par_protocolConfigOpts,
    const OPTIONAL< PacketFlowIDTLV >& par_packetFlowID,
    const OPTIONAL< SMCause2TLV >& par_sMCause2,
    const OPTIONAL< ConnectivityTypeTV >& par_connectivityType,
    const OPTIONAL< WLANOffloadAcceptabilityTV >& par_wLANOffloadIndication,
    const OPTIONAL< NBIFOM__ContainerTLV >& par_nBIFOM__Container)
  :   field_messageType(par_messageType),
  field_negotiatedLLCSAPI(par_negotiatedLLCSAPI),
  field_negotiatedQoS(par_negotiatedQoS),
  field_radioPriority(par_radioPriority),
  field_spare(par_spare),
  field_pdpAddress(par_pdpAddress),
  field_protocolConfigOpts(par_protocolConfigOpts),
  field_packetFlowID(par_packetFlowID),
  field_sMCause2(par_sMCause2),
  field_connectivityType(par_connectivityType),
  field_wLANOffloadIndication(par_wLANOffloadIndication),
  field_nBIFOM__Container(par_nBIFOM__Container)
{
}

PDU__SM__ActivatePDPContextAccept::PDU__SM__ActivatePDPContextAccept(const PDU__SM__ActivatePDPContextAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.negotiatedLLCSAPI().is_bound()) field_negotiatedLLCSAPI = other_value.negotiatedLLCSAPI();
else field_negotiatedLLCSAPI.clean_up();
if (other_value.negotiatedQoS().is_bound()) field_negotiatedQoS = other_value.negotiatedQoS();
else field_negotiatedQoS.clean_up();
if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
else field_radioPriority.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.pdpAddress().is_bound()) field_pdpAddress = other_value.pdpAddress();
else field_pdpAddress.clean_up();
if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
else field_protocolConfigOpts.clean_up();
if (other_value.packetFlowID().is_bound()) field_packetFlowID = other_value.packetFlowID();
else field_packetFlowID.clean_up();
if (other_value.sMCause2().is_bound()) field_sMCause2 = other_value.sMCause2();
else field_sMCause2.clean_up();
if (other_value.connectivityType().is_bound()) field_connectivityType = other_value.connectivityType();
else field_connectivityType.clean_up();
if (other_value.wLANOffloadIndication().is_bound()) field_wLANOffloadIndication = other_value.wLANOffloadIndication();
else field_wLANOffloadIndication.clean_up();
if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
else field_nBIFOM__Container.clean_up();
}

void PDU__SM__ActivatePDPContextAccept::clean_up()
{
field_messageType.clean_up();
field_negotiatedLLCSAPI.clean_up();
field_negotiatedQoS.clean_up();
field_radioPriority.clean_up();
field_spare.clean_up();
field_pdpAddress.clean_up();
field_protocolConfigOpts.clean_up();
field_packetFlowID.clean_up();
field_sMCause2.clean_up();
field_connectivityType.clean_up();
field_wLANOffloadIndication.clean_up();
field_nBIFOM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SM__ActivatePDPContextAccept::get_descriptor() const { return &PDU__SM__ActivatePDPContextAccept_descr_; }
PDU__SM__ActivatePDPContextAccept& PDU__SM__ActivatePDPContextAccept::operator=(const PDU__SM__ActivatePDPContextAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.negotiatedLLCSAPI().is_bound()) field_negotiatedLLCSAPI = other_value.negotiatedLLCSAPI();
  else field_negotiatedLLCSAPI.clean_up();
  if (other_value.negotiatedQoS().is_bound()) field_negotiatedQoS = other_value.negotiatedQoS();
  else field_negotiatedQoS.clean_up();
  if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
  else field_radioPriority.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.pdpAddress().is_bound()) field_pdpAddress = other_value.pdpAddress();
  else field_pdpAddress.clean_up();
  if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
  else field_protocolConfigOpts.clean_up();
  if (other_value.packetFlowID().is_bound()) field_packetFlowID = other_value.packetFlowID();
  else field_packetFlowID.clean_up();
  if (other_value.sMCause2().is_bound()) field_sMCause2 = other_value.sMCause2();
  else field_sMCause2.clean_up();
  if (other_value.connectivityType().is_bound()) field_connectivityType = other_value.connectivityType();
  else field_connectivityType.clean_up();
  if (other_value.wLANOffloadIndication().is_bound()) field_wLANOffloadIndication = other_value.wLANOffloadIndication();
  else field_wLANOffloadIndication.clean_up();
  if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
  else field_nBIFOM__Container.clean_up();
}
return *this;
}

boolean PDU__SM__ActivatePDPContextAccept::operator==(const PDU__SM__ActivatePDPContextAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_negotiatedLLCSAPI==other_value.field_negotiatedLLCSAPI
  && field_negotiatedQoS==other_value.field_negotiatedQoS
  && field_radioPriority==other_value.field_radioPriority
  && field_spare==other_value.field_spare
  && field_pdpAddress==other_value.field_pdpAddress
  && field_protocolConfigOpts==other_value.field_protocolConfigOpts
  && field_packetFlowID==other_value.field_packetFlowID
  && field_sMCause2==other_value.field_sMCause2
  && field_connectivityType==other_value.field_connectivityType
  && field_wLANOffloadIndication==other_value.field_wLANOffloadIndication
  && field_nBIFOM__Container==other_value.field_nBIFOM__Container;
}

boolean PDU__SM__ActivatePDPContextAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_negotiatedLLCSAPI.is_bound())
  || (field_negotiatedQoS.is_bound())
  || (field_radioPriority.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_pdpAddress.get_selection() || field_pdpAddress.is_bound())
  || (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_bound())
  || (OPTIONAL_OMIT == field_packetFlowID.get_selection() || field_packetFlowID.is_bound())
  || (OPTIONAL_OMIT == field_sMCause2.get_selection() || field_sMCause2.is_bound())
  || (OPTIONAL_OMIT == field_connectivityType.get_selection() || field_connectivityType.is_bound())
  || (OPTIONAL_OMIT == field_wLANOffloadIndication.get_selection() || field_wLANOffloadIndication.is_bound())
  || (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_bound());
}
boolean PDU__SM__ActivatePDPContextAccept::is_value() const
{
return field_messageType.is_value()
  && field_negotiatedLLCSAPI.is_value()
  && field_negotiatedQoS.is_value()
  && field_radioPriority.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_pdpAddress.get_selection() || field_pdpAddress.is_value())
  && (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_value())
  && (OPTIONAL_OMIT == field_packetFlowID.get_selection() || field_packetFlowID.is_value())
  && (OPTIONAL_OMIT == field_sMCause2.get_selection() || field_sMCause2.is_value())
  && (OPTIONAL_OMIT == field_connectivityType.get_selection() || field_connectivityType.is_value())
  && (OPTIONAL_OMIT == field_wLANOffloadIndication.get_selection() || field_wLANOffloadIndication.is_value())
  && (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_value());
}
int PDU__SM__ActivatePDPContextAccept::size_of() const
{
  int ret_val = 5;
  if (field_pdpAddress.ispresent()) ret_val++;
  if (field_protocolConfigOpts.ispresent()) ret_val++;
  if (field_packetFlowID.ispresent()) ret_val++;
  if (field_sMCause2.ispresent()) ret_val++;
  if (field_connectivityType.ispresent()) ret_val++;
  if (field_wLANOffloadIndication.ispresent()) ret_val++;
  if (field_nBIFOM__Container.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SM__ActivatePDPContextAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", negotiatedLLCSAPI := ");
field_negotiatedLLCSAPI.log();
TTCN_Logger::log_event_str(", negotiatedQoS := ");
field_negotiatedQoS.log();
TTCN_Logger::log_event_str(", radioPriority := ");
field_radioPriority.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", pdpAddress := ");
field_pdpAddress.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", packetFlowID := ");
field_packetFlowID.log();
TTCN_Logger::log_event_str(", sMCause2 := ");
field_sMCause2.log();
TTCN_Logger::log_event_str(", connectivityType := ");
field_connectivityType.log();
TTCN_Logger::log_event_str(", wLANOffloadIndication := ");
field_wLANOffloadIndication.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
field_nBIFOM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SM__ActivatePDPContextAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (negotiatedLLCSAPI().is_bound()) negotiatedLLCSAPI().set_implicit_omit();
if (negotiatedQoS().is_bound()) negotiatedQoS().set_implicit_omit();
if (radioPriority().is_bound()) radioPriority().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!pdpAddress().is_bound()) pdpAddress() = OMIT_VALUE;
else pdpAddress().set_implicit_omit();
if (!protocolConfigOpts().is_bound()) protocolConfigOpts() = OMIT_VALUE;
else protocolConfigOpts().set_implicit_omit();
if (!packetFlowID().is_bound()) packetFlowID() = OMIT_VALUE;
else packetFlowID().set_implicit_omit();
if (!sMCause2().is_bound()) sMCause2() = OMIT_VALUE;
else sMCause2().set_implicit_omit();
if (!connectivityType().is_bound()) connectivityType() = OMIT_VALUE;
else connectivityType().set_implicit_omit();
if (!wLANOffloadIndication().is_bound()) wLANOffloadIndication() = OMIT_VALUE;
else wLANOffloadIndication().set_implicit_omit();
if (!nBIFOM__Container().is_bound()) nBIFOM__Container() = OMIT_VALUE;
else nBIFOM__Container().set_implicit_omit();
}

void PDU__SM__ActivatePDPContextAccept::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 (12<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept has 12 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) negotiatedLLCSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) negotiatedQoS().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pdpAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) packetFlowID().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sMCause2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) connectivityType().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) wLANOffloadIndication().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().set_param(*param.get_elem(11));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "negotiatedLLCSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          negotiatedLLCSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "negotiatedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          negotiatedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "pdpAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFlowID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFlowID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sMCause2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sMCause2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectivityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectivityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "wLANOffloadIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          wLANOffloadIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
  }
}

void PDU__SM__ActivatePDPContextAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_negotiatedLLCSAPI.encode_text(text_buf);
field_negotiatedQoS.encode_text(text_buf);
field_radioPriority.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_pdpAddress.encode_text(text_buf);
field_protocolConfigOpts.encode_text(text_buf);
field_packetFlowID.encode_text(text_buf);
field_sMCause2.encode_text(text_buf);
field_connectivityType.encode_text(text_buf);
field_wLANOffloadIndication.encode_text(text_buf);
field_nBIFOM__Container.encode_text(text_buf);
}

void PDU__SM__ActivatePDPContextAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_negotiatedLLCSAPI.decode_text(text_buf);
field_negotiatedQoS.decode_text(text_buf);
field_radioPriority.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_pdpAddress.decode_text(text_buf);
field_protocolConfigOpts.decode_text(text_buf);
field_packetFlowID.decode_text(text_buf);
field_sMCause2.decode_text(text_buf);
field_connectivityType.decode_text(text_buf);
field_wLANOffloadIndication.decode_text(text_buf);
field_nBIFOM__Container.decode_text(text_buf);
}

void PDU__SM__ActivatePDPContextAccept::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 PDU__SM__ActivatePDPContextAccept::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 PDU__SM__ActivatePDPContextAccept::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_messageType.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, LLC__SAPIV_descr_.raw->forceomit);
  decoded_field_length = field_negotiatedLLCSAPI.RAW_decode(LLC__SAPIV_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, QoSLV_descr_.raw->forceomit);
  decoded_field_length = field_negotiatedQoS.RAW_decode(QoSLV_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, RadioPriorityV_descr_.raw->forceomit);
  decoded_field_length = field_radioPriority.RAW_decode(RadioPriorityV_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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_pdpAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, PDPAddressTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpAddress().RAW_decode(PDPAddressTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_pdpAddress = 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_pdpAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_protocolConfigOpts = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ProtocolConfigOptionsTLV_descr_.raw->forceomit);
  decoded_field_length = field_protocolConfigOpts().RAW_decode(ProtocolConfigOptionsTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_protocolConfigOpts = 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_protocolConfigOpts=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_packetFlowID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, PacketFlowIDTLV_descr_.raw->forceomit);
  decoded_field_length = field_packetFlowID().RAW_decode(PacketFlowIDTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_packetFlowID = 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_packetFlowID=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_sMCause2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, SMCause2TLV_descr_.raw->forceomit);
  decoded_field_length = field_sMCause2().RAW_decode(SMCause2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_sMCause2 = 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_sMCause2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_connectivityType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, ConnectivityTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_connectivityType().RAW_decode(ConnectivityTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_connectivityType = 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_connectivityType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_wLANOffloadIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, WLANOffloadAcceptabilityTV_descr_.raw->forceomit);
  decoded_field_length = field_wLANOffloadIndication().RAW_decode(WLANOffloadAcceptabilityTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_wLANOffloadIndication = 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_wLANOffloadIndication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_nBIFOM__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, NBIFOM__ContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_nBIFOM__Container().RAW_decode(NBIFOM__ContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_nBIFOM__Container = 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_nBIFOM__Container=OMIT_VALUE;
  if (field_messageType !=  bs_52) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SM__ActivatePDPContextAccept::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 = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  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, LLC__SAPIV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, QoSLV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RadioPriorityV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT4_descr_.raw);
  if (field_pdpAddress.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, PDPAddressTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_protocolConfigOpts.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ProtocolConfigOptionsTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_packetFlowID.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, PacketFlowIDTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_sMCause2.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, SMCause2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_connectivityType.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, ConnectivityTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_wLANOffloadIndication.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, WLANOffloadAcceptabilityTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_nBIFOM__Container.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, NBIFOM__ContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_negotiatedLLCSAPI.RAW_encode(LLC__SAPIV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_negotiatedQoS.RAW_encode(QoSLV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_radioPriority.RAW_encode(RadioPriorityV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[4]);
  if (field_pdpAddress.ispresent()) {
  encoded_length += field_pdpAddress().RAW_encode(PDPAddressTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_protocolConfigOpts.ispresent()) {
  encoded_length += field_protocolConfigOpts().RAW_encode(ProtocolConfigOptionsTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_packetFlowID.ispresent()) {
  encoded_length += field_packetFlowID().RAW_encode(PacketFlowIDTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_sMCause2.ispresent()) {
  encoded_length += field_sMCause2().RAW_encode(SMCause2TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_connectivityType.ispresent()) {
  encoded_length += field_connectivityType().RAW_encode(ConnectivityTypeTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_wLANOffloadIndication.ispresent()) {
  encoded_length += field_wLANOffloadIndication().RAW_encode(WLANOffloadAcceptabilityTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_nBIFOM__Container.ispresent()) {
  encoded_length += field_nBIFOM__Container().RAW_encode(NBIFOM__ContainerTLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_messageType !=  bs_52) {
  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_52.RAW_encode(General__Types::BIT8_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 PDU__SM__ActivatePDPContextAccept_template::single_value_struct {
BITSTRING_template field_messageType;
LLC__SAPIV_template field_negotiatedLLCSAPI;
QoSLV_template field_negotiatedQoS;
RadioPriorityV_template field_radioPriority;
BITSTRING_template field_spare;
PDPAddressTLV_template field_pdpAddress;
ProtocolConfigOptionsTLV_template field_protocolConfigOpts;
PacketFlowIDTLV_template field_packetFlowID;
SMCause2TLV_template field_sMCause2;
ConnectivityTypeTV_template field_connectivityType;
WLANOffloadAcceptabilityTV_template field_wLANOffloadIndication;
NBIFOM__ContainerTLV_template field_nBIFOM__Container;
};

void PDU__SM__ActivatePDPContextAccept_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_messageType = ANY_VALUE;
single_value->field_negotiatedLLCSAPI = ANY_VALUE;
single_value->field_negotiatedQoS = ANY_VALUE;
single_value->field_radioPriority = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_pdpAddress = ANY_OR_OMIT;
single_value->field_protocolConfigOpts = ANY_OR_OMIT;
single_value->field_packetFlowID = ANY_OR_OMIT;
single_value->field_sMCause2 = ANY_OR_OMIT;
single_value->field_connectivityType = ANY_OR_OMIT;
single_value->field_wLANOffloadIndication = ANY_OR_OMIT;
single_value->field_nBIFOM__Container = ANY_OR_OMIT;
}
}
}

void PDU__SM__ActivatePDPContextAccept_template::copy_value(const PDU__SM__ActivatePDPContextAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.negotiatedLLCSAPI().is_bound()) {
  single_value->field_negotiatedLLCSAPI = other_value.negotiatedLLCSAPI();
} else {
  single_value->field_negotiatedLLCSAPI.clean_up();
}
if (other_value.negotiatedQoS().is_bound()) {
  single_value->field_negotiatedQoS = other_value.negotiatedQoS();
} else {
  single_value->field_negotiatedQoS.clean_up();
}
if (other_value.radioPriority().is_bound()) {
  single_value->field_radioPriority = other_value.radioPriority();
} else {
  single_value->field_radioPriority.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.pdpAddress().is_bound()) {
  if (other_value.pdpAddress().ispresent()) single_value->field_pdpAddress = other_value.pdpAddress()();
  else single_value->field_pdpAddress = OMIT_VALUE;
} else {
  single_value->field_pdpAddress.clean_up();
}
if (other_value.protocolConfigOpts().is_bound()) {
  if (other_value.protocolConfigOpts().ispresent()) single_value->field_protocolConfigOpts = other_value.protocolConfigOpts()();
  else single_value->field_protocolConfigOpts = OMIT_VALUE;
} else {
  single_value->field_protocolConfigOpts.clean_up();
}
if (other_value.packetFlowID().is_bound()) {
  if (other_value.packetFlowID().ispresent()) single_value->field_packetFlowID = other_value.packetFlowID()();
  else single_value->field_packetFlowID = OMIT_VALUE;
} else {
  single_value->field_packetFlowID.clean_up();
}
if (other_value.sMCause2().is_bound()) {
  if (other_value.sMCause2().ispresent()) single_value->field_sMCause2 = other_value.sMCause2()();
  else single_value->field_sMCause2 = OMIT_VALUE;
} else {
  single_value->field_sMCause2.clean_up();
}
if (other_value.connectivityType().is_bound()) {
  if (other_value.connectivityType().ispresent()) single_value->field_connectivityType = other_value.connectivityType()();
  else single_value->field_connectivityType = OMIT_VALUE;
} else {
  single_value->field_connectivityType.clean_up();
}
if (other_value.wLANOffloadIndication().is_bound()) {
  if (other_value.wLANOffloadIndication().ispresent()) single_value->field_wLANOffloadIndication = other_value.wLANOffloadIndication()();
  else single_value->field_wLANOffloadIndication = OMIT_VALUE;
} else {
  single_value->field_wLANOffloadIndication.clean_up();
}
if (other_value.nBIFOM__Container().is_bound()) {
  if (other_value.nBIFOM__Container().ispresent()) single_value->field_nBIFOM__Container = other_value.nBIFOM__Container()();
  else single_value->field_nBIFOM__Container = OMIT_VALUE;
} else {
  single_value->field_nBIFOM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SM__ActivatePDPContextAccept_template::copy_template(const PDU__SM__ActivatePDPContextAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.negotiatedLLCSAPI().get_selection()) {
single_value->field_negotiatedLLCSAPI = other_value.negotiatedLLCSAPI();
} else {
single_value->field_negotiatedLLCSAPI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.negotiatedQoS().get_selection()) {
single_value->field_negotiatedQoS = other_value.negotiatedQoS();
} else {
single_value->field_negotiatedQoS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radioPriority().get_selection()) {
single_value->field_radioPriority = other_value.radioPriority();
} else {
single_value->field_radioPriority.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.pdpAddress().get_selection()) {
single_value->field_pdpAddress = other_value.pdpAddress();
} else {
single_value->field_pdpAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolConfigOpts().get_selection()) {
single_value->field_protocolConfigOpts = other_value.protocolConfigOpts();
} else {
single_value->field_protocolConfigOpts.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.packetFlowID().get_selection()) {
single_value->field_packetFlowID = other_value.packetFlowID();
} else {
single_value->field_packetFlowID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sMCause2().get_selection()) {
single_value->field_sMCause2 = other_value.sMCause2();
} else {
single_value->field_sMCause2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.connectivityType().get_selection()) {
single_value->field_connectivityType = other_value.connectivityType();
} else {
single_value->field_connectivityType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.wLANOffloadIndication().get_selection()) {
single_value->field_wLANOffloadIndication = other_value.wLANOffloadIndication();
} else {
single_value->field_wLANOffloadIndication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nBIFOM__Container().get_selection()) {
single_value->field_nBIFOM__Container = other_value.nBIFOM__Container();
} else {
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextAccept_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 PDU__SM__ActivatePDPContextAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SM__ActivatePDPContextAccept_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.PDU_SM_ActivatePDPContextAccept.");
break;
}
set_selection(other_value);
}

PDU__SM__ActivatePDPContextAccept_template::PDU__SM__ActivatePDPContextAccept_template()
{
}

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

PDU__SM__ActivatePDPContextAccept_template::PDU__SM__ActivatePDPContextAccept_template(const PDU__SM__ActivatePDPContextAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SM__ActivatePDPContextAccept_template::match(const PDU__SM__ActivatePDPContextAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.negotiatedLLCSAPI().is_bound()) return FALSE;
if(!single_value->field_negotiatedLLCSAPI.match(other_value.negotiatedLLCSAPI(), legacy))return FALSE;
if(!other_value.negotiatedQoS().is_bound()) return FALSE;
if(!single_value->field_negotiatedQoS.match(other_value.negotiatedQoS(), legacy))return FALSE;
if(!other_value.radioPriority().is_bound()) return FALSE;
if(!single_value->field_radioPriority.match(other_value.radioPriority(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.pdpAddress().is_bound()) return FALSE;
if((other_value.pdpAddress().ispresent() ? !single_value->field_pdpAddress.match((const PDPAddressTLV&)other_value.pdpAddress(), legacy) : !single_value->field_pdpAddress.match_omit(legacy)))return FALSE;
if(!other_value.protocolConfigOpts().is_bound()) return FALSE;
if((other_value.protocolConfigOpts().ispresent() ? !single_value->field_protocolConfigOpts.match((const ProtocolConfigOptionsTLV&)other_value.protocolConfigOpts(), legacy) : !single_value->field_protocolConfigOpts.match_omit(legacy)))return FALSE;
if(!other_value.packetFlowID().is_bound()) return FALSE;
if((other_value.packetFlowID().ispresent() ? !single_value->field_packetFlowID.match((const PacketFlowIDTLV&)other_value.packetFlowID(), legacy) : !single_value->field_packetFlowID.match_omit(legacy)))return FALSE;
if(!other_value.sMCause2().is_bound()) return FALSE;
if((other_value.sMCause2().ispresent() ? !single_value->field_sMCause2.match((const SMCause2TLV&)other_value.sMCause2(), legacy) : !single_value->field_sMCause2.match_omit(legacy)))return FALSE;
if(!other_value.connectivityType().is_bound()) return FALSE;
if((other_value.connectivityType().ispresent() ? !single_value->field_connectivityType.match((const ConnectivityTypeTV&)other_value.connectivityType(), legacy) : !single_value->field_connectivityType.match_omit(legacy)))return FALSE;
if(!other_value.wLANOffloadIndication().is_bound()) return FALSE;
if((other_value.wLANOffloadIndication().ispresent() ? !single_value->field_wLANOffloadIndication.match((const WLANOffloadAcceptabilityTV&)other_value.wLANOffloadIndication(), legacy) : !single_value->field_wLANOffloadIndication.match_omit(legacy)))return FALSE;
if(!other_value.nBIFOM__Container().is_bound()) return FALSE;
if((other_value.nBIFOM__Container().ispresent() ? !single_value->field_nBIFOM__Container.match((const NBIFOM__ContainerTLV&)other_value.nBIFOM__Container(), legacy) : !single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextAccept.");
}
return FALSE;
}

boolean PDU__SM__ActivatePDPContextAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_negotiatedLLCSAPI.is_bound()
 || single_value->field_negotiatedQoS.is_bound()
 || single_value->field_radioPriority.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_pdpAddress.is_omit() || single_value->field_pdpAddress.is_bound())
 || (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_bound())
 || (single_value->field_packetFlowID.is_omit() || single_value->field_packetFlowID.is_bound())
 || (single_value->field_sMCause2.is_omit() || single_value->field_sMCause2.is_bound())
 || (single_value->field_connectivityType.is_omit() || single_value->field_connectivityType.is_bound())
 || (single_value->field_wLANOffloadIndication.is_omit() || single_value->field_wLANOffloadIndication.is_bound())
 || (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_bound());
}

boolean PDU__SM__ActivatePDPContextAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_negotiatedLLCSAPI.is_value()
 && single_value->field_negotiatedQoS.is_value()
 && single_value->field_radioPriority.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_pdpAddress.is_omit() || single_value->field_pdpAddress.is_value())
 && (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_value())
 && (single_value->field_packetFlowID.is_omit() || single_value->field_packetFlowID.is_value())
 && (single_value->field_sMCause2.is_omit() || single_value->field_sMCause2.is_value())
 && (single_value->field_connectivityType.is_omit() || single_value->field_connectivityType.is_value())
 && (single_value->field_wLANOffloadIndication.is_omit() || single_value->field_wLANOffloadIndication.is_value())
 && (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_value());
}

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

PDU__SM__ActivatePDPContextAccept PDU__SM__ActivatePDPContextAccept_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.PDU_SM_ActivatePDPContextAccept.");
PDU__SM__ActivatePDPContextAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_negotiatedLLCSAPI.is_bound()) {
ret_val.negotiatedLLCSAPI() = single_value->field_negotiatedLLCSAPI.valueof();
}
if (single_value->field_negotiatedQoS.is_bound()) {
ret_val.negotiatedQoS() = single_value->field_negotiatedQoS.valueof();
}
if (single_value->field_radioPriority.is_bound()) {
ret_val.radioPriority() = single_value->field_radioPriority.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_pdpAddress.is_omit()) ret_val.pdpAddress() = OMIT_VALUE;
else if (single_value->field_pdpAddress.is_bound()) {
ret_val.pdpAddress() = single_value->field_pdpAddress.valueof();
}
if (single_value->field_protocolConfigOpts.is_omit()) ret_val.protocolConfigOpts() = OMIT_VALUE;
else if (single_value->field_protocolConfigOpts.is_bound()) {
ret_val.protocolConfigOpts() = single_value->field_protocolConfigOpts.valueof();
}
if (single_value->field_packetFlowID.is_omit()) ret_val.packetFlowID() = OMIT_VALUE;
else if (single_value->field_packetFlowID.is_bound()) {
ret_val.packetFlowID() = single_value->field_packetFlowID.valueof();
}
if (single_value->field_sMCause2.is_omit()) ret_val.sMCause2() = OMIT_VALUE;
else if (single_value->field_sMCause2.is_bound()) {
ret_val.sMCause2() = single_value->field_sMCause2.valueof();
}
if (single_value->field_connectivityType.is_omit()) ret_val.connectivityType() = OMIT_VALUE;
else if (single_value->field_connectivityType.is_bound()) {
ret_val.connectivityType() = single_value->field_connectivityType.valueof();
}
if (single_value->field_wLANOffloadIndication.is_omit()) ret_val.wLANOffloadIndication() = OMIT_VALUE;
else if (single_value->field_wLANOffloadIndication.is_bound()) {
ret_val.wLANOffloadIndication() = single_value->field_wLANOffloadIndication.valueof();
}
if (single_value->field_nBIFOM__Container.is_omit()) ret_val.nBIFOM__Container() = OMIT_VALUE;
else if (single_value->field_nBIFOM__Container.is_bound()) {
ret_val.nBIFOM__Container() = single_value->field_nBIFOM__Container.valueof();
}
return ret_val;
}

void PDU__SM__ActivatePDPContextAccept_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.PDU_SM_ActivatePDPContextAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SM__ActivatePDPContextAccept_template[list_length];
}

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

BITSTRING_template& PDU__SM__ActivatePDPContextAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__SM__ActivatePDPContextAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_messageType;
}

LLC__SAPIV_template& PDU__SM__ActivatePDPContextAccept_template::negotiatedLLCSAPI()
{
set_specific();
return single_value->field_negotiatedLLCSAPI;
}

const LLC__SAPIV_template& PDU__SM__ActivatePDPContextAccept_template::negotiatedLLCSAPI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field negotiatedLLCSAPI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_negotiatedLLCSAPI;
}

QoSLV_template& PDU__SM__ActivatePDPContextAccept_template::negotiatedQoS()
{
set_specific();
return single_value->field_negotiatedQoS;
}

const QoSLV_template& PDU__SM__ActivatePDPContextAccept_template::negotiatedQoS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field negotiatedQoS of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_negotiatedQoS;
}

RadioPriorityV_template& PDU__SM__ActivatePDPContextAccept_template::radioPriority()
{
set_specific();
return single_value->field_radioPriority;
}

const RadioPriorityV_template& PDU__SM__ActivatePDPContextAccept_template::radioPriority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioPriority of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_radioPriority;
}

BITSTRING_template& PDU__SM__ActivatePDPContextAccept_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__SM__ActivatePDPContextAccept_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_spare;
}

PDPAddressTLV_template& PDU__SM__ActivatePDPContextAccept_template::pdpAddress()
{
set_specific();
return single_value->field_pdpAddress;
}

const PDPAddressTLV_template& PDU__SM__ActivatePDPContextAccept_template::pdpAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpAddress of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_pdpAddress;
}

ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextAccept_template::protocolConfigOpts()
{
set_specific();
return single_value->field_protocolConfigOpts;
}

const ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextAccept_template::protocolConfigOpts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolConfigOpts of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_protocolConfigOpts;
}

PacketFlowIDTLV_template& PDU__SM__ActivatePDPContextAccept_template::packetFlowID()
{
set_specific();
return single_value->field_packetFlowID;
}

const PacketFlowIDTLV_template& PDU__SM__ActivatePDPContextAccept_template::packetFlowID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetFlowID of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_packetFlowID;
}

SMCause2TLV_template& PDU__SM__ActivatePDPContextAccept_template::sMCause2()
{
set_specific();
return single_value->field_sMCause2;
}

const SMCause2TLV_template& PDU__SM__ActivatePDPContextAccept_template::sMCause2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sMCause2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_sMCause2;
}

ConnectivityTypeTV_template& PDU__SM__ActivatePDPContextAccept_template::connectivityType()
{
set_specific();
return single_value->field_connectivityType;
}

const ConnectivityTypeTV_template& PDU__SM__ActivatePDPContextAccept_template::connectivityType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field connectivityType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_connectivityType;
}

WLANOffloadAcceptabilityTV_template& PDU__SM__ActivatePDPContextAccept_template::wLANOffloadIndication()
{
set_specific();
return single_value->field_wLANOffloadIndication;
}

const WLANOffloadAcceptabilityTV_template& PDU__SM__ActivatePDPContextAccept_template::wLANOffloadIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field wLANOffloadIndication of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_wLANOffloadIndication;
}

NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextAccept_template::nBIFOM__Container()
{
set_specific();
return single_value->field_nBIFOM__Container;
}

const NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextAccept_template::nBIFOM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nBIFOM_Container of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
return single_value->field_nBIFOM__Container;
}

int PDU__SM__ActivatePDPContextAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_pdpAddress.is_present()) ret_val++;
      if (single_value->field_protocolConfigOpts.is_present()) ret_val++;
      if (single_value->field_packetFlowID.is_present()) ret_val++;
      if (single_value->field_sMCause2.is_present()) ret_val++;
      if (single_value->field_connectivityType.is_present()) ret_val++;
      if (single_value->field_wLANOffloadIndication.is_present()) ret_val++;
      if (single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextAccept 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.PDU_SM_ActivatePDPContextAccept 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.PDU_SM_ActivatePDPContextAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept.");
  }
  return 0;
}

void PDU__SM__ActivatePDPContextAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", negotiatedLLCSAPI := ");
single_value->field_negotiatedLLCSAPI.log();
TTCN_Logger::log_event_str(", negotiatedQoS := ");
single_value->field_negotiatedQoS.log();
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", pdpAddress := ");
single_value->field_pdpAddress.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", packetFlowID := ");
single_value->field_packetFlowID.log();
TTCN_Logger::log_event_str(", sMCause2 := ");
single_value->field_sMCause2.log();
TTCN_Logger::log_event_str(", connectivityType := ");
single_value->field_connectivityType.log();
TTCN_Logger::log_event_str(", wLANOffloadIndication := ");
single_value->field_wLANOffloadIndication.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextAccept_template::log_match(const PDU__SM__ActivatePDPContextAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_negotiatedLLCSAPI.match(match_value.negotiatedLLCSAPI(), legacy)){
TTCN_Logger::log_logmatch_info(".negotiatedLLCSAPI");
single_value->field_negotiatedLLCSAPI.log_match(match_value.negotiatedLLCSAPI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_negotiatedQoS.match(match_value.negotiatedQoS(), legacy)){
TTCN_Logger::log_logmatch_info(".negotiatedQoS");
single_value->field_negotiatedQoS.log_match(match_value.negotiatedQoS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radioPriority.match(match_value.radioPriority(), legacy)){
TTCN_Logger::log_logmatch_info(".radioPriority");
single_value->field_radioPriority.log_match(match_value.radioPriority(), 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);
}
if (match_value.pdpAddress().ispresent()){
if(!single_value->field_pdpAddress.match(match_value.pdpAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpAddress");
single_value->field_pdpAddress.log_match(match_value.pdpAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.protocolConfigOpts().ispresent()){
if(!single_value->field_protocolConfigOpts.match(match_value.protocolConfigOpts(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolConfigOpts");
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolConfigOpts.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolConfigOpts := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.packetFlowID().ispresent()){
if(!single_value->field_packetFlowID.match(match_value.packetFlowID(), legacy)){
TTCN_Logger::log_logmatch_info(".packetFlowID");
single_value->field_packetFlowID.log_match(match_value.packetFlowID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_packetFlowID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".packetFlowID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_packetFlowID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sMCause2().ispresent()){
if(!single_value->field_sMCause2.match(match_value.sMCause2(), legacy)){
TTCN_Logger::log_logmatch_info(".sMCause2");
single_value->field_sMCause2.log_match(match_value.sMCause2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sMCause2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sMCause2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sMCause2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.connectivityType().ispresent()){
if(!single_value->field_connectivityType.match(match_value.connectivityType(), legacy)){
TTCN_Logger::log_logmatch_info(".connectivityType");
single_value->field_connectivityType.log_match(match_value.connectivityType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_connectivityType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".connectivityType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_connectivityType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.wLANOffloadIndication().ispresent()){
if(!single_value->field_wLANOffloadIndication.match(match_value.wLANOffloadIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".wLANOffloadIndication");
single_value->field_wLANOffloadIndication.log_match(match_value.wLANOffloadIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_wLANOffloadIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".wLANOffloadIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_wLANOffloadIndication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nBIFOM__Container().ispresent()){
if(!single_value->field_nBIFOM__Container.match(match_value.nBIFOM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".nBIFOM_Container");
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nBIFOM__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nBIFOM_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nBIFOM__Container.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", negotiatedLLCSAPI := ");
single_value->field_negotiatedLLCSAPI.log_match(match_value.negotiatedLLCSAPI(), legacy);
TTCN_Logger::log_event_str(", negotiatedQoS := ");
single_value->field_negotiatedQoS.log_match(match_value.negotiatedQoS(), legacy);
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log_match(match_value.radioPriority(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", pdpAddress := ");
if (match_value.pdpAddress().ispresent()) {
single_value->field_pdpAddress.log_match(match_value.pdpAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpAddress.log();
if (single_value->field_pdpAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
if (match_value.protocolConfigOpts().ispresent()) {
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolConfigOpts.log();
if (single_value->field_protocolConfigOpts.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", packetFlowID := ");
if (match_value.packetFlowID().ispresent()) {
single_value->field_packetFlowID.log_match(match_value.packetFlowID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_packetFlowID.log();
if (single_value->field_packetFlowID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sMCause2 := ");
if (match_value.sMCause2().ispresent()) {
single_value->field_sMCause2.log_match(match_value.sMCause2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sMCause2.log();
if (single_value->field_sMCause2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", connectivityType := ");
if (match_value.connectivityType().ispresent()) {
single_value->field_connectivityType.log_match(match_value.connectivityType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_connectivityType.log();
if (single_value->field_connectivityType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", wLANOffloadIndication := ");
if (match_value.wLANOffloadIndication().ispresent()) {
single_value->field_wLANOffloadIndication.log_match(match_value.wLANOffloadIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_wLANOffloadIndication.log();
if (single_value->field_wLANOffloadIndication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
if (match_value.nBIFOM__Container().ispresent()) {
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nBIFOM__Container.log();
if (single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_negotiatedLLCSAPI.encode_text(text_buf);
single_value->field_negotiatedQoS.encode_text(text_buf);
single_value->field_radioPriority.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_pdpAddress.encode_text(text_buf);
single_value->field_protocolConfigOpts.encode_text(text_buf);
single_value->field_packetFlowID.encode_text(text_buf);
single_value->field_sMCause2.encode_text(text_buf);
single_value->field_connectivityType.encode_text(text_buf);
single_value->field_wLANOffloadIndication.encode_text(text_buf);
single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextAccept.");
}
}

void PDU__SM__ActivatePDPContextAccept_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_messageType.decode_text(text_buf);
single_value->field_negotiatedLLCSAPI.decode_text(text_buf);
single_value->field_negotiatedQoS.decode_text(text_buf);
single_value->field_radioPriority.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_pdpAddress.decode_text(text_buf);
single_value->field_protocolConfigOpts.decode_text(text_buf);
single_value->field_packetFlowID.decode_text(text_buf);
single_value->field_sMCause2.decode_text(text_buf);
single_value->field_connectivityType.decode_text(text_buf);
single_value->field_wLANOffloadIndication.decode_text(text_buf);
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextAccept_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.PDU_SM_ActivatePDPContextAccept.");
}
}

void PDU__SM__ActivatePDPContextAccept_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: {
    PDU__SM__ActivatePDPContextAccept_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 (12<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept has 12 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) negotiatedLLCSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) negotiatedQoS().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pdpAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) packetFlowID().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) sMCause2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) connectivityType().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) wLANOffloadIndication().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().set_param(*param.get_elem(11));
    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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "negotiatedLLCSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          negotiatedLLCSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "negotiatedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          negotiatedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "pdpAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetFlowID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetFlowID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sMCause2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sMCause2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectivityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectivityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "wLANOffloadIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          wLANOffloadIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SM__ActivatePDPContextAccept_template* precondition = new PDU__SM__ActivatePDPContextAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SM__ActivatePDPContextAccept_template* implied_template = new PDU__SM__ActivatePDPContextAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SM__ActivatePDPContextAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SM__ActivatePDPContextAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_negotiatedLLCSAPI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_negotiatedQoS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_radioPriority.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_pdpAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_protocolConfigOpts.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_packetFlowID.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_sMCause2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_connectivityType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_wLANOffloadIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
single_value->field_nBIFOM__Container.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextAccept");
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.PDU_SM_ActivatePDPContextAccept");
}

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

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

PDU__SM__ActivatePDPContextReject::PDU__SM__ActivatePDPContextReject()
{
}

PDU__SM__ActivatePDPContextReject::PDU__SM__ActivatePDPContextReject(const BITSTRING& par_messageType,
    const OCTETSTRING& par_smCause,
    const OPTIONAL< ProtocolConfigOptionsTLV >& par_protocolConfigOpts,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_backOffTimer,
    const OPTIONAL< ReAttemptIndicatorTLV >& par_reAttemptIndicator,
    const OPTIONAL< NBIFOM__ContainerTLV >& par_nBIFOM__Container)
  :   field_messageType(par_messageType),
  field_smCause(par_smCause),
  field_protocolConfigOpts(par_protocolConfigOpts),
  field_backOffTimer(par_backOffTimer),
  field_reAttemptIndicator(par_reAttemptIndicator),
  field_nBIFOM__Container(par_nBIFOM__Container)
{
}

PDU__SM__ActivatePDPContextReject::PDU__SM__ActivatePDPContextReject(const PDU__SM__ActivatePDPContextReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.smCause().is_bound()) field_smCause = other_value.smCause();
else field_smCause.clean_up();
if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
else field_protocolConfigOpts.clean_up();
if (other_value.backOffTimer().is_bound()) field_backOffTimer = other_value.backOffTimer();
else field_backOffTimer.clean_up();
if (other_value.reAttemptIndicator().is_bound()) field_reAttemptIndicator = other_value.reAttemptIndicator();
else field_reAttemptIndicator.clean_up();
if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
else field_nBIFOM__Container.clean_up();
}

void PDU__SM__ActivatePDPContextReject::clean_up()
{
field_messageType.clean_up();
field_smCause.clean_up();
field_protocolConfigOpts.clean_up();
field_backOffTimer.clean_up();
field_reAttemptIndicator.clean_up();
field_nBIFOM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SM__ActivatePDPContextReject::get_descriptor() const { return &PDU__SM__ActivatePDPContextReject_descr_; }
PDU__SM__ActivatePDPContextReject& PDU__SM__ActivatePDPContextReject::operator=(const PDU__SM__ActivatePDPContextReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.smCause().is_bound()) field_smCause = other_value.smCause();
  else field_smCause.clean_up();
  if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
  else field_protocolConfigOpts.clean_up();
  if (other_value.backOffTimer().is_bound()) field_backOffTimer = other_value.backOffTimer();
  else field_backOffTimer.clean_up();
  if (other_value.reAttemptIndicator().is_bound()) field_reAttemptIndicator = other_value.reAttemptIndicator();
  else field_reAttemptIndicator.clean_up();
  if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
  else field_nBIFOM__Container.clean_up();
}
return *this;
}

boolean PDU__SM__ActivatePDPContextReject::operator==(const PDU__SM__ActivatePDPContextReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_smCause==other_value.field_smCause
  && field_protocolConfigOpts==other_value.field_protocolConfigOpts
  && field_backOffTimer==other_value.field_backOffTimer
  && field_reAttemptIndicator==other_value.field_reAttemptIndicator
  && field_nBIFOM__Container==other_value.field_nBIFOM__Container;
}

boolean PDU__SM__ActivatePDPContextReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_smCause.is_bound())
  || (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_bound())
  || (OPTIONAL_OMIT == field_backOffTimer.get_selection() || field_backOffTimer.is_bound())
  || (OPTIONAL_OMIT == field_reAttemptIndicator.get_selection() || field_reAttemptIndicator.is_bound())
  || (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_bound());
}
boolean PDU__SM__ActivatePDPContextReject::is_value() const
{
return field_messageType.is_value()
  && field_smCause.is_value()
  && (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_value())
  && (OPTIONAL_OMIT == field_backOffTimer.get_selection() || field_backOffTimer.is_value())
  && (OPTIONAL_OMIT == field_reAttemptIndicator.get_selection() || field_reAttemptIndicator.is_value())
  && (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_value());
}
int PDU__SM__ActivatePDPContextReject::size_of() const
{
  int ret_val = 2;
  if (field_protocolConfigOpts.ispresent()) ret_val++;
  if (field_backOffTimer.ispresent()) ret_val++;
  if (field_reAttemptIndicator.ispresent()) ret_val++;
  if (field_nBIFOM__Container.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SM__ActivatePDPContextReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", smCause := ");
field_smCause.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", backOffTimer := ");
field_backOffTimer.log();
TTCN_Logger::log_event_str(", reAttemptIndicator := ");
field_reAttemptIndicator.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
field_nBIFOM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SM__ActivatePDPContextReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (smCause().is_bound()) smCause().set_implicit_omit();
if (!protocolConfigOpts().is_bound()) protocolConfigOpts() = OMIT_VALUE;
else protocolConfigOpts().set_implicit_omit();
if (!backOffTimer().is_bound()) backOffTimer() = OMIT_VALUE;
else backOffTimer().set_implicit_omit();
if (!reAttemptIndicator().is_bound()) reAttemptIndicator() = OMIT_VALUE;
else reAttemptIndicator().set_implicit_omit();
if (!nBIFOM__Container().is_bound()) nBIFOM__Container() = OMIT_VALUE;
else nBIFOM__Container().set_implicit_omit();
}

void PDU__SM__ActivatePDPContextReject::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.PDU_SM_ActivatePDPContextReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) smCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) backOffTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reAttemptIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "smCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          smCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "backOffTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          backOffTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reAttemptIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reAttemptIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
  }
}

void PDU__SM__ActivatePDPContextReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_smCause.encode_text(text_buf);
field_protocolConfigOpts.encode_text(text_buf);
field_backOffTimer.encode_text(text_buf);
field_reAttemptIndicator.encode_text(text_buf);
field_nBIFOM__Container.encode_text(text_buf);
}

void PDU__SM__ActivatePDPContextReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_smCause.decode_text(text_buf);
field_protocolConfigOpts.decode_text(text_buf);
field_backOffTimer.decode_text(text_buf);
field_reAttemptIndicator.decode_text(text_buf);
field_nBIFOM__Container.decode_text(text_buf);
}

void PDU__SM__ActivatePDPContextReject::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 PDU__SM__ActivatePDPContextReject::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 PDU__SM__ActivatePDPContextReject::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_messageType.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, SMCauseV_descr_.raw->forceomit);
  decoded_field_length = field_smCause.RAW_decode(SMCauseV_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_protocolConfigOpts = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, ProtocolConfigOptionsTLV_descr_.raw->forceomit);
  decoded_field_length = field_protocolConfigOpts().RAW_decode(ProtocolConfigOptionsTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_protocolConfigOpts = 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_protocolConfigOpts=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_backOffTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_backOffTimer().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_backOffTimer = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_backOffTimer.ispresent() || field_backOffTimer().elementIdentifier() !=  os_33){
  field_backOffTimer=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_backOffTimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_reAttemptIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ReAttemptIndicatorTLV_descr_.raw->forceomit);
  decoded_field_length = field_reAttemptIndicator().RAW_decode(ReAttemptIndicatorTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_reAttemptIndicator = 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_reAttemptIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_nBIFOM__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, NBIFOM__ContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_nBIFOM__Container().RAW_decode(NBIFOM__ContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_nBIFOM__Container = 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_nBIFOM__Container=OMIT_VALUE;
  if (field_messageType !=  bs_53) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SM__ActivatePDPContextReject::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SMCauseV_descr_.raw);
  if (field_protocolConfigOpts.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ProtocolConfigOptionsTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_backOffTimer.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_reAttemptIndicator.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ReAttemptIndicatorTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_nBIFOM__Container.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, NBIFOM__ContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_smCause.RAW_encode(SMCauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_protocolConfigOpts.ispresent()) {
  encoded_length += field_protocolConfigOpts().RAW_encode(ProtocolConfigOptionsTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_backOffTimer.ispresent()) {
  encoded_length += field_backOffTimer().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_reAttemptIndicator.ispresent()) {
  encoded_length += field_reAttemptIndicator().RAW_encode(ReAttemptIndicatorTLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_nBIFOM__Container.ispresent()) {
  encoded_length += field_nBIFOM__Container().RAW_encode(NBIFOM__ContainerTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_backOffTimer.ispresent() && (!field_backOffTimer.ispresent() || field_backOffTimer().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_33.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);
  }
  }
  if (field_messageType !=  bs_53) {
  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_53.RAW_encode(General__Types::BIT8_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 PDU__SM__ActivatePDPContextReject_template::single_value_struct {
BITSTRING_template field_messageType;
OCTETSTRING_template field_smCause;
ProtocolConfigOptionsTLV_template field_protocolConfigOpts;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_backOffTimer;
ReAttemptIndicatorTLV_template field_reAttemptIndicator;
NBIFOM__ContainerTLV_template field_nBIFOM__Container;
};

void PDU__SM__ActivatePDPContextReject_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_messageType = ANY_VALUE;
single_value->field_smCause = ANY_VALUE;
single_value->field_protocolConfigOpts = ANY_OR_OMIT;
single_value->field_backOffTimer = ANY_OR_OMIT;
single_value->field_reAttemptIndicator = ANY_OR_OMIT;
single_value->field_nBIFOM__Container = ANY_OR_OMIT;
}
}
}

void PDU__SM__ActivatePDPContextReject_template::copy_value(const PDU__SM__ActivatePDPContextReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.smCause().is_bound()) {
  single_value->field_smCause = other_value.smCause();
} else {
  single_value->field_smCause.clean_up();
}
if (other_value.protocolConfigOpts().is_bound()) {
  if (other_value.protocolConfigOpts().ispresent()) single_value->field_protocolConfigOpts = other_value.protocolConfigOpts()();
  else single_value->field_protocolConfigOpts = OMIT_VALUE;
} else {
  single_value->field_protocolConfigOpts.clean_up();
}
if (other_value.backOffTimer().is_bound()) {
  if (other_value.backOffTimer().ispresent()) single_value->field_backOffTimer = other_value.backOffTimer()();
  else single_value->field_backOffTimer = OMIT_VALUE;
} else {
  single_value->field_backOffTimer.clean_up();
}
if (other_value.reAttemptIndicator().is_bound()) {
  if (other_value.reAttemptIndicator().ispresent()) single_value->field_reAttemptIndicator = other_value.reAttemptIndicator()();
  else single_value->field_reAttemptIndicator = OMIT_VALUE;
} else {
  single_value->field_reAttemptIndicator.clean_up();
}
if (other_value.nBIFOM__Container().is_bound()) {
  if (other_value.nBIFOM__Container().ispresent()) single_value->field_nBIFOM__Container = other_value.nBIFOM__Container()();
  else single_value->field_nBIFOM__Container = OMIT_VALUE;
} else {
  single_value->field_nBIFOM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SM__ActivatePDPContextReject_template::copy_template(const PDU__SM__ActivatePDPContextReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.smCause().get_selection()) {
single_value->field_smCause = other_value.smCause();
} else {
single_value->field_smCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolConfigOpts().get_selection()) {
single_value->field_protocolConfigOpts = other_value.protocolConfigOpts();
} else {
single_value->field_protocolConfigOpts.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.backOffTimer().get_selection()) {
single_value->field_backOffTimer = other_value.backOffTimer();
} else {
single_value->field_backOffTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reAttemptIndicator().get_selection()) {
single_value->field_reAttemptIndicator = other_value.reAttemptIndicator();
} else {
single_value->field_reAttemptIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nBIFOM__Container().get_selection()) {
single_value->field_nBIFOM__Container = other_value.nBIFOM__Container();
} else {
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextReject_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 PDU__SM__ActivatePDPContextReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SM__ActivatePDPContextReject_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.PDU_SM_ActivatePDPContextReject.");
break;
}
set_selection(other_value);
}

PDU__SM__ActivatePDPContextReject_template::PDU__SM__ActivatePDPContextReject_template()
{
}

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

PDU__SM__ActivatePDPContextReject_template::PDU__SM__ActivatePDPContextReject_template(const PDU__SM__ActivatePDPContextReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SM__ActivatePDPContextReject_template::match(const PDU__SM__ActivatePDPContextReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.smCause().is_bound()) return FALSE;
if(!single_value->field_smCause.match(other_value.smCause(), legacy))return FALSE;
if(!other_value.protocolConfigOpts().is_bound()) return FALSE;
if((other_value.protocolConfigOpts().ispresent() ? !single_value->field_protocolConfigOpts.match((const ProtocolConfigOptionsTLV&)other_value.protocolConfigOpts(), legacy) : !single_value->field_protocolConfigOpts.match_omit(legacy)))return FALSE;
if(!other_value.backOffTimer().is_bound()) return FALSE;
if((other_value.backOffTimer().ispresent() ? !single_value->field_backOffTimer.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.backOffTimer(), legacy) : !single_value->field_backOffTimer.match_omit(legacy)))return FALSE;
if(!other_value.reAttemptIndicator().is_bound()) return FALSE;
if((other_value.reAttemptIndicator().ispresent() ? !single_value->field_reAttemptIndicator.match((const ReAttemptIndicatorTLV&)other_value.reAttemptIndicator(), legacy) : !single_value->field_reAttemptIndicator.match_omit(legacy)))return FALSE;
if(!other_value.nBIFOM__Container().is_bound()) return FALSE;
if((other_value.nBIFOM__Container().ispresent() ? !single_value->field_nBIFOM__Container.match((const NBIFOM__ContainerTLV&)other_value.nBIFOM__Container(), legacy) : !single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextReject.");
}
return FALSE;
}

boolean PDU__SM__ActivatePDPContextReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_smCause.is_bound()
 || (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_bound())
 || (single_value->field_backOffTimer.is_omit() || single_value->field_backOffTimer.is_bound())
 || (single_value->field_reAttemptIndicator.is_omit() || single_value->field_reAttemptIndicator.is_bound())
 || (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_bound());
}

boolean PDU__SM__ActivatePDPContextReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_smCause.is_value()
 && (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_value())
 && (single_value->field_backOffTimer.is_omit() || single_value->field_backOffTimer.is_value())
 && (single_value->field_reAttemptIndicator.is_omit() || single_value->field_reAttemptIndicator.is_value())
 && (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_value());
}

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

PDU__SM__ActivatePDPContextReject PDU__SM__ActivatePDPContextReject_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.PDU_SM_ActivatePDPContextReject.");
PDU__SM__ActivatePDPContextReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_smCause.is_bound()) {
ret_val.smCause() = single_value->field_smCause.valueof();
}
if (single_value->field_protocolConfigOpts.is_omit()) ret_val.protocolConfigOpts() = OMIT_VALUE;
else if (single_value->field_protocolConfigOpts.is_bound()) {
ret_val.protocolConfigOpts() = single_value->field_protocolConfigOpts.valueof();
}
if (single_value->field_backOffTimer.is_omit()) ret_val.backOffTimer() = OMIT_VALUE;
else if (single_value->field_backOffTimer.is_bound()) {
ret_val.backOffTimer() = single_value->field_backOffTimer.valueof();
}
if (single_value->field_reAttemptIndicator.is_omit()) ret_val.reAttemptIndicator() = OMIT_VALUE;
else if (single_value->field_reAttemptIndicator.is_bound()) {
ret_val.reAttemptIndicator() = single_value->field_reAttemptIndicator.valueof();
}
if (single_value->field_nBIFOM__Container.is_omit()) ret_val.nBIFOM__Container() = OMIT_VALUE;
else if (single_value->field_nBIFOM__Container.is_bound()) {
ret_val.nBIFOM__Container() = single_value->field_nBIFOM__Container.valueof();
}
return ret_val;
}

void PDU__SM__ActivatePDPContextReject_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.PDU_SM_ActivatePDPContextReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SM__ActivatePDPContextReject_template[list_length];
}

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

BITSTRING_template& PDU__SM__ActivatePDPContextReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__SM__ActivatePDPContextReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SM__ActivatePDPContextReject_template::smCause()
{
set_specific();
return single_value->field_smCause;
}

const OCTETSTRING_template& PDU__SM__ActivatePDPContextReject_template::smCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field smCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_smCause;
}

ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextReject_template::protocolConfigOpts()
{
set_specific();
return single_value->field_protocolConfigOpts;
}

const ProtocolConfigOptionsTLV_template& PDU__SM__ActivatePDPContextReject_template::protocolConfigOpts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolConfigOpts of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_protocolConfigOpts;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__SM__ActivatePDPContextReject_template::backOffTimer()
{
set_specific();
return single_value->field_backOffTimer;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__SM__ActivatePDPContextReject_template::backOffTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field backOffTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_backOffTimer;
}

ReAttemptIndicatorTLV_template& PDU__SM__ActivatePDPContextReject_template::reAttemptIndicator()
{
set_specific();
return single_value->field_reAttemptIndicator;
}

const ReAttemptIndicatorTLV_template& PDU__SM__ActivatePDPContextReject_template::reAttemptIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reAttemptIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_reAttemptIndicator;
}

NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextReject_template::nBIFOM__Container()
{
set_specific();
return single_value->field_nBIFOM__Container;
}

const NBIFOM__ContainerTLV_template& PDU__SM__ActivatePDPContextReject_template::nBIFOM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nBIFOM_Container of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
return single_value->field_nBIFOM__Container;
}

int PDU__SM__ActivatePDPContextReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_protocolConfigOpts.is_present()) ret_val++;
      if (single_value->field_backOffTimer.is_present()) ret_val++;
      if (single_value->field_reAttemptIndicator.is_present()) ret_val++;
      if (single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextReject 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.PDU_SM_ActivatePDPContextReject 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.PDU_SM_ActivatePDPContextReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject.");
  }
  return 0;
}

void PDU__SM__ActivatePDPContextReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", smCause := ");
single_value->field_smCause.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", backOffTimer := ");
single_value->field_backOffTimer.log();
TTCN_Logger::log_event_str(", reAttemptIndicator := ");
single_value->field_reAttemptIndicator.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextReject_template::log_match(const PDU__SM__ActivatePDPContextReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_smCause.match(match_value.smCause(), legacy)){
TTCN_Logger::log_logmatch_info(".smCause");
single_value->field_smCause.log_match(match_value.smCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.protocolConfigOpts().ispresent()){
if(!single_value->field_protocolConfigOpts.match(match_value.protocolConfigOpts(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolConfigOpts");
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolConfigOpts.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolConfigOpts := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.backOffTimer().ispresent()){
if(!single_value->field_backOffTimer.match(match_value.backOffTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".backOffTimer");
single_value->field_backOffTimer.log_match(match_value.backOffTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_backOffTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".backOffTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_backOffTimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reAttemptIndicator().ispresent()){
if(!single_value->field_reAttemptIndicator.match(match_value.reAttemptIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".reAttemptIndicator");
single_value->field_reAttemptIndicator.log_match(match_value.reAttemptIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reAttemptIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reAttemptIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reAttemptIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nBIFOM__Container().ispresent()){
if(!single_value->field_nBIFOM__Container.match(match_value.nBIFOM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".nBIFOM_Container");
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nBIFOM__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nBIFOM_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nBIFOM__Container.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", smCause := ");
single_value->field_smCause.log_match(match_value.smCause(), legacy);
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
if (match_value.protocolConfigOpts().ispresent()) {
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolConfigOpts.log();
if (single_value->field_protocolConfigOpts.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", backOffTimer := ");
if (match_value.backOffTimer().ispresent()) {
single_value->field_backOffTimer.log_match(match_value.backOffTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_backOffTimer.log();
if (single_value->field_backOffTimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reAttemptIndicator := ");
if (match_value.reAttemptIndicator().ispresent()) {
single_value->field_reAttemptIndicator.log_match(match_value.reAttemptIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reAttemptIndicator.log();
if (single_value->field_reAttemptIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
if (match_value.nBIFOM__Container().ispresent()) {
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nBIFOM__Container.log();
if (single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_smCause.encode_text(text_buf);
single_value->field_protocolConfigOpts.encode_text(text_buf);
single_value->field_backOffTimer.encode_text(text_buf);
single_value->field_reAttemptIndicator.encode_text(text_buf);
single_value->field_nBIFOM__Container.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.PDU_SM_ActivatePDPContextReject.");
}
}

void PDU__SM__ActivatePDPContextReject_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_messageType.decode_text(text_buf);
single_value->field_smCause.decode_text(text_buf);
single_value->field_protocolConfigOpts.decode_text(text_buf);
single_value->field_backOffTimer.decode_text(text_buf);
single_value->field_reAttemptIndicator.decode_text(text_buf);
single_value->field_nBIFOM__Container.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 PDU__SM__ActivatePDPContextReject_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.PDU_SM_ActivatePDPContextReject.");
}
}

void PDU__SM__ActivatePDPContextReject_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: {
    PDU__SM__ActivatePDPContextReject_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.PDU_SM_ActivatePDPContextReject 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) smCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) backOffTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reAttemptIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "smCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          smCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "backOffTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          backOffTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reAttemptIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reAttemptIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivatePDPContextReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SM__ActivatePDPContextReject_template* precondition = new PDU__SM__ActivatePDPContextReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SM__ActivatePDPContextReject_template* implied_template = new PDU__SM__ActivatePDPContextReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SM__ActivatePDPContextReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SM__ActivatePDPContextReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
single_value->field_smCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
single_value->field_protocolConfigOpts.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
single_value->field_backOffTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
single_value->field_reAttemptIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
single_value->field_nBIFOM__Container.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivatePDPContextReject");
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.PDU_SM_ActivatePDPContextReject");
}

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

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

PDU__SM__ActivateSecondaryPDPContextRequest::PDU__SM__ActivateSecondaryPDPContextRequest()
{
}

PDU__SM__ActivateSecondaryPDPContextRequest::PDU__SM__ActivateSecondaryPDPContextRequest(const BITSTRING& par_messageType,
    const NSAPIV& par_requestedNSAPI,
    const LLC__SAPIV& par_requestedLLC__SAPI,
    const QoSLV& par_requestedQoS,
    const LinkedTILV& par_linkedTI,
    const OPTIONAL< TrafficFlowTemplateTLV >& par_tft,
    const OPTIONAL< ProtocolConfigOptionsTLV >& par_protocolConfigOpts,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< NBIFOM__ContainerTLV >& par_nBIFOM__Container)
  :   field_messageType(par_messageType),
  field_requestedNSAPI(par_requestedNSAPI),
  field_requestedLLC__SAPI(par_requestedLLC__SAPI),
  field_requestedQoS(par_requestedQoS),
  field_linkedTI(par_linkedTI),
  field_tft(par_tft),
  field_protocolConfigOpts(par_protocolConfigOpts),
  field_deviceProperties(par_deviceProperties),
  field_nBIFOM__Container(par_nBIFOM__Container)
{
}

PDU__SM__ActivateSecondaryPDPContextRequest::PDU__SM__ActivateSecondaryPDPContextRequest(const PDU__SM__ActivateSecondaryPDPContextRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.requestedNSAPI().is_bound()) field_requestedNSAPI = other_value.requestedNSAPI();
else field_requestedNSAPI.clean_up();
if (other_value.requestedLLC__SAPI().is_bound()) field_requestedLLC__SAPI = other_value.requestedLLC__SAPI();
else field_requestedLLC__SAPI.clean_up();
if (other_value.requestedQoS().is_bound()) field_requestedQoS = other_value.requestedQoS();
else field_requestedQoS.clean_up();
if (other_value.linkedTI().is_bound()) field_linkedTI = other_value.linkedTI();
else field_linkedTI.clean_up();
if (other_value.tft().is_bound()) field_tft = other_value.tft();
else field_tft.clean_up();
if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
else field_protocolConfigOpts.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
else field_nBIFOM__Container.clean_up();
}

void PDU__SM__ActivateSecondaryPDPContextRequest::clean_up()
{
field_messageType.clean_up();
field_requestedNSAPI.clean_up();
field_requestedLLC__SAPI.clean_up();
field_requestedQoS.clean_up();
field_linkedTI.clean_up();
field_tft.clean_up();
field_protocolConfigOpts.clean_up();
field_deviceProperties.clean_up();
field_nBIFOM__Container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SM__ActivateSecondaryPDPContextRequest::get_descriptor() const { return &PDU__SM__ActivateSecondaryPDPContextRequest_descr_; }
PDU__SM__ActivateSecondaryPDPContextRequest& PDU__SM__ActivateSecondaryPDPContextRequest::operator=(const PDU__SM__ActivateSecondaryPDPContextRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.requestedNSAPI().is_bound()) field_requestedNSAPI = other_value.requestedNSAPI();
  else field_requestedNSAPI.clean_up();
  if (other_value.requestedLLC__SAPI().is_bound()) field_requestedLLC__SAPI = other_value.requestedLLC__SAPI();
  else field_requestedLLC__SAPI.clean_up();
  if (other_value.requestedQoS().is_bound()) field_requestedQoS = other_value.requestedQoS();
  else field_requestedQoS.clean_up();
  if (other_value.linkedTI().is_bound()) field_linkedTI = other_value.linkedTI();
  else field_linkedTI.clean_up();
  if (other_value.tft().is_bound()) field_tft = other_value.tft();
  else field_tft.clean_up();
  if (other_value.protocolConfigOpts().is_bound()) field_protocolConfigOpts = other_value.protocolConfigOpts();
  else field_protocolConfigOpts.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.nBIFOM__Container().is_bound()) field_nBIFOM__Container = other_value.nBIFOM__Container();
  else field_nBIFOM__Container.clean_up();
}
return *this;
}

boolean PDU__SM__ActivateSecondaryPDPContextRequest::operator==(const PDU__SM__ActivateSecondaryPDPContextRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_requestedNSAPI==other_value.field_requestedNSAPI
  && field_requestedLLC__SAPI==other_value.field_requestedLLC__SAPI
  && field_requestedQoS==other_value.field_requestedQoS
  && field_linkedTI==other_value.field_linkedTI
  && field_tft==other_value.field_tft
  && field_protocolConfigOpts==other_value.field_protocolConfigOpts
  && field_deviceProperties==other_value.field_deviceProperties
  && field_nBIFOM__Container==other_value.field_nBIFOM__Container;
}

boolean PDU__SM__ActivateSecondaryPDPContextRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_requestedNSAPI.is_bound())
  || (field_requestedLLC__SAPI.is_bound())
  || (field_requestedQoS.is_bound())
  || (field_linkedTI.is_bound())
  || (OPTIONAL_OMIT == field_tft.get_selection() || field_tft.is_bound())
  || (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_bound());
}
boolean PDU__SM__ActivateSecondaryPDPContextRequest::is_value() const
{
return field_messageType.is_value()
  && field_requestedNSAPI.is_value()
  && field_requestedLLC__SAPI.is_value()
  && field_requestedQoS.is_value()
  && field_linkedTI.is_value()
  && (OPTIONAL_OMIT == field_tft.get_selection() || field_tft.is_value())
  && (OPTIONAL_OMIT == field_protocolConfigOpts.get_selection() || field_protocolConfigOpts.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_nBIFOM__Container.get_selection() || field_nBIFOM__Container.is_value());
}
int PDU__SM__ActivateSecondaryPDPContextRequest::size_of() const
{
  int ret_val = 5;
  if (field_tft.ispresent()) ret_val++;
  if (field_protocolConfigOpts.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_nBIFOM__Container.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SM__ActivateSecondaryPDPContextRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", requestedNSAPI := ");
field_requestedNSAPI.log();
TTCN_Logger::log_event_str(", requestedLLC_SAPI := ");
field_requestedLLC__SAPI.log();
TTCN_Logger::log_event_str(", requestedQoS := ");
field_requestedQoS.log();
TTCN_Logger::log_event_str(", linkedTI := ");
field_linkedTI.log();
TTCN_Logger::log_event_str(", tft := ");
field_tft.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
field_nBIFOM__Container.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SM__ActivateSecondaryPDPContextRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (requestedNSAPI().is_bound()) requestedNSAPI().set_implicit_omit();
if (requestedLLC__SAPI().is_bound()) requestedLLC__SAPI().set_implicit_omit();
if (requestedQoS().is_bound()) requestedQoS().set_implicit_omit();
if (linkedTI().is_bound()) linkedTI().set_implicit_omit();
if (!tft().is_bound()) tft() = OMIT_VALUE;
else tft().set_implicit_omit();
if (!protocolConfigOpts().is_bound()) protocolConfigOpts() = OMIT_VALUE;
else protocolConfigOpts().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!nBIFOM__Container().is_bound()) nBIFOM__Container() = OMIT_VALUE;
else nBIFOM__Container().set_implicit_omit();
}

void PDU__SM__ActivateSecondaryPDPContextRequest::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.PDU_SM_ActivateSecondaryPDPContextRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) requestedNSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) requestedLLC__SAPI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestedQoS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) linkedTI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tft().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedNSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedNSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedLLC_SAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedLLC__SAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "linkedTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          linkedTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tft().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivateSecondaryPDPContextRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
  }
}

void PDU__SM__ActivateSecondaryPDPContextRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_requestedNSAPI.encode_text(text_buf);
field_requestedLLC__SAPI.encode_text(text_buf);
field_requestedQoS.encode_text(text_buf);
field_linkedTI.encode_text(text_buf);
field_tft.encode_text(text_buf);
field_protocolConfigOpts.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_nBIFOM__Container.encode_text(text_buf);
}

void PDU__SM__ActivateSecondaryPDPContextRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_requestedNSAPI.decode_text(text_buf);
field_requestedLLC__SAPI.decode_text(text_buf);
field_requestedQoS.decode_text(text_buf);
field_linkedTI.decode_text(text_buf);
field_tft.decode_text(text_buf);
field_protocolConfigOpts.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_nBIFOM__Container.decode_text(text_buf);
}

void PDU__SM__ActivateSecondaryPDPContextRequest::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 PDU__SM__ActivateSecondaryPDPContextRequest::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 PDU__SM__ActivateSecondaryPDPContextRequest::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_messageType.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, NSAPIV_descr_.raw->forceomit);
  decoded_field_length = field_requestedNSAPI.RAW_decode(NSAPIV_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, LLC__SAPIV_descr_.raw->forceomit);
  decoded_field_length = field_requestedLLC__SAPI.RAW_decode(LLC__SAPIV_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, QoSLV_descr_.raw->forceomit);
  decoded_field_length = field_requestedQoS.RAW_decode(QoSLV_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, LinkedTILV_descr_.raw->forceomit);
  decoded_field_length = field_linkedTI.RAW_decode(LinkedTILV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_tft = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, TrafficFlowTemplateTLV_descr_.raw->forceomit);
  decoded_field_length = field_tft().RAW_decode(TrafficFlowTemplateTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_tft = 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_tft=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_protocolConfigOpts = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ProtocolConfigOptionsTLV_descr_.raw->forceomit);
  decoded_field_length = field_protocolConfigOpts().RAW_decode(ProtocolConfigOptionsTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_protocolConfigOpts = 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_protocolConfigOpts=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_21){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_nBIFOM__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, NBIFOM__ContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_nBIFOM__Container().RAW_decode(NBIFOM__ContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_nBIFOM__Container = 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_nBIFOM__Container=OMIT_VALUE;
  if (field_messageType !=  bs_54) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SM__ActivateSecondaryPDPContextRequest::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, NSAPIV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LLC__SAPIV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, QoSLV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, LinkedTILV_descr_.raw);
  if (field_tft.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, TrafficFlowTemplateTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_protocolConfigOpts.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ProtocolConfigOptionsTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_nBIFOM__Container.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, NBIFOM__ContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_requestedNSAPI.RAW_encode(NSAPIV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_requestedLLC__SAPI.RAW_encode(LLC__SAPIV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_requestedQoS.RAW_encode(QoSLV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_linkedTI.RAW_encode(LinkedTILV_descr_, *myleaf.body.node.nodes[4]);
  if (field_tft.ispresent()) {
  encoded_length += field_tft().RAW_encode(TrafficFlowTemplateTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_protocolConfigOpts.ispresent()) {
  encoded_length += field_protocolConfigOpts().RAW_encode(ProtocolConfigOptionsTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_nBIFOM__Container.ispresent()) {
  encoded_length += field_nBIFOM__Container().RAW_encode(NBIFOM__ContainerTLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.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);
  }
  }
  if (field_messageType !=  bs_54) {
  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_54.RAW_encode(General__Types::BIT8_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 PDU__SM__ActivateSecondaryPDPContextRequest_template::single_value_struct {
BITSTRING_template field_messageType;
NSAPIV_template field_requestedNSAPI;
LLC__SAPIV_template field_requestedLLC__SAPI;
QoSLV_template field_requestedQoS;
LinkedTILV_template field_linkedTI;
TrafficFlowTemplateTLV_template field_tft;
ProtocolConfigOptionsTLV_template field_protocolConfigOpts;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
NBIFOM__ContainerTLV_template field_nBIFOM__Container;
};

void PDU__SM__ActivateSecondaryPDPContextRequest_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_messageType = ANY_VALUE;
single_value->field_requestedNSAPI = ANY_VALUE;
single_value->field_requestedLLC__SAPI = ANY_VALUE;
single_value->field_requestedQoS = ANY_VALUE;
single_value->field_linkedTI = ANY_VALUE;
single_value->field_tft = ANY_OR_OMIT;
single_value->field_protocolConfigOpts = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_nBIFOM__Container = ANY_OR_OMIT;
}
}
}

void PDU__SM__ActivateSecondaryPDPContextRequest_template::copy_value(const PDU__SM__ActivateSecondaryPDPContextRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.requestedNSAPI().is_bound()) {
  single_value->field_requestedNSAPI = other_value.requestedNSAPI();
} else {
  single_value->field_requestedNSAPI.clean_up();
}
if (other_value.requestedLLC__SAPI().is_bound()) {
  single_value->field_requestedLLC__SAPI = other_value.requestedLLC__SAPI();
} else {
  single_value->field_requestedLLC__SAPI.clean_up();
}
if (other_value.requestedQoS().is_bound()) {
  single_value->field_requestedQoS = other_value.requestedQoS();
} else {
  single_value->field_requestedQoS.clean_up();
}
if (other_value.linkedTI().is_bound()) {
  single_value->field_linkedTI = other_value.linkedTI();
} else {
  single_value->field_linkedTI.clean_up();
}
if (other_value.tft().is_bound()) {
  if (other_value.tft().ispresent()) single_value->field_tft = other_value.tft()();
  else single_value->field_tft = OMIT_VALUE;
} else {
  single_value->field_tft.clean_up();
}
if (other_value.protocolConfigOpts().is_bound()) {
  if (other_value.protocolConfigOpts().ispresent()) single_value->field_protocolConfigOpts = other_value.protocolConfigOpts()();
  else single_value->field_protocolConfigOpts = OMIT_VALUE;
} else {
  single_value->field_protocolConfigOpts.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.nBIFOM__Container().is_bound()) {
  if (other_value.nBIFOM__Container().ispresent()) single_value->field_nBIFOM__Container = other_value.nBIFOM__Container()();
  else single_value->field_nBIFOM__Container = OMIT_VALUE;
} else {
  single_value->field_nBIFOM__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SM__ActivateSecondaryPDPContextRequest_template::copy_template(const PDU__SM__ActivateSecondaryPDPContextRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedNSAPI().get_selection()) {
single_value->field_requestedNSAPI = other_value.requestedNSAPI();
} else {
single_value->field_requestedNSAPI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedLLC__SAPI().get_selection()) {
single_value->field_requestedLLC__SAPI = other_value.requestedLLC__SAPI();
} else {
single_value->field_requestedLLC__SAPI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedQoS().get_selection()) {
single_value->field_requestedQoS = other_value.requestedQoS();
} else {
single_value->field_requestedQoS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.linkedTI().get_selection()) {
single_value->field_linkedTI = other_value.linkedTI();
} else {
single_value->field_linkedTI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tft().get_selection()) {
single_value->field_tft = other_value.tft();
} else {
single_value->field_tft.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocolConfigOpts().get_selection()) {
single_value->field_protocolConfigOpts = other_value.protocolConfigOpts();
} else {
single_value->field_protocolConfigOpts.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nBIFOM__Container().get_selection()) {
single_value->field_nBIFOM__Container = other_value.nBIFOM__Container();
} else {
single_value->field_nBIFOM__Container.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 PDU__SM__ActivateSecondaryPDPContextRequest_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 PDU__SM__ActivateSecondaryPDPContextRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SM__ActivateSecondaryPDPContextRequest_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.PDU_SM_ActivateSecondaryPDPContextRequest.");
break;
}
set_selection(other_value);
}

PDU__SM__ActivateSecondaryPDPContextRequest_template::PDU__SM__ActivateSecondaryPDPContextRequest_template()
{
}

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

PDU__SM__ActivateSecondaryPDPContextRequest_template::PDU__SM__ActivateSecondaryPDPContextRequest_template(const PDU__SM__ActivateSecondaryPDPContextRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SM__ActivateSecondaryPDPContextRequest_template::match(const PDU__SM__ActivateSecondaryPDPContextRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.requestedNSAPI().is_bound()) return FALSE;
if(!single_value->field_requestedNSAPI.match(other_value.requestedNSAPI(), legacy))return FALSE;
if(!other_value.requestedLLC__SAPI().is_bound()) return FALSE;
if(!single_value->field_requestedLLC__SAPI.match(other_value.requestedLLC__SAPI(), legacy))return FALSE;
if(!other_value.requestedQoS().is_bound()) return FALSE;
if(!single_value->field_requestedQoS.match(other_value.requestedQoS(), legacy))return FALSE;
if(!other_value.linkedTI().is_bound()) return FALSE;
if(!single_value->field_linkedTI.match(other_value.linkedTI(), legacy))return FALSE;
if(!other_value.tft().is_bound()) return FALSE;
if((other_value.tft().ispresent() ? !single_value->field_tft.match((const TrafficFlowTemplateTLV&)other_value.tft(), legacy) : !single_value->field_tft.match_omit(legacy)))return FALSE;
if(!other_value.protocolConfigOpts().is_bound()) return FALSE;
if((other_value.protocolConfigOpts().ispresent() ? !single_value->field_protocolConfigOpts.match((const ProtocolConfigOptionsTLV&)other_value.protocolConfigOpts(), legacy) : !single_value->field_protocolConfigOpts.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.nBIFOM__Container().is_bound()) return FALSE;
if((other_value.nBIFOM__Container().ispresent() ? !single_value->field_nBIFOM__Container.match((const NBIFOM__ContainerTLV&)other_value.nBIFOM__Container(), legacy) : !single_value->field_nBIFOM__Container.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.PDU_SM_ActivateSecondaryPDPContextRequest.");
}
return FALSE;
}

boolean PDU__SM__ActivateSecondaryPDPContextRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_requestedNSAPI.is_bound()
 || single_value->field_requestedLLC__SAPI.is_bound()
 || single_value->field_requestedQoS.is_bound()
 || single_value->field_linkedTI.is_bound()
 || (single_value->field_tft.is_omit() || single_value->field_tft.is_bound())
 || (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_bound());
}

boolean PDU__SM__ActivateSecondaryPDPContextRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_requestedNSAPI.is_value()
 && single_value->field_requestedLLC__SAPI.is_value()
 && single_value->field_requestedQoS.is_value()
 && single_value->field_linkedTI.is_value()
 && (single_value->field_tft.is_omit() || single_value->field_tft.is_value())
 && (single_value->field_protocolConfigOpts.is_omit() || single_value->field_protocolConfigOpts.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_nBIFOM__Container.is_omit() || single_value->field_nBIFOM__Container.is_value());
}

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

PDU__SM__ActivateSecondaryPDPContextRequest PDU__SM__ActivateSecondaryPDPContextRequest_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.PDU_SM_ActivateSecondaryPDPContextRequest.");
PDU__SM__ActivateSecondaryPDPContextRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_requestedNSAPI.is_bound()) {
ret_val.requestedNSAPI() = single_value->field_requestedNSAPI.valueof();
}
if (single_value->field_requestedLLC__SAPI.is_bound()) {
ret_val.requestedLLC__SAPI() = single_value->field_requestedLLC__SAPI.valueof();
}
if (single_value->field_requestedQoS.is_bound()) {
ret_val.requestedQoS() = single_value->field_requestedQoS.valueof();
}
if (single_value->field_linkedTI.is_bound()) {
ret_val.linkedTI() = single_value->field_linkedTI.valueof();
}
if (single_value->field_tft.is_omit()) ret_val.tft() = OMIT_VALUE;
else if (single_value->field_tft.is_bound()) {
ret_val.tft() = single_value->field_tft.valueof();
}
if (single_value->field_protocolConfigOpts.is_omit()) ret_val.protocolConfigOpts() = OMIT_VALUE;
else if (single_value->field_protocolConfigOpts.is_bound()) {
ret_val.protocolConfigOpts() = single_value->field_protocolConfigOpts.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_nBIFOM__Container.is_omit()) ret_val.nBIFOM__Container() = OMIT_VALUE;
else if (single_value->field_nBIFOM__Container.is_bound()) {
ret_val.nBIFOM__Container() = single_value->field_nBIFOM__Container.valueof();
}
return ret_val;
}

void PDU__SM__ActivateSecondaryPDPContextRequest_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.PDU_SM_ActivateSecondaryPDPContextRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SM__ActivateSecondaryPDPContextRequest_template[list_length];
}

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

BITSTRING_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_messageType;
}

NSAPIV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedNSAPI()
{
set_specific();
return single_value->field_requestedNSAPI;
}

const NSAPIV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedNSAPI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedNSAPI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_requestedNSAPI;
}

LLC__SAPIV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedLLC__SAPI()
{
set_specific();
return single_value->field_requestedLLC__SAPI;
}

const LLC__SAPIV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedLLC__SAPI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedLLC_SAPI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_requestedLLC__SAPI;
}

QoSLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedQoS()
{
set_specific();
return single_value->field_requestedQoS;
}

const QoSLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::requestedQoS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedQoS of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_requestedQoS;
}

LinkedTILV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::linkedTI()
{
set_specific();
return single_value->field_linkedTI;
}

const LinkedTILV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::linkedTI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field linkedTI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_linkedTI;
}

TrafficFlowTemplateTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::tft()
{
set_specific();
return single_value->field_tft;
}

const TrafficFlowTemplateTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::tft() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tft of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_tft;
}

ProtocolConfigOptionsTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::protocolConfigOpts()
{
set_specific();
return single_value->field_protocolConfigOpts;
}

const ProtocolConfigOptionsTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::protocolConfigOpts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocolConfigOpts of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_protocolConfigOpts;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_deviceProperties;
}

NBIFOM__ContainerTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::nBIFOM__Container()
{
set_specific();
return single_value->field_nBIFOM__Container;
}

const NBIFOM__ContainerTLV_template& PDU__SM__ActivateSecondaryPDPContextRequest_template::nBIFOM__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nBIFOM_Container of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
return single_value->field_nBIFOM__Container;
}

int PDU__SM__ActivateSecondaryPDPContextRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_tft.is_present()) ret_val++;
      if (single_value->field_protocolConfigOpts.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_nBIFOM__Container.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.PDU_SM_ActivateSecondaryPDPContextRequest 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.PDU_SM_ActivateSecondaryPDPContextRequest 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.PDU_SM_ActivateSecondaryPDPContextRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest.");
  }
  return 0;
}

void PDU__SM__ActivateSecondaryPDPContextRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", requestedNSAPI := ");
single_value->field_requestedNSAPI.log();
TTCN_Logger::log_event_str(", requestedLLC_SAPI := ");
single_value->field_requestedLLC__SAPI.log();
TTCN_Logger::log_event_str(", requestedQoS := ");
single_value->field_requestedQoS.log();
TTCN_Logger::log_event_str(", linkedTI := ");
single_value->field_linkedTI.log();
TTCN_Logger::log_event_str(", tft := ");
single_value->field_tft.log();
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
single_value->field_nBIFOM__Container.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 PDU__SM__ActivateSecondaryPDPContextRequest_template::log_match(const PDU__SM__ActivateSecondaryPDPContextRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedNSAPI.match(match_value.requestedNSAPI(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedNSAPI");
single_value->field_requestedNSAPI.log_match(match_value.requestedNSAPI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedLLC__SAPI.match(match_value.requestedLLC__SAPI(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedLLC_SAPI");
single_value->field_requestedLLC__SAPI.log_match(match_value.requestedLLC__SAPI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestedQoS.match(match_value.requestedQoS(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedQoS");
single_value->field_requestedQoS.log_match(match_value.requestedQoS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_linkedTI.match(match_value.linkedTI(), legacy)){
TTCN_Logger::log_logmatch_info(".linkedTI");
single_value->field_linkedTI.log_match(match_value.linkedTI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tft().ispresent()){
if(!single_value->field_tft.match(match_value.tft(), legacy)){
TTCN_Logger::log_logmatch_info(".tft");
single_value->field_tft.log_match(match_value.tft(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tft.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tft := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tft.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.protocolConfigOpts().ispresent()){
if(!single_value->field_protocolConfigOpts.match(match_value.protocolConfigOpts(), legacy)){
TTCN_Logger::log_logmatch_info(".protocolConfigOpts");
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_protocolConfigOpts.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".protocolConfigOpts := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_protocolConfigOpts.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.nBIFOM__Container().ispresent()){
if(!single_value->field_nBIFOM__Container.match(match_value.nBIFOM__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".nBIFOM_Container");
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nBIFOM__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nBIFOM_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nBIFOM__Container.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", requestedNSAPI := ");
single_value->field_requestedNSAPI.log_match(match_value.requestedNSAPI(), legacy);
TTCN_Logger::log_event_str(", requestedLLC_SAPI := ");
single_value->field_requestedLLC__SAPI.log_match(match_value.requestedLLC__SAPI(), legacy);
TTCN_Logger::log_event_str(", requestedQoS := ");
single_value->field_requestedQoS.log_match(match_value.requestedQoS(), legacy);
TTCN_Logger::log_event_str(", linkedTI := ");
single_value->field_linkedTI.log_match(match_value.linkedTI(), legacy);
TTCN_Logger::log_event_str(", tft := ");
if (match_value.tft().ispresent()) {
single_value->field_tft.log_match(match_value.tft(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tft.log();
if (single_value->field_tft.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", protocolConfigOpts := ");
if (match_value.protocolConfigOpts().ispresent()) {
single_value->field_protocolConfigOpts.log_match(match_value.protocolConfigOpts(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_protocolConfigOpts.log();
if (single_value->field_protocolConfigOpts.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", nBIFOM_Container := ");
if (match_value.nBIFOM__Container().ispresent()) {
single_value->field_nBIFOM__Container.log_match(match_value.nBIFOM__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nBIFOM__Container.log();
if (single_value->field_nBIFOM__Container.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 PDU__SM__ActivateSecondaryPDPContextRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_requestedNSAPI.encode_text(text_buf);
single_value->field_requestedLLC__SAPI.encode_text(text_buf);
single_value->field_requestedQoS.encode_text(text_buf);
single_value->field_linkedTI.encode_text(text_buf);
single_value->field_tft.encode_text(text_buf);
single_value->field_protocolConfigOpts.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_nBIFOM__Container.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.PDU_SM_ActivateSecondaryPDPContextRequest.");
}
}

void PDU__SM__ActivateSecondaryPDPContextRequest_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_messageType.decode_text(text_buf);
single_value->field_requestedNSAPI.decode_text(text_buf);
single_value->field_requestedLLC__SAPI.decode_text(text_buf);
single_value->field_requestedQoS.decode_text(text_buf);
single_value->field_linkedTI.decode_text(text_buf);
single_value->field_tft.decode_text(text_buf);
single_value->field_protocolConfigOpts.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_nBIFOM__Container.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 PDU__SM__ActivateSecondaryPDPContextRequest_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.PDU_SM_ActivateSecondaryPDPContextRequest.");
}
}

void PDU__SM__ActivateSecondaryPDPContextRequest_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: {
    PDU__SM__ActivateSecondaryPDPContextRequest_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.PDU_SM_ActivateSecondaryPDPContextRequest 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) requestedNSAPI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) requestedLLC__SAPI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestedQoS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) linkedTI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) tft().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) protocolConfigOpts().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) nBIFOM__Container().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedNSAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedNSAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedLLC_SAPI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedLLC__SAPI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedQoS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedQoS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "linkedTI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          linkedTI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tft().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocolConfigOpts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocolConfigOpts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nBIFOM_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nBIFOM__Container().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.PDU_SM_ActivateSecondaryPDPContextRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SM__ActivateSecondaryPDPContextRequest_template* precondition = new PDU__SM__ActivateSecondaryPDPContextRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SM__ActivateSecondaryPDPContextRequest_template* implied_template = new PDU__SM__ActivateSecondaryPDPContextRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SM__ActivateSecondaryPDPContextRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SM__ActivateSecondaryPDPContextRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_requestedNSAPI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_requestedLLC__SAPI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_requestedQoS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_linkedTI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_tft.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_protocolConfigOpts.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
single_value->field_nBIFOM__Container.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_SM_ActivateSecondaryPDPContextRequest");
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.PDU_SM_ActivateSecondaryPDPContextRequest");
}

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

boolean PDU__SM__ActivateSecondaryPDPContextRequest_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 */
