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

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

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

/* Including header files */

#include "MobileL3_MM_Types.hh"

namespace MobileL3__MM__Types {

/* Member functions of C++ classes */

PDU__ML3__IMSI__DetachIndication::PDU__ML3__IMSI__DetachIndication()
{
}

PDU__ML3__IMSI__DetachIndication::PDU__ML3__IMSI__DetachIndication(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::MobileStationClassmark1__V& par_mobileStationClassmark1,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentityLV)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_mobileStationClassmark1(par_mobileStationClassmark1),
  field_mobileIdentityLV(par_mobileIdentityLV)
{
}

PDU__ML3__IMSI__DetachIndication::PDU__ML3__IMSI__DetachIndication(const PDU__ML3__IMSI__DetachIndication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.mobileStationClassmark1().is_bound()) field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
else field_mobileStationClassmark1.clean_up();
if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
else field_mobileIdentityLV.clean_up();
}

void PDU__ML3__IMSI__DetachIndication::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_mobileStationClassmark1.clean_up();
field_mobileIdentityLV.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__IMSI__DetachIndication::get_descriptor() const { return &PDU__ML3__IMSI__DetachIndication_descr_; }
PDU__ML3__IMSI__DetachIndication& PDU__ML3__IMSI__DetachIndication::operator=(const PDU__ML3__IMSI__DetachIndication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.mobileStationClassmark1().is_bound()) field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
  else field_mobileStationClassmark1.clean_up();
  if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
  else field_mobileIdentityLV.clean_up();
}
return *this;
}

boolean PDU__ML3__IMSI__DetachIndication::operator==(const PDU__ML3__IMSI__DetachIndication& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_mobileStationClassmark1==other_value.field_mobileStationClassmark1
  && field_mobileIdentityLV==other_value.field_mobileIdentityLV;
}

boolean PDU__ML3__IMSI__DetachIndication::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_mobileStationClassmark1.is_bound())
  || (field_mobileIdentityLV.is_bound());
}
boolean PDU__ML3__IMSI__DetachIndication::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_mobileStationClassmark1.is_value()
  && field_mobileIdentityLV.is_value();
}
void PDU__ML3__IMSI__DetachIndication::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
field_mobileStationClassmark1.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__IMSI__DetachIndication::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (mobileStationClassmark1().is_bound()) mobileStationClassmark1().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
}

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

void PDU__ML3__IMSI__DetachIndication::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_mobileStationClassmark1.encode_text(text_buf);
field_mobileIdentityLV.encode_text(text_buf);
}

void PDU__ML3__IMSI__DetachIndication::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_mobileStationClassmark1.decode_text(text_buf);
field_mobileIdentityLV.decode_text(text_buf);
}

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

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

int PDU__ML3__IMSI__DetachIndication::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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::MobileStationClassmark1__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark1.RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark1__V_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_mobileIdentityLV.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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__IMSI__DetachIndication::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::MobileStationClassmark1__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mobileStationClassmark1.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark1__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileIdentityLV.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__IMSI__DetachIndication_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::MobileStationClassmark1__V_template field_mobileStationClassmark1;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentityLV;
};

void PDU__ML3__IMSI__DetachIndication_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_nsd = ANY_VALUE;
single_value->field_mobileStationClassmark1 = ANY_VALUE;
single_value->field_mobileIdentityLV = ANY_VALUE;
}
}
}

void PDU__ML3__IMSI__DetachIndication_template::copy_value(const PDU__ML3__IMSI__DetachIndication& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.mobileStationClassmark1().is_bound()) {
  single_value->field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
} else {
  single_value->field_mobileStationClassmark1.clean_up();
}
if (other_value.mobileIdentityLV().is_bound()) {
  single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
  single_value->field_mobileIdentityLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__IMSI__DetachIndication_template::copy_template(const PDU__ML3__IMSI__DetachIndication_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark1().get_selection()) {
single_value->field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
} else {
single_value->field_mobileStationClassmark1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentityLV().get_selection()) {
single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
single_value->field_mobileIdentityLV.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__ML3__IMSI__DetachIndication_template[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__ML3__IMSI__DetachIndication_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
break;
}
set_selection(other_value);
}

PDU__ML3__IMSI__DetachIndication_template::PDU__ML3__IMSI__DetachIndication_template()
{
}

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

PDU__ML3__IMSI__DetachIndication_template::PDU__ML3__IMSI__DetachIndication_template(const PDU__ML3__IMSI__DetachIndication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__IMSI__DetachIndication_template::match(const PDU__ML3__IMSI__DetachIndication& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.mobileStationClassmark1().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark1.match(other_value.mobileStationClassmark1(), legacy))return FALSE;
if(!other_value.mobileIdentityLV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityLV.match(other_value.mobileIdentityLV(), 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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
}
return FALSE;
}

boolean PDU__ML3__IMSI__DetachIndication_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_nsd.is_bound()
 || single_value->field_mobileStationClassmark1.is_bound()
 || single_value->field_mobileIdentityLV.is_bound();
}

boolean PDU__ML3__IMSI__DetachIndication_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_mobileStationClassmark1.is_value()
 && single_value->field_mobileIdentityLV.is_value();
}

void PDU__ML3__IMSI__DetachIndication_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__ML3__IMSI__DetachIndication PDU__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
PDU__ML3__IMSI__DetachIndication ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_mobileStationClassmark1.is_bound()) {
ret_val.mobileStationClassmark1() = single_value->field_mobileStationClassmark1.valueof();
}
if (single_value->field_mobileIdentityLV.is_bound()) {
ret_val.mobileIdentityLV() = single_value->field_mobileIdentityLV.valueof();
}
return ret_val;
}

void PDU__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__IMSI__DetachIndication_template[list_length];
}

PDU__ML3__IMSI__DetachIndication_template& PDU__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__IMSI__DetachIndication_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__IMSI__DetachIndication_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::MobileStationClassmark1__V_template& PDU__ML3__IMSI__DetachIndication_template::mobileStationClassmark1()
{
set_specific();
return single_value->field_mobileStationClassmark1;
}

const MobileL3__CommonIE__Types::MobileStationClassmark1__V_template& PDU__ML3__IMSI__DetachIndication_template::mobileStationClassmark1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark1 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
return single_value->field_mobileStationClassmark1;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__IMSI__DetachIndication_template::mobileIdentityLV()
{
set_specific();
return single_value->field_mobileIdentityLV;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__IMSI__DetachIndication_template::mobileIdentityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication.");
return single_value->field_mobileIdentityLV;
}

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

void PDU__ML3__IMSI__DetachIndication_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
single_value->field_mobileStationClassmark1.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.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__ML3__IMSI__DetachIndication_template::log_match(const PDU__ML3__IMSI__DetachIndication& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileStationClassmark1.match(match_value.mobileStationClassmark1(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark1");
single_value->field_mobileStationClassmark1.log_match(match_value.mobileStationClassmark1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentityLV.match(match_value.mobileIdentityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityLV");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), 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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
single_value->field_mobileStationClassmark1.log_match(match_value.mobileStationClassmark1(), legacy);
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), 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__ML3__IMSI__DetachIndication_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (mobileStationClassmark1().is_bound()) mobileStationClassmark1().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
}

void PDU__ML3__IMSI__DetachIndication_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_nsd.encode_text(text_buf);
single_value->field_mobileStationClassmark1.encode_text(text_buf);
single_value->field_mobileIdentityLV.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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
}
}

void PDU__ML3__IMSI__DetachIndication_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_nsd.decode_text(text_buf);
single_value->field_mobileStationClassmark1.decode_text(text_buf);
single_value->field_mobileIdentityLV.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__ML3__IMSI__DetachIndication_template[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_MM_Types.PDU_ML3_IMSI_DetachIndication.");
}
}

void PDU__ML3__IMSI__DetachIndication_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__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().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_MM_Types.PDU_ML3_IMSI_DetachIndication: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__IMSI__DetachIndication_template* precondition = new PDU__ML3__IMSI__DetachIndication_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__IMSI__DetachIndication_template* implied_template = new PDU__ML3__IMSI__DetachIndication_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__IMSI__DetachIndication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__IMSI__DetachIndication_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_MM_Types.PDU_ML3_IMSI_DetachIndication");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication");
single_value->field_mobileStationClassmark1.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication");
single_value->field_mobileIdentityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication");
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_MM_Types.PDU_ML3_IMSI_DetachIndication");
}

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

boolean PDU__ML3__IMSI__DetachIndication_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__ML3__LocationUpdateAccept::PDU__ML3__LocationUpdateAccept()
{
}

PDU__ML3__LocationUpdateAccept::PDU__ML3__LocationUpdateAccept(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::LocationAreaIdentification__V& par_locationAreaIdentification,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_mobileIdentityTLV,
    const OPTIONAL< MobileL3__CommonIE__Types::Type2 >& par_followOnProceed,
    const OPTIONAL< MobileL3__CommonIE__Types::Type2 >& par_cTS__Permission,
    const OPTIONAL< MobileL3__CommonIE__Types::PLMNListTLV >& par_equivalentPLMNs,
    const OPTIONAL< EmergencyNumberListTLV >& par_emergencyNumberList,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_perMS__T3212)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_locationAreaIdentification(par_locationAreaIdentification),
  field_mobileIdentityTLV(par_mobileIdentityTLV),
  field_followOnProceed(par_followOnProceed),
  field_cTS__Permission(par_cTS__Permission),
  field_equivalentPLMNs(par_equivalentPLMNs),
  field_emergencyNumberList(par_emergencyNumberList),
  field_perMS__T3212(par_perMS__T3212)
{
}

PDU__ML3__LocationUpdateAccept::PDU__ML3__LocationUpdateAccept(const PDU__ML3__LocationUpdateAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
else field_locationAreaIdentification.clean_up();
if (other_value.mobileIdentityTLV().is_bound()) field_mobileIdentityTLV = other_value.mobileIdentityTLV();
else field_mobileIdentityTLV.clean_up();
if (other_value.followOnProceed().is_bound()) field_followOnProceed = other_value.followOnProceed();
else field_followOnProceed.clean_up();
if (other_value.cTS__Permission().is_bound()) field_cTS__Permission = other_value.cTS__Permission();
else field_cTS__Permission.clean_up();
if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
else field_equivalentPLMNs.clean_up();
if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
else field_emergencyNumberList.clean_up();
if (other_value.perMS__T3212().is_bound()) field_perMS__T3212 = other_value.perMS__T3212();
else field_perMS__T3212.clean_up();
}

void PDU__ML3__LocationUpdateAccept::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_locationAreaIdentification.clean_up();
field_mobileIdentityTLV.clean_up();
field_followOnProceed.clean_up();
field_cTS__Permission.clean_up();
field_equivalentPLMNs.clean_up();
field_emergencyNumberList.clean_up();
field_perMS__T3212.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__LocationUpdateAccept::get_descriptor() const { return &PDU__ML3__LocationUpdateAccept_descr_; }
PDU__ML3__LocationUpdateAccept& PDU__ML3__LocationUpdateAccept::operator=(const PDU__ML3__LocationUpdateAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
  else field_locationAreaIdentification.clean_up();
  if (other_value.mobileIdentityTLV().is_bound()) field_mobileIdentityTLV = other_value.mobileIdentityTLV();
  else field_mobileIdentityTLV.clean_up();
  if (other_value.followOnProceed().is_bound()) field_followOnProceed = other_value.followOnProceed();
  else field_followOnProceed.clean_up();
  if (other_value.cTS__Permission().is_bound()) field_cTS__Permission = other_value.cTS__Permission();
  else field_cTS__Permission.clean_up();
  if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
  else field_equivalentPLMNs.clean_up();
  if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
  else field_emergencyNumberList.clean_up();
  if (other_value.perMS__T3212().is_bound()) field_perMS__T3212 = other_value.perMS__T3212();
  else field_perMS__T3212.clean_up();
}
return *this;
}

boolean PDU__ML3__LocationUpdateAccept::operator==(const PDU__ML3__LocationUpdateAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_locationAreaIdentification==other_value.field_locationAreaIdentification
  && field_mobileIdentityTLV==other_value.field_mobileIdentityTLV
  && field_followOnProceed==other_value.field_followOnProceed
  && field_cTS__Permission==other_value.field_cTS__Permission
  && field_equivalentPLMNs==other_value.field_equivalentPLMNs
  && field_emergencyNumberList==other_value.field_emergencyNumberList
  && field_perMS__T3212==other_value.field_perMS__T3212;
}

boolean PDU__ML3__LocationUpdateAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_locationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_mobileIdentityTLV.get_selection() || field_mobileIdentityTLV.is_bound())
  || (OPTIONAL_OMIT == field_followOnProceed.get_selection() || field_followOnProceed.is_bound())
  || (OPTIONAL_OMIT == field_cTS__Permission.get_selection() || field_cTS__Permission.is_bound())
  || (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_bound())
  || (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_bound())
  || (OPTIONAL_OMIT == field_perMS__T3212.get_selection() || field_perMS__T3212.is_bound());
}
boolean PDU__ML3__LocationUpdateAccept::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_locationAreaIdentification.is_value()
  && (OPTIONAL_OMIT == field_mobileIdentityTLV.get_selection() || field_mobileIdentityTLV.is_value())
  && (OPTIONAL_OMIT == field_followOnProceed.get_selection() || field_followOnProceed.is_value())
  && (OPTIONAL_OMIT == field_cTS__Permission.get_selection() || field_cTS__Permission.is_value())
  && (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_value())
  && (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_value())
  && (OPTIONAL_OMIT == field_perMS__T3212.get_selection() || field_perMS__T3212.is_value());
}
int PDU__ML3__LocationUpdateAccept::size_of() const
{
  int ret_val = 3;
  if (field_mobileIdentityTLV.ispresent()) ret_val++;
  if (field_followOnProceed.ispresent()) ret_val++;
  if (field_cTS__Permission.ispresent()) ret_val++;
  if (field_equivalentPLMNs.ispresent()) ret_val++;
  if (field_emergencyNumberList.ispresent()) ret_val++;
  if (field_perMS__T3212.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__LocationUpdateAccept::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", mobileIdentityTLV := ");
field_mobileIdentityTLV.log();
TTCN_Logger::log_event_str(", followOnProceed := ");
field_followOnProceed.log();
TTCN_Logger::log_event_str(", cTS_Permission := ");
field_cTS__Permission.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", perMS_T3212 := ");
field_perMS__T3212.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__LocationUpdateAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (!mobileIdentityTLV().is_bound()) mobileIdentityTLV() = OMIT_VALUE;
else mobileIdentityTLV().set_implicit_omit();
if (!followOnProceed().is_bound()) followOnProceed() = OMIT_VALUE;
else followOnProceed().set_implicit_omit();
if (!cTS__Permission().is_bound()) cTS__Permission() = OMIT_VALUE;
else cTS__Permission().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!perMS__T3212().is_bound()) perMS__T3212() = OMIT_VALUE;
else perMS__T3212().set_implicit_omit();
}

void PDU__ML3__LocationUpdateAccept::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_MM_Types.PDU_ML3_LocationUpdateAccept 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityTLV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) followOnProceed().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cTS__Permission().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) perMS__T3212().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityTLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityTLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "followOnProceed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          followOnProceed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cTS_Permission")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cTS__Permission().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "perMS_T3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          perMS__T3212().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_MM_Types.PDU_ML3_LocationUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
  }
}

void PDU__ML3__LocationUpdateAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_locationAreaIdentification.encode_text(text_buf);
field_mobileIdentityTLV.encode_text(text_buf);
field_followOnProceed.encode_text(text_buf);
field_cTS__Permission.encode_text(text_buf);
field_equivalentPLMNs.encode_text(text_buf);
field_emergencyNumberList.encode_text(text_buf);
field_perMS__T3212.encode_text(text_buf);
}

void PDU__ML3__LocationUpdateAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_locationAreaIdentification.decode_text(text_buf);
field_mobileIdentityTLV.decode_text(text_buf);
field_followOnProceed.decode_text(text_buf);
field_cTS__Permission.decode_text(text_buf);
field_equivalentPLMNs.decode_text(text_buf);
field_emergencyNumberList.decode_text(text_buf);
field_perMS__T3212.decode_text(text_buf);
}

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

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

int PDU__ML3__LocationUpdateAccept::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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::LocationAreaIdentification__V_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentification.RAW_decode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_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_mobileIdentityTLV = 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_mobileIdentityTLV().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_mobileIdentityTLV = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileIdentityTLV.ispresent() || field_mobileIdentityTLV().elementIdentifier() !=  bs_5){
  field_mobileIdentityTLV=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_mobileIdentityTLV=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_followOnProceed = 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::Type2_descr_.raw->forceomit);
  decoded_field_length = field_followOnProceed().RAW_decode(MobileL3__CommonIE__Types::Type2_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_followOnProceed = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_followOnProceed.ispresent() || field_followOnProceed().elementIdentifier() !=  os_8){
  field_followOnProceed=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_followOnProceed=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_cTS__Permission = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__CommonIE__Types::Type2_descr_.raw->forceomit);
  decoded_field_length = field_cTS__Permission().RAW_decode(MobileL3__CommonIE__Types::Type2_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_cTS__Permission = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cTS__Permission.ispresent() || field_cTS__Permission().elementIdentifier() !=  os_9){
  field_cTS__Permission=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_cTS__Permission=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_equivalentPLMNs = 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::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_6_force_omit);
  if (decoded_field_length < 1) {
  field_equivalentPLMNs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_equivalentPLMNs.ispresent() || field_equivalentPLMNs().elementIdentifier() !=  bs_6){
  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)(7)) {
    field_emergencyNumberList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, EmergencyNumberListTLV_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumberList().RAW_decode(EmergencyNumberListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyNumberList = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_emergencyNumberList.ispresent() || field_emergencyNumberList().elementIdentifier() !=  os_4){
  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)(8)) {
    field_perMS__T3212 = 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::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_perMS__T3212().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_perMS__T3212 = 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_perMS__T3212=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__LocationUpdateAccept::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_.raw);
  if (field_mobileIdentityTLV.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_followOnProceed.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::Type2_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_cTS__Permission.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Type2_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_equivalentPLMNs.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_emergencyNumberList.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, EmergencyNumberListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_perMS__T3212.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_locationAreaIdentification.RAW_encode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_mobileIdentityTLV.ispresent()) {
  encoded_length += field_mobileIdentityTLV().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_followOnProceed.ispresent()) {
  encoded_length += field_followOnProceed().RAW_encode(MobileL3__CommonIE__Types::Type2_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_cTS__Permission.ispresent()) {
  encoded_length += field_cTS__Permission().RAW_encode(MobileL3__CommonIE__Types::Type2_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_equivalentPLMNs.ispresent()) {
  encoded_length += field_equivalentPLMNs().RAW_encode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_emergencyNumberList.ispresent()) {
  encoded_length += field_emergencyNumberList().RAW_encode(EmergencyNumberListTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_perMS__T3212.ispresent()) {
  encoded_length += field_perMS__T3212().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_mobileIdentityTLV.ispresent() && (!field_mobileIdentityTLV.ispresent() || field_mobileIdentityTLV().elementIdentifier() !=  bs_5)) {
  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_5.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_followOnProceed.ispresent() && (!field_followOnProceed.ispresent() || field_followOnProceed().elementIdentifier() !=  os_8)) {
  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_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cTS__Permission.ispresent() && (!field_cTS__Permission.ispresent() || field_cTS__Permission().elementIdentifier() !=  os_9)) {
  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_9.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_equivalentPLMNs.ispresent() && (!field_equivalentPLMNs.ispresent() || field_equivalentPLMNs().elementIdentifier() !=  bs_6)) {
  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_6.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_emergencyNumberList.ispresent() && (!field_emergencyNumberList.ispresent() || field_emergencyNumberList().elementIdentifier() !=  os_4)) {
  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_4.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__LocationUpdateAccept_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::LocationAreaIdentification__V_template field_locationAreaIdentification;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_mobileIdentityTLV;
MobileL3__CommonIE__Types::Type2_template field_followOnProceed;
MobileL3__CommonIE__Types::Type2_template field_cTS__Permission;
MobileL3__CommonIE__Types::PLMNListTLV_template field_equivalentPLMNs;
EmergencyNumberListTLV_template field_emergencyNumberList;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_perMS__T3212;
};

void PDU__ML3__LocationUpdateAccept_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_nsd = ANY_VALUE;
single_value->field_locationAreaIdentification = ANY_VALUE;
single_value->field_mobileIdentityTLV = ANY_OR_OMIT;
single_value->field_followOnProceed = ANY_OR_OMIT;
single_value->field_cTS__Permission = ANY_OR_OMIT;
single_value->field_equivalentPLMNs = ANY_OR_OMIT;
single_value->field_emergencyNumberList = ANY_OR_OMIT;
single_value->field_perMS__T3212 = ANY_OR_OMIT;
}
}
}

void PDU__ML3__LocationUpdateAccept_template::copy_value(const PDU__ML3__LocationUpdateAccept& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.locationAreaIdentification().is_bound()) {
  single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
  single_value->field_locationAreaIdentification.clean_up();
}
if (other_value.mobileIdentityTLV().is_bound()) {
  if (other_value.mobileIdentityTLV().ispresent()) single_value->field_mobileIdentityTLV = other_value.mobileIdentityTLV()();
  else single_value->field_mobileIdentityTLV = OMIT_VALUE;
} else {
  single_value->field_mobileIdentityTLV.clean_up();
}
if (other_value.followOnProceed().is_bound()) {
  if (other_value.followOnProceed().ispresent()) single_value->field_followOnProceed = other_value.followOnProceed()();
  else single_value->field_followOnProceed = OMIT_VALUE;
} else {
  single_value->field_followOnProceed.clean_up();
}
if (other_value.cTS__Permission().is_bound()) {
  if (other_value.cTS__Permission().ispresent()) single_value->field_cTS__Permission = other_value.cTS__Permission()();
  else single_value->field_cTS__Permission = OMIT_VALUE;
} else {
  single_value->field_cTS__Permission.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.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.perMS__T3212().is_bound()) {
  if (other_value.perMS__T3212().ispresent()) single_value->field_perMS__T3212 = other_value.perMS__T3212()();
  else single_value->field_perMS__T3212 = OMIT_VALUE;
} else {
  single_value->field_perMS__T3212.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__LocationUpdateAccept_template::copy_template(const PDU__ML3__LocationUpdateAccept_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationAreaIdentification().get_selection()) {
single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
single_value->field_locationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentityTLV().get_selection()) {
single_value->field_mobileIdentityTLV = other_value.mobileIdentityTLV();
} else {
single_value->field_mobileIdentityTLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.followOnProceed().get_selection()) {
single_value->field_followOnProceed = other_value.followOnProceed();
} else {
single_value->field_followOnProceed.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cTS__Permission().get_selection()) {
single_value->field_cTS__Permission = other_value.cTS__Permission();
} else {
single_value->field_cTS__Permission.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.emergencyNumberList().get_selection()) {
single_value->field_emergencyNumberList = other_value.emergencyNumberList();
} else {
single_value->field_emergencyNumberList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.perMS__T3212().get_selection()) {
single_value->field_perMS__T3212 = other_value.perMS__T3212();
} else {
single_value->field_perMS__T3212.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__ML3__LocationUpdateAccept_template[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__ML3__LocationUpdateAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept.");
break;
}
set_selection(other_value);
}

PDU__ML3__LocationUpdateAccept_template::PDU__ML3__LocationUpdateAccept_template()
{
}

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

PDU__ML3__LocationUpdateAccept_template::PDU__ML3__LocationUpdateAccept_template(const PDU__ML3__LocationUpdateAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__LocationUpdateAccept_template::match(const PDU__ML3__LocationUpdateAccept& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.locationAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_locationAreaIdentification.match(other_value.locationAreaIdentification(), legacy))return FALSE;
if(!other_value.mobileIdentityTLV().is_bound()) return FALSE;
if((other_value.mobileIdentityTLV().ispresent() ? !single_value->field_mobileIdentityTLV.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.mobileIdentityTLV(), legacy) : !single_value->field_mobileIdentityTLV.match_omit(legacy)))return FALSE;
if(!other_value.followOnProceed().is_bound()) return FALSE;
if((other_value.followOnProceed().ispresent() ? !single_value->field_followOnProceed.match((const MobileL3__CommonIE__Types::Type2&)other_value.followOnProceed(), legacy) : !single_value->field_followOnProceed.match_omit(legacy)))return FALSE;
if(!other_value.cTS__Permission().is_bound()) return FALSE;
if((other_value.cTS__Permission().ispresent() ? !single_value->field_cTS__Permission.match((const MobileL3__CommonIE__Types::Type2&)other_value.cTS__Permission(), legacy) : !single_value->field_cTS__Permission.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.emergencyNumberList().is_bound()) return FALSE;
if((other_value.emergencyNumberList().ispresent() ? !single_value->field_emergencyNumberList.match((const EmergencyNumberListTLV&)other_value.emergencyNumberList(), legacy) : !single_value->field_emergencyNumberList.match_omit(legacy)))return FALSE;
if(!other_value.perMS__T3212().is_bound()) return FALSE;
if((other_value.perMS__T3212().ispresent() ? !single_value->field_perMS__T3212.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.perMS__T3212(), legacy) : !single_value->field_perMS__T3212.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_MM_Types.PDU_ML3_LocationUpdateAccept.");
}
return FALSE;
}

boolean PDU__ML3__LocationUpdateAccept_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_nsd.is_bound()
 || single_value->field_locationAreaIdentification.is_bound()
 || (single_value->field_mobileIdentityTLV.is_omit() || single_value->field_mobileIdentityTLV.is_bound())
 || (single_value->field_followOnProceed.is_omit() || single_value->field_followOnProceed.is_bound())
 || (single_value->field_cTS__Permission.is_omit() || single_value->field_cTS__Permission.is_bound())
 || (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_bound())
 || (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_bound())
 || (single_value->field_perMS__T3212.is_omit() || single_value->field_perMS__T3212.is_bound());
}

boolean PDU__ML3__LocationUpdateAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_locationAreaIdentification.is_value()
 && (single_value->field_mobileIdentityTLV.is_omit() || single_value->field_mobileIdentityTLV.is_value())
 && (single_value->field_followOnProceed.is_omit() || single_value->field_followOnProceed.is_value())
 && (single_value->field_cTS__Permission.is_omit() || single_value->field_cTS__Permission.is_value())
 && (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_value())
 && (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_value())
 && (single_value->field_perMS__T3212.is_omit() || single_value->field_perMS__T3212.is_value());
}

void PDU__ML3__LocationUpdateAccept_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__ML3__LocationUpdateAccept PDU__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept.");
PDU__ML3__LocationUpdateAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_locationAreaIdentification.is_bound()) {
ret_val.locationAreaIdentification() = single_value->field_locationAreaIdentification.valueof();
}
if (single_value->field_mobileIdentityTLV.is_omit()) ret_val.mobileIdentityTLV() = OMIT_VALUE;
else if (single_value->field_mobileIdentityTLV.is_bound()) {
ret_val.mobileIdentityTLV() = single_value->field_mobileIdentityTLV.valueof();
}
if (single_value->field_followOnProceed.is_omit()) ret_val.followOnProceed() = OMIT_VALUE;
else if (single_value->field_followOnProceed.is_bound()) {
ret_val.followOnProceed() = single_value->field_followOnProceed.valueof();
}
if (single_value->field_cTS__Permission.is_omit()) ret_val.cTS__Permission() = OMIT_VALUE;
else if (single_value->field_cTS__Permission.is_bound()) {
ret_val.cTS__Permission() = single_value->field_cTS__Permission.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_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_perMS__T3212.is_omit()) ret_val.perMS__T3212() = OMIT_VALUE;
else if (single_value->field_perMS__T3212.is_bound()) {
ret_val.perMS__T3212() = single_value->field_perMS__T3212.valueof();
}
return ret_val;
}

void PDU__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__LocationUpdateAccept_template[list_length];
}

PDU__ML3__LocationUpdateAccept_template& PDU__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__LocationUpdateAccept_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__LocationUpdateAccept_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__LocationUpdateAccept_template::locationAreaIdentification()
{
set_specific();
return single_value->field_locationAreaIdentification;
}

const MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__LocationUpdateAccept_template::locationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentification of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_locationAreaIdentification;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__ML3__LocationUpdateAccept_template::mobileIdentityTLV()
{
set_specific();
return single_value->field_mobileIdentityTLV;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__ML3__LocationUpdateAccept_template::mobileIdentityTLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityTLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_mobileIdentityTLV;
}

MobileL3__CommonIE__Types::Type2_template& PDU__ML3__LocationUpdateAccept_template::followOnProceed()
{
set_specific();
return single_value->field_followOnProceed;
}

const MobileL3__CommonIE__Types::Type2_template& PDU__ML3__LocationUpdateAccept_template::followOnProceed() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field followOnProceed of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_followOnProceed;
}

MobileL3__CommonIE__Types::Type2_template& PDU__ML3__LocationUpdateAccept_template::cTS__Permission()
{
set_specific();
return single_value->field_cTS__Permission;
}

const MobileL3__CommonIE__Types::Type2_template& PDU__ML3__LocationUpdateAccept_template::cTS__Permission() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cTS_Permission of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_cTS__Permission;
}

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

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

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

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

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__ML3__LocationUpdateAccept_template::perMS__T3212()
{
set_specific();
return single_value->field_perMS__T3212;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__ML3__LocationUpdateAccept_template::perMS__T3212() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field perMS_T3212 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
return single_value->field_perMS__T3212;
}

int PDU__ML3__LocationUpdateAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_mobileIdentityTLV.is_present()) ret_val++;
      if (single_value->field_followOnProceed.is_present()) ret_val++;
      if (single_value->field_cTS__Permission.is_present()) ret_val++;
      if (single_value->field_equivalentPLMNs.is_present()) ret_val++;
      if (single_value->field_emergencyNumberList.is_present()) ret_val++;
      if (single_value->field_perMS__T3212.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_MM_Types.PDU_ML3_LocationUpdateAccept 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_MM_Types.PDU_ML3_LocationUpdateAccept containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept.");
  }
  return 0;
}

void PDU__ML3__LocationUpdateAccept_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", mobileIdentityTLV := ");
single_value->field_mobileIdentityTLV.log();
TTCN_Logger::log_event_str(", followOnProceed := ");
single_value->field_followOnProceed.log();
TTCN_Logger::log_event_str(", cTS_Permission := ");
single_value->field_cTS__Permission.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", perMS_T3212 := ");
single_value->field_perMS__T3212.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__ML3__LocationUpdateAccept_template::log_match(const PDU__ML3__LocationUpdateAccept& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_locationAreaIdentification.match(match_value.locationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentification");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mobileIdentityTLV().ispresent()){
if(!single_value->field_mobileIdentityTLV.match(match_value.mobileIdentityTLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityTLV");
single_value->field_mobileIdentityTLV.log_match(match_value.mobileIdentityTLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileIdentityTLV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileIdentityTLV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileIdentityTLV.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.followOnProceed().ispresent()){
if(!single_value->field_followOnProceed.match(match_value.followOnProceed(), legacy)){
TTCN_Logger::log_logmatch_info(".followOnProceed");
single_value->field_followOnProceed.log_match(match_value.followOnProceed(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_followOnProceed.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".followOnProceed := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_followOnProceed.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cTS__Permission().ispresent()){
if(!single_value->field_cTS__Permission.match(match_value.cTS__Permission(), legacy)){
TTCN_Logger::log_logmatch_info(".cTS_Permission");
single_value->field_cTS__Permission.log_match(match_value.cTS__Permission(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cTS__Permission.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cTS_Permission := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cTS__Permission.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.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.perMS__T3212().ispresent()){
if(!single_value->field_perMS__T3212.match(match_value.perMS__T3212(), legacy)){
TTCN_Logger::log_logmatch_info(".perMS_T3212");
single_value->field_perMS__T3212.log_match(match_value.perMS__T3212(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_perMS__T3212.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".perMS_T3212 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_perMS__T3212.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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", mobileIdentityTLV := ");
if (match_value.mobileIdentityTLV().ispresent()) {
single_value->field_mobileIdentityTLV.log_match(match_value.mobileIdentityTLV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileIdentityTLV.log();
if (single_value->field_mobileIdentityTLV.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", followOnProceed := ");
if (match_value.followOnProceed().ispresent()) {
single_value->field_followOnProceed.log_match(match_value.followOnProceed(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_followOnProceed.log();
if (single_value->field_followOnProceed.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cTS_Permission := ");
if (match_value.cTS__Permission().ispresent()) {
single_value->field_cTS__Permission.log_match(match_value.cTS__Permission(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cTS__Permission.log();
if (single_value->field_cTS__Permission.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(", 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(", perMS_T3212 := ");
if (match_value.perMS__T3212().ispresent()) {
single_value->field_perMS__T3212.log_match(match_value.perMS__T3212(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_perMS__T3212.log();
if (single_value->field_perMS__T3212.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__ML3__LocationUpdateAccept_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (!mobileIdentityTLV().is_bound()) mobileIdentityTLV() = OMIT_VALUE;
else mobileIdentityTLV().set_implicit_omit();
if (!followOnProceed().is_bound()) followOnProceed() = OMIT_VALUE;
else followOnProceed().set_implicit_omit();
if (!cTS__Permission().is_bound()) cTS__Permission() = OMIT_VALUE;
else cTS__Permission().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!perMS__T3212().is_bound()) perMS__T3212() = OMIT_VALUE;
else perMS__T3212().set_implicit_omit();
}

void PDU__ML3__LocationUpdateAccept_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_nsd.encode_text(text_buf);
single_value->field_locationAreaIdentification.encode_text(text_buf);
single_value->field_mobileIdentityTLV.encode_text(text_buf);
single_value->field_followOnProceed.encode_text(text_buf);
single_value->field_cTS__Permission.encode_text(text_buf);
single_value->field_equivalentPLMNs.encode_text(text_buf);
single_value->field_emergencyNumberList.encode_text(text_buf);
single_value->field_perMS__T3212.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_MM_Types.PDU_ML3_LocationUpdateAccept.");
}
}

void PDU__ML3__LocationUpdateAccept_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_nsd.decode_text(text_buf);
single_value->field_locationAreaIdentification.decode_text(text_buf);
single_value->field_mobileIdentityTLV.decode_text(text_buf);
single_value->field_followOnProceed.decode_text(text_buf);
single_value->field_cTS__Permission.decode_text(text_buf);
single_value->field_equivalentPLMNs.decode_text(text_buf);
single_value->field_emergencyNumberList.decode_text(text_buf);
single_value->field_perMS__T3212.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__ML3__LocationUpdateAccept_template[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_MM_Types.PDU_ML3_LocationUpdateAccept.");
}
}

void PDU__ML3__LocationUpdateAccept_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__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityTLV().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) followOnProceed().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cTS__Permission().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) perMS__T3212().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityTLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityTLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "followOnProceed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          followOnProceed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cTS_Permission")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cTS__Permission().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "perMS_T3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          perMS__T3212().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_MM_Types.PDU_ML3_LocationUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__LocationUpdateAccept_template* precondition = new PDU__ML3__LocationUpdateAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__LocationUpdateAccept_template* implied_template = new PDU__ML3__LocationUpdateAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__LocationUpdateAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__LocationUpdateAccept_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_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_locationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_mobileIdentityTLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_followOnProceed.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_cTS__Permission.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_equivalentPLMNs.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_emergencyNumberList.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
single_value->field_perMS__T3212.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept");
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_MM_Types.PDU_ML3_LocationUpdateAccept");
}

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

boolean PDU__ML3__LocationUpdateAccept_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__ML3__LocationUpdateReject::PDU__ML3__LocationUpdateReject()
{
}

PDU__ML3__LocationUpdateReject::PDU__ML3__LocationUpdateReject(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_rejectCause,
    const OPTIONAL< MM__TimerTLV >& par_t3246__Value)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_rejectCause(par_rejectCause),
  field_t3246__Value(par_t3246__Value)
{
}

PDU__ML3__LocationUpdateReject::PDU__ML3__LocationUpdateReject(const PDU__ML3__LocationUpdateReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
else field_rejectCause.clean_up();
if (other_value.t3246__Value().is_bound()) field_t3246__Value = other_value.t3246__Value();
else field_t3246__Value.clean_up();
}

void PDU__ML3__LocationUpdateReject::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_rejectCause.clean_up();
field_t3246__Value.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__LocationUpdateReject::get_descriptor() const { return &PDU__ML3__LocationUpdateReject_descr_; }
PDU__ML3__LocationUpdateReject& PDU__ML3__LocationUpdateReject::operator=(const PDU__ML3__LocationUpdateReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
  else field_rejectCause.clean_up();
  if (other_value.t3246__Value().is_bound()) field_t3246__Value = other_value.t3246__Value();
  else field_t3246__Value.clean_up();
}
return *this;
}

boolean PDU__ML3__LocationUpdateReject::operator==(const PDU__ML3__LocationUpdateReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_rejectCause==other_value.field_rejectCause
  && field_t3246__Value==other_value.field_t3246__Value;
}

boolean PDU__ML3__LocationUpdateReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_rejectCause.is_bound())
  || (OPTIONAL_OMIT == field_t3246__Value.get_selection() || field_t3246__Value.is_bound());
}
boolean PDU__ML3__LocationUpdateReject::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_rejectCause.is_value()
  && (OPTIONAL_OMIT == field_t3246__Value.get_selection() || field_t3246__Value.is_value());
}
int PDU__ML3__LocationUpdateReject::size_of() const
{
  int ret_val = 3;
  if (field_t3246__Value.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__LocationUpdateReject::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
field_rejectCause.log();
TTCN_Logger::log_event_str(", t3246_Value := ");
field_t3246__Value.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__LocationUpdateReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!t3246__Value().is_bound()) t3246__Value() = OMIT_VALUE;
else t3246__Value().set_implicit_omit();
}

void PDU__ML3__LocationUpdateReject::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_MM_Types.PDU_ML3_LocationUpdateReject 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3246__Value().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3246_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3246__Value().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_MM_Types.PDU_ML3_LocationUpdateReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject");
  }
}

void PDU__ML3__LocationUpdateReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_rejectCause.encode_text(text_buf);
field_t3246__Value.encode_text(text_buf);
}

void PDU__ML3__LocationUpdateReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_rejectCause.decode_text(text_buf);
field_t3246__Value.decode_text(text_buf);
}

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

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

int PDU__ML3__LocationUpdateReject::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rejectCause.RAW_decode(General__Types::OCT1_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_t3246__Value = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MM__TimerTLV_descr_.raw->forceomit);
  decoded_field_length = field_t3246__Value().RAW_decode(MM__TimerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_t3246__Value = 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_t3246__Value=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__LocationUpdateReject::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  if (field_t3246__Value.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MM__TimerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rejectCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  if (field_t3246__Value.ispresent()) {
  encoded_length += field_t3246__Value().RAW_encode(MM__TimerTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__LocationUpdateReject_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_rejectCause;
MM__TimerTLV_template field_t3246__Value;
};

void PDU__ML3__LocationUpdateReject_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_nsd = ANY_VALUE;
single_value->field_rejectCause = ANY_VALUE;
single_value->field_t3246__Value = ANY_OR_OMIT;
}
}
}

void PDU__ML3__LocationUpdateReject_template::copy_value(const PDU__ML3__LocationUpdateReject& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.rejectCause().is_bound()) {
  single_value->field_rejectCause = other_value.rejectCause();
} else {
  single_value->field_rejectCause.clean_up();
}
if (other_value.t3246__Value().is_bound()) {
  if (other_value.t3246__Value().ispresent()) single_value->field_t3246__Value = other_value.t3246__Value()();
  else single_value->field_t3246__Value = OMIT_VALUE;
} else {
  single_value->field_t3246__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__LocationUpdateReject_template::copy_template(const PDU__ML3__LocationUpdateReject_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rejectCause().get_selection()) {
single_value->field_rejectCause = other_value.rejectCause();
} else {
single_value->field_rejectCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3246__Value().get_selection()) {
single_value->field_t3246__Value = other_value.t3246__Value();
} else {
single_value->field_t3246__Value.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__ML3__LocationUpdateReject_template[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__ML3__LocationUpdateReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject.");
break;
}
set_selection(other_value);
}

PDU__ML3__LocationUpdateReject_template::PDU__ML3__LocationUpdateReject_template()
{
}

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

PDU__ML3__LocationUpdateReject_template::PDU__ML3__LocationUpdateReject_template(const PDU__ML3__LocationUpdateReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__LocationUpdateReject_template::match(const PDU__ML3__LocationUpdateReject& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.rejectCause().is_bound()) return FALSE;
if(!single_value->field_rejectCause.match(other_value.rejectCause(), legacy))return FALSE;
if(!other_value.t3246__Value().is_bound()) return FALSE;
if((other_value.t3246__Value().ispresent() ? !single_value->field_t3246__Value.match((const MM__TimerTLV&)other_value.t3246__Value(), legacy) : !single_value->field_t3246__Value.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_MM_Types.PDU_ML3_LocationUpdateReject.");
}
return FALSE;
}

boolean PDU__ML3__LocationUpdateReject_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_nsd.is_bound()
 || single_value->field_rejectCause.is_bound()
 || (single_value->field_t3246__Value.is_omit() || single_value->field_t3246__Value.is_bound());
}

boolean PDU__ML3__LocationUpdateReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_rejectCause.is_value()
 && (single_value->field_t3246__Value.is_omit() || single_value->field_t3246__Value.is_value());
}

void PDU__ML3__LocationUpdateReject_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__ML3__LocationUpdateReject PDU__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject.");
PDU__ML3__LocationUpdateReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_rejectCause.is_bound()) {
ret_val.rejectCause() = single_value->field_rejectCause.valueof();
}
if (single_value->field_t3246__Value.is_omit()) ret_val.t3246__Value() = OMIT_VALUE;
else if (single_value->field_t3246__Value.is_bound()) {
ret_val.t3246__Value() = single_value->field_t3246__Value.valueof();
}
return ret_val;
}

void PDU__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__LocationUpdateReject_template[list_length];
}

PDU__ML3__LocationUpdateReject_template& PDU__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__LocationUpdateReject_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__LocationUpdateReject_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__LocationUpdateReject_template::rejectCause()
{
set_specific();
return single_value->field_rejectCause;
}

const OCTETSTRING_template& PDU__ML3__LocationUpdateReject_template::rejectCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rejectCause of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
return single_value->field_rejectCause;
}

MM__TimerTLV_template& PDU__ML3__LocationUpdateReject_template::t3246__Value()
{
set_specific();
return single_value->field_t3246__Value;
}

const MM__TimerTLV_template& PDU__ML3__LocationUpdateReject_template::t3246__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3246_Value of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateReject.");
return single_value->field_t3246__Value;
}

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

void PDU__ML3__LocationUpdateReject_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log();
TTCN_Logger::log_event_str(", t3246_Value := ");
single_value->field_t3246__Value.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__ML3__LocationUpdateReject_template::log_match(const PDU__ML3__LocationUpdateReject& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rejectCause.match(match_value.rejectCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rejectCause");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.t3246__Value().ispresent()){
if(!single_value->field_t3246__Value.match(match_value.t3246__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".t3246_Value");
single_value->field_t3246__Value.log_match(match_value.t3246__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3246__Value.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3246_Value := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3246__Value.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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log_match(match_value.rejectCause(), legacy);
TTCN_Logger::log_event_str(", t3246_Value := ");
if (match_value.t3246__Value().ispresent()) {
single_value->field_t3246__Value.log_match(match_value.t3246__Value(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3246__Value.log();
if (single_value->field_t3246__Value.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__ML3__LocationUpdateReject_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
if (!t3246__Value().is_bound()) t3246__Value() = OMIT_VALUE;
else t3246__Value().set_implicit_omit();
}

void PDU__ML3__LocationUpdateReject_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_nsd.encode_text(text_buf);
single_value->field_rejectCause.encode_text(text_buf);
single_value->field_t3246__Value.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_MM_Types.PDU_ML3_LocationUpdateReject.");
}
}

void PDU__ML3__LocationUpdateReject_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_nsd.decode_text(text_buf);
single_value->field_rejectCause.decode_text(text_buf);
single_value->field_t3246__Value.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__ML3__LocationUpdateReject_template[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_MM_Types.PDU_ML3_LocationUpdateReject.");
}
}

void PDU__ML3__LocationUpdateReject_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__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rejectCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3246__Value().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rejectCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rejectCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3246_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3246__Value().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_MM_Types.PDU_ML3_LocationUpdateReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__LocationUpdateReject_template* precondition = new PDU__ML3__LocationUpdateReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__LocationUpdateReject_template* implied_template = new PDU__ML3__LocationUpdateReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__LocationUpdateReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__LocationUpdateReject_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_MM_Types.PDU_ML3_LocationUpdateReject");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject");
single_value->field_rejectCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject");
single_value->field_t3246__Value.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject");
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_MM_Types.PDU_ML3_LocationUpdateReject");
}

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

boolean PDU__ML3__LocationUpdateReject_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__ML3__LocationUpdateRequest::PDU__ML3__LocationUpdateRequest()
{
}

PDU__ML3__LocationUpdateRequest::PDU__ML3__LocationUpdateRequest(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const LocationUpdatingType& par_locationUpdatingType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySequenceNumber,
    const MobileL3__CommonIE__Types::LocationAreaIdentification__V& par_locationAreaIdentification,
    const MobileL3__CommonIE__Types::MobileStationClassmark1__V& par_mobileStationClassmark1,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentityLV,
    const OPTIONAL< MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS >& par_classmarkInformationType2__forUMTS,
    const OPTIONAL< MobileL3__CommonIE__Types::AdditionalUpdateParameterTV >& par_additionalUpdateParameterTV,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV >& par_mS__NetworkFeatureSupport)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_locationUpdatingType(par_locationUpdatingType),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_locationAreaIdentification(par_locationAreaIdentification),
  field_mobileStationClassmark1(par_mobileStationClassmark1),
  field_mobileIdentityLV(par_mobileIdentityLV),
  field_classmarkInformationType2__forUMTS(par_classmarkInformationType2__forUMTS),
  field_additionalUpdateParameterTV(par_additionalUpdateParameterTV),
  field_deviceProperties(par_deviceProperties),
  field_mS__NetworkFeatureSupport(par_mS__NetworkFeatureSupport)
{
}

PDU__ML3__LocationUpdateRequest::PDU__ML3__LocationUpdateRequest(const PDU__ML3__LocationUpdateRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.locationUpdatingType().is_bound()) field_locationUpdatingType = other_value.locationUpdatingType();
else field_locationUpdatingType.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
else field_locationAreaIdentification.clean_up();
if (other_value.mobileStationClassmark1().is_bound()) field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
else field_mobileStationClassmark1.clean_up();
if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
else field_mobileIdentityLV.clean_up();
if (other_value.classmarkInformationType2__forUMTS().is_bound()) field_classmarkInformationType2__forUMTS = other_value.classmarkInformationType2__forUMTS();
else field_classmarkInformationType2__forUMTS.clean_up();
if (other_value.additionalUpdateParameterTV().is_bound()) field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
else field_additionalUpdateParameterTV.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();
}

void PDU__ML3__LocationUpdateRequest::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_locationUpdatingType.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_locationAreaIdentification.clean_up();
field_mobileStationClassmark1.clean_up();
field_mobileIdentityLV.clean_up();
field_classmarkInformationType2__forUMTS.clean_up();
field_additionalUpdateParameterTV.clean_up();
field_deviceProperties.clean_up();
field_mS__NetworkFeatureSupport.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__LocationUpdateRequest::get_descriptor() const { return &PDU__ML3__LocationUpdateRequest_descr_; }
PDU__ML3__LocationUpdateRequest& PDU__ML3__LocationUpdateRequest::operator=(const PDU__ML3__LocationUpdateRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.locationUpdatingType().is_bound()) field_locationUpdatingType = other_value.locationUpdatingType();
  else field_locationUpdatingType.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
  else field_locationAreaIdentification.clean_up();
  if (other_value.mobileStationClassmark1().is_bound()) field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
  else field_mobileStationClassmark1.clean_up();
  if (other_value.mobileIdentityLV().is_bound()) field_mobileIdentityLV = other_value.mobileIdentityLV();
  else field_mobileIdentityLV.clean_up();
  if (other_value.classmarkInformationType2__forUMTS().is_bound()) field_classmarkInformationType2__forUMTS = other_value.classmarkInformationType2__forUMTS();
  else field_classmarkInformationType2__forUMTS.clean_up();
  if (other_value.additionalUpdateParameterTV().is_bound()) field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
  else field_additionalUpdateParameterTV.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();
}
return *this;
}

boolean PDU__ML3__LocationUpdateRequest::operator==(const PDU__ML3__LocationUpdateRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_locationUpdatingType==other_value.field_locationUpdatingType
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_locationAreaIdentification==other_value.field_locationAreaIdentification
  && field_mobileStationClassmark1==other_value.field_mobileStationClassmark1
  && field_mobileIdentityLV==other_value.field_mobileIdentityLV
  && field_classmarkInformationType2__forUMTS==other_value.field_classmarkInformationType2__forUMTS
  && field_additionalUpdateParameterTV==other_value.field_additionalUpdateParameterTV
  && field_deviceProperties==other_value.field_deviceProperties
  && field_mS__NetworkFeatureSupport==other_value.field_mS__NetworkFeatureSupport;
}

boolean PDU__ML3__LocationUpdateRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_locationUpdatingType.is_bound())
  || (field_cipheringKeySequenceNumber.is_bound())
  || (field_locationAreaIdentification.is_bound())
  || (field_mobileStationClassmark1.is_bound())
  || (field_mobileIdentityLV.is_bound())
  || (OPTIONAL_OMIT == field_classmarkInformationType2__forUMTS.get_selection() || field_classmarkInformationType2__forUMTS.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateParameterTV.get_selection() || field_additionalUpdateParameterTV.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_bound());
}
boolean PDU__ML3__LocationUpdateRequest::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_locationUpdatingType.is_value()
  && field_cipheringKeySequenceNumber.is_value()
  && field_locationAreaIdentification.is_value()
  && field_mobileStationClassmark1.is_value()
  && field_mobileIdentityLV.is_value()
  && (OPTIONAL_OMIT == field_classmarkInformationType2__forUMTS.get_selection() || field_classmarkInformationType2__forUMTS.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateParameterTV.get_selection() || field_additionalUpdateParameterTV.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_value());
}
int PDU__ML3__LocationUpdateRequest::size_of() const
{
  int ret_val = 7;
  if (field_classmarkInformationType2__forUMTS.ispresent()) ret_val++;
  if (field_additionalUpdateParameterTV.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_mS__NetworkFeatureSupport.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__LocationUpdateRequest::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", locationUpdatingType := ");
field_locationUpdatingType.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
field_mobileStationClassmark1.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", classmarkInformationType2_forUMTS := ");
field_classmarkInformationType2__forUMTS.log();
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
field_additionalUpdateParameterTV.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(" }");
}

void PDU__ML3__LocationUpdateRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationUpdatingType().is_bound()) locationUpdatingType().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (mobileStationClassmark1().is_bound()) mobileStationClassmark1().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!classmarkInformationType2__forUMTS().is_bound()) classmarkInformationType2__forUMTS() = OMIT_VALUE;
else classmarkInformationType2__forUMTS().set_implicit_omit();
if (!additionalUpdateParameterTV().is_bound()) additionalUpdateParameterTV() = OMIT_VALUE;
else additionalUpdateParameterTV().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();
}

void PDU__ML3__LocationUpdateRequest::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 (11<param.get_size()) {
      param.error("record value of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest has 11 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationUpdatingType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) classmarkInformationType2__forUMTS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameterTV().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(10));
    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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationUpdatingType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationUpdatingType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "classmarkInformationType2_forUMTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkInformationType2__forUMTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateParameterTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameterTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) 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_MM_Types.PDU_ML3_LocationUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
  }
}

void PDU__ML3__LocationUpdateRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_locationUpdatingType.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_locationAreaIdentification.encode_text(text_buf);
field_mobileStationClassmark1.encode_text(text_buf);
field_mobileIdentityLV.encode_text(text_buf);
field_classmarkInformationType2__forUMTS.encode_text(text_buf);
field_additionalUpdateParameterTV.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_mS__NetworkFeatureSupport.encode_text(text_buf);
}

void PDU__ML3__LocationUpdateRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_locationUpdatingType.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_locationAreaIdentification.decode_text(text_buf);
field_mobileStationClassmark1.decode_text(text_buf);
field_mobileIdentityLV.decode_text(text_buf);
field_classmarkInformationType2__forUMTS.decode_text(text_buf);
field_additionalUpdateParameterTV.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_mS__NetworkFeatureSupport.decode_text(text_buf);
}

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

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

int PDU__ML3__LocationUpdateRequest::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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, LocationUpdatingType_descr_.raw->forceomit);
  decoded_field_length = field_locationUpdatingType.RAW_decode(LocationUpdatingType_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_cipheringKeySequenceNumber.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, MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentification.RAW_decode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_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::MobileStationClassmark1__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark1.RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark1__V_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentityLV.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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_classmarkInformationType2__forUMTS = 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::ClassmarkInformationType2__forUMTS_descr_.raw->forceomit);
  decoded_field_length = field_classmarkInformationType2__forUMTS().RAW_decode(MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_classmarkInformationType2__forUMTS = 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_classmarkInformationType2__forUMTS=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_additionalUpdateParameterTV = 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::AdditionalUpdateParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateParameterTV().RAW_decode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateParameterTV = 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_additionalUpdateParameterTV=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_deviceProperties = 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::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_9_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_3){
  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)(10)) {
    field_mS__NetworkFeatureSupport = 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::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_10_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_7){
  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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__LocationUpdateRequest::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 = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, LocationUpdatingType_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, MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileStationClassmark1__V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_classmarkInformationType2__forUMTS.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_additionalUpdateParameterTV.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_locationUpdatingType.RAW_encode(LocationUpdatingType_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cipheringKeySequenceNumber.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_locationAreaIdentification.RAW_encode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileStationClassmark1.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark1__V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mobileIdentityLV.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[6]);
  if (field_classmarkInformationType2__forUMTS.ispresent()) {
  encoded_length += field_classmarkInformationType2__forUMTS().RAW_encode(MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_additionalUpdateParameterTV.ispresent()) {
  encoded_length += field_additionalUpdateParameterTV().RAW_encode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  encoded_length += field_mS__NetworkFeatureSupport().RAW_encode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,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_3.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_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,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_7.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 PDU__ML3__LocationUpdateRequest_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
LocationUpdatingType_template field_locationUpdatingType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySequenceNumber;
MobileL3__CommonIE__Types::LocationAreaIdentification__V_template field_locationAreaIdentification;
MobileL3__CommonIE__Types::MobileStationClassmark1__V_template field_mobileStationClassmark1;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentityLV;
MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_template field_classmarkInformationType2__forUMTS;
MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template field_additionalUpdateParameterTV;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template field_mS__NetworkFeatureSupport;
};

void PDU__ML3__LocationUpdateRequest_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_nsd = ANY_VALUE;
single_value->field_locationUpdatingType = ANY_VALUE;
single_value->field_cipheringKeySequenceNumber = ANY_VALUE;
single_value->field_locationAreaIdentification = ANY_VALUE;
single_value->field_mobileStationClassmark1 = ANY_VALUE;
single_value->field_mobileIdentityLV = ANY_VALUE;
single_value->field_classmarkInformationType2__forUMTS = ANY_OR_OMIT;
single_value->field_additionalUpdateParameterTV = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_mS__NetworkFeatureSupport = ANY_OR_OMIT;
}
}
}

void PDU__ML3__LocationUpdateRequest_template::copy_value(const PDU__ML3__LocationUpdateRequest& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.locationUpdatingType().is_bound()) {
  single_value->field_locationUpdatingType = other_value.locationUpdatingType();
} else {
  single_value->field_locationUpdatingType.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.locationAreaIdentification().is_bound()) {
  single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
  single_value->field_locationAreaIdentification.clean_up();
}
if (other_value.mobileStationClassmark1().is_bound()) {
  single_value->field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
} else {
  single_value->field_mobileStationClassmark1.clean_up();
}
if (other_value.mobileIdentityLV().is_bound()) {
  single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
  single_value->field_mobileIdentityLV.clean_up();
}
if (other_value.classmarkInformationType2__forUMTS().is_bound()) {
  if (other_value.classmarkInformationType2__forUMTS().ispresent()) single_value->field_classmarkInformationType2__forUMTS = other_value.classmarkInformationType2__forUMTS()();
  else single_value->field_classmarkInformationType2__forUMTS = OMIT_VALUE;
} else {
  single_value->field_classmarkInformationType2__forUMTS.clean_up();
}
if (other_value.additionalUpdateParameterTV().is_bound()) {
  if (other_value.additionalUpdateParameterTV().ispresent()) single_value->field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV()();
  else single_value->field_additionalUpdateParameterTV = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateParameterTV.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();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__LocationUpdateRequest_template::copy_template(const PDU__ML3__LocationUpdateRequest_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationUpdatingType().get_selection()) {
single_value->field_locationUpdatingType = other_value.locationUpdatingType();
} else {
single_value->field_locationUpdatingType.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.locationAreaIdentification().get_selection()) {
single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
single_value->field_locationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark1().get_selection()) {
single_value->field_mobileStationClassmark1 = other_value.mobileStationClassmark1();
} else {
single_value->field_mobileStationClassmark1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentityLV().get_selection()) {
single_value->field_mobileIdentityLV = other_value.mobileIdentityLV();
} else {
single_value->field_mobileIdentityLV.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.classmarkInformationType2__forUMTS().get_selection()) {
single_value->field_classmarkInformationType2__forUMTS = other_value.classmarkInformationType2__forUMTS();
} else {
single_value->field_classmarkInformationType2__forUMTS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateParameterTV().get_selection()) {
single_value->field_additionalUpdateParameterTV = other_value.additionalUpdateParameterTV();
} else {
single_value->field_additionalUpdateParameterTV.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();
}
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__ML3__LocationUpdateRequest_template[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__ML3__LocationUpdateRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__LocationUpdateRequest_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_MM_Types.PDU_ML3_LocationUpdateRequest.");
break;
}
set_selection(other_value);
}

PDU__ML3__LocationUpdateRequest_template::PDU__ML3__LocationUpdateRequest_template()
{
}

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

PDU__ML3__LocationUpdateRequest_template::PDU__ML3__LocationUpdateRequest_template(const PDU__ML3__LocationUpdateRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__LocationUpdateRequest_template::match(const PDU__ML3__LocationUpdateRequest& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.locationUpdatingType().is_bound()) return FALSE;
if(!single_value->field_locationUpdatingType.match(other_value.locationUpdatingType(), legacy))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySequenceNumber.match(other_value.cipheringKeySequenceNumber(), legacy))return FALSE;
if(!other_value.locationAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_locationAreaIdentification.match(other_value.locationAreaIdentification(), legacy))return FALSE;
if(!other_value.mobileStationClassmark1().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark1.match(other_value.mobileStationClassmark1(), legacy))return FALSE;
if(!other_value.mobileIdentityLV().is_bound()) return FALSE;
if(!single_value->field_mobileIdentityLV.match(other_value.mobileIdentityLV(), legacy))return FALSE;
if(!other_value.classmarkInformationType2__forUMTS().is_bound()) return FALSE;
if((other_value.classmarkInformationType2__forUMTS().ispresent() ? !single_value->field_classmarkInformationType2__forUMTS.match((const MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS&)other_value.classmarkInformationType2__forUMTS(), legacy) : !single_value->field_classmarkInformationType2__forUMTS.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateParameterTV().is_bound()) return FALSE;
if((other_value.additionalUpdateParameterTV().ispresent() ? !single_value->field_additionalUpdateParameterTV.match((const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV&)other_value.additionalUpdateParameterTV(), legacy) : !single_value->field_additionalUpdateParameterTV.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;
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_MM_Types.PDU_ML3_LocationUpdateRequest.");
}
return FALSE;
}

boolean PDU__ML3__LocationUpdateRequest_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_nsd.is_bound()
 || single_value->field_locationUpdatingType.is_bound()
 || single_value->field_cipheringKeySequenceNumber.is_bound()
 || single_value->field_locationAreaIdentification.is_bound()
 || single_value->field_mobileStationClassmark1.is_bound()
 || single_value->field_mobileIdentityLV.is_bound()
 || (single_value->field_classmarkInformationType2__forUMTS.is_omit() || single_value->field_classmarkInformationType2__forUMTS.is_bound())
 || (single_value->field_additionalUpdateParameterTV.is_omit() || single_value->field_additionalUpdateParameterTV.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());
}

boolean PDU__ML3__LocationUpdateRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_locationUpdatingType.is_value()
 && single_value->field_cipheringKeySequenceNumber.is_value()
 && single_value->field_locationAreaIdentification.is_value()
 && single_value->field_mobileStationClassmark1.is_value()
 && single_value->field_mobileIdentityLV.is_value()
 && (single_value->field_classmarkInformationType2__forUMTS.is_omit() || single_value->field_classmarkInformationType2__forUMTS.is_value())
 && (single_value->field_additionalUpdateParameterTV.is_omit() || single_value->field_additionalUpdateParameterTV.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());
}

void PDU__ML3__LocationUpdateRequest_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__ML3__LocationUpdateRequest PDU__ML3__LocationUpdateRequest_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_MM_Types.PDU_ML3_LocationUpdateRequest.");
PDU__ML3__LocationUpdateRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_locationUpdatingType.is_bound()) {
ret_val.locationUpdatingType() = single_value->field_locationUpdatingType.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_locationAreaIdentification.is_bound()) {
ret_val.locationAreaIdentification() = single_value->field_locationAreaIdentification.valueof();
}
if (single_value->field_mobileStationClassmark1.is_bound()) {
ret_val.mobileStationClassmark1() = single_value->field_mobileStationClassmark1.valueof();
}
if (single_value->field_mobileIdentityLV.is_bound()) {
ret_val.mobileIdentityLV() = single_value->field_mobileIdentityLV.valueof();
}
if (single_value->field_classmarkInformationType2__forUMTS.is_omit()) ret_val.classmarkInformationType2__forUMTS() = OMIT_VALUE;
else if (single_value->field_classmarkInformationType2__forUMTS.is_bound()) {
ret_val.classmarkInformationType2__forUMTS() = single_value->field_classmarkInformationType2__forUMTS.valueof();
}
if (single_value->field_additionalUpdateParameterTV.is_omit()) ret_val.additionalUpdateParameterTV() = OMIT_VALUE;
else if (single_value->field_additionalUpdateParameterTV.is_bound()) {
ret_val.additionalUpdateParameterTV() = single_value->field_additionalUpdateParameterTV.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();
}
return ret_val;
}

void PDU__ML3__LocationUpdateRequest_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_MM_Types.PDU_ML3_LocationUpdateRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__LocationUpdateRequest_template[list_length];
}

PDU__ML3__LocationUpdateRequest_template& PDU__ML3__LocationUpdateRequest_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_MM_Types.PDU_ML3_LocationUpdateRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__LocationUpdateRequest_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__LocationUpdateRequest_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_nsd;
}

LocationUpdatingType_template& PDU__ML3__LocationUpdateRequest_template::locationUpdatingType()
{
set_specific();
return single_value->field_locationUpdatingType;
}

const LocationUpdatingType_template& PDU__ML3__LocationUpdateRequest_template::locationUpdatingType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationUpdatingType of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_locationUpdatingType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__LocationUpdateRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__ML3__LocationUpdateRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__LocationUpdateRequest_template::locationAreaIdentification()
{
set_specific();
return single_value->field_locationAreaIdentification;
}

const MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__LocationUpdateRequest_template::locationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentification of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_locationAreaIdentification;
}

MobileL3__CommonIE__Types::MobileStationClassmark1__V_template& PDU__ML3__LocationUpdateRequest_template::mobileStationClassmark1()
{
set_specific();
return single_value->field_mobileStationClassmark1;
}

const MobileL3__CommonIE__Types::MobileStationClassmark1__V_template& PDU__ML3__LocationUpdateRequest_template::mobileStationClassmark1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark1 of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_mobileStationClassmark1;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__LocationUpdateRequest_template::mobileIdentityLV()
{
set_specific();
return single_value->field_mobileIdentityLV;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__ML3__LocationUpdateRequest_template::mobileIdentityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentityLV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_mobileIdentityLV;
}

MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_template& PDU__ML3__LocationUpdateRequest_template::classmarkInformationType2__forUMTS()
{
set_specific();
return single_value->field_classmarkInformationType2__forUMTS;
}

const MobileL3__CommonIE__Types::ClassmarkInformationType2__forUMTS_template& PDU__ML3__LocationUpdateRequest_template::classmarkInformationType2__forUMTS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field classmarkInformationType2_forUMTS of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_classmarkInformationType2__forUMTS;
}

MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__ML3__LocationUpdateRequest_template::additionalUpdateParameterTV()
{
set_specific();
return single_value->field_additionalUpdateParameterTV;
}

const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__ML3__LocationUpdateRequest_template::additionalUpdateParameterTV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateParameterTV of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest.");
return single_value->field_additionalUpdateParameterTV;
}

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

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

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

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

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

void PDU__ML3__LocationUpdateRequest_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", locationUpdatingType := ");
single_value->field_locationUpdatingType.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
single_value->field_mobileStationClassmark1.log();
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log();
TTCN_Logger::log_event_str(", classmarkInformationType2_forUMTS := ");
single_value->field_classmarkInformationType2__forUMTS.log();
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
single_value->field_additionalUpdateParameterTV.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(" }");
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__ML3__LocationUpdateRequest_template::log_match(const PDU__ML3__LocationUpdateRequest& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_locationUpdatingType.match(match_value.locationUpdatingType(), legacy)){
TTCN_Logger::log_logmatch_info(".locationUpdatingType");
single_value->field_locationUpdatingType.log_match(match_value.locationUpdatingType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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);
}
if(!single_value->field_locationAreaIdentification.match(match_value.locationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentification");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileStationClassmark1.match(match_value.mobileStationClassmark1(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark1");
single_value->field_mobileStationClassmark1.log_match(match_value.mobileStationClassmark1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentityLV.match(match_value.mobileIdentityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentityLV");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.classmarkInformationType2__forUMTS().ispresent()){
if(!single_value->field_classmarkInformationType2__forUMTS.match(match_value.classmarkInformationType2__forUMTS(), legacy)){
TTCN_Logger::log_logmatch_info(".classmarkInformationType2_forUMTS");
single_value->field_classmarkInformationType2__forUMTS.log_match(match_value.classmarkInformationType2__forUMTS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_classmarkInformationType2__forUMTS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".classmarkInformationType2_forUMTS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_classmarkInformationType2__forUMTS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateParameterTV().ispresent()){
if(!single_value->field_additionalUpdateParameterTV.match(match_value.additionalUpdateParameterTV(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateParameterTV");
single_value->field_additionalUpdateParameterTV.log_match(match_value.additionalUpdateParameterTV(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateParameterTV.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateParameterTV := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateParameterTV.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);
}
}
}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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", locationUpdatingType := ");
single_value->field_locationUpdatingType.log_match(match_value.locationUpdatingType(), legacy);
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", mobileStationClassmark1 := ");
single_value->field_mobileStationClassmark1.log_match(match_value.mobileStationClassmark1(), legacy);
TTCN_Logger::log_event_str(", mobileIdentityLV := ");
single_value->field_mobileIdentityLV.log_match(match_value.mobileIdentityLV(), legacy);
TTCN_Logger::log_event_str(", classmarkInformationType2_forUMTS := ");
if (match_value.classmarkInformationType2__forUMTS().ispresent()) {
single_value->field_classmarkInformationType2__forUMTS.log_match(match_value.classmarkInformationType2__forUMTS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_classmarkInformationType2__forUMTS.log();
if (single_value->field_classmarkInformationType2__forUMTS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateParameterTV := ");
if (match_value.additionalUpdateParameterTV().ispresent()) {
single_value->field_additionalUpdateParameterTV.log_match(match_value.additionalUpdateParameterTV(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateParameterTV.log();
if (single_value->field_additionalUpdateParameterTV.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(" }");
} 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__ML3__LocationUpdateRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationUpdatingType().is_bound()) locationUpdatingType().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (mobileStationClassmark1().is_bound()) mobileStationClassmark1().set_implicit_omit();
if (mobileIdentityLV().is_bound()) mobileIdentityLV().set_implicit_omit();
if (!classmarkInformationType2__forUMTS().is_bound()) classmarkInformationType2__forUMTS() = OMIT_VALUE;
else classmarkInformationType2__forUMTS().set_implicit_omit();
if (!additionalUpdateParameterTV().is_bound()) additionalUpdateParameterTV() = OMIT_VALUE;
else additionalUpdateParameterTV().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();
}

void PDU__ML3__LocationUpdateRequest_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_nsd.encode_text(text_buf);
single_value->field_locationUpdatingType.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_locationAreaIdentification.encode_text(text_buf);
single_value->field_mobileStationClassmark1.encode_text(text_buf);
single_value->field_mobileIdentityLV.encode_text(text_buf);
single_value->field_classmarkInformationType2__forUMTS.encode_text(text_buf);
single_value->field_additionalUpdateParameterTV.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.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_MM_Types.PDU_ML3_LocationUpdateRequest.");
}
}

void PDU__ML3__LocationUpdateRequest_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_nsd.decode_text(text_buf);
single_value->field_locationUpdatingType.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_locationAreaIdentification.decode_text(text_buf);
single_value->field_mobileStationClassmark1.decode_text(text_buf);
single_value->field_mobileIdentityLV.decode_text(text_buf);
single_value->field_classmarkInformationType2__forUMTS.decode_text(text_buf);
single_value->field_additionalUpdateParameterTV.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.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__ML3__LocationUpdateRequest_template[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_MM_Types.PDU_ML3_LocationUpdateRequest.");
}
}

void PDU__ML3__LocationUpdateRequest_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__ML3__LocationUpdateRequest_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 (11<param.get_size()) {
      param.error("record template of type @MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest has 11 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationUpdatingType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileIdentityLV().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) classmarkInformationType2__forUMTS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameterTV().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(10));
    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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationUpdatingType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationUpdatingType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentityLV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentityLV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "classmarkInformationType2_forUMTS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkInformationType2__forUMTS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateParameterTV")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameterTV().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) 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_MM_Types.PDU_ML3_LocationUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__LocationUpdateRequest_template* precondition = new PDU__ML3__LocationUpdateRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__LocationUpdateRequest_template* implied_template = new PDU__ML3__LocationUpdateRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__LocationUpdateRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__LocationUpdateRequest_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_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_locationUpdatingType.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_locationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_mobileStationClassmark1.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_mobileIdentityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_classmarkInformationType2__forUMTS.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_additionalUpdateParameterTV.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
single_value->field_mS__NetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest");
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_MM_Types.PDU_ML3_LocationUpdateRequest");
}

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

boolean PDU__ML3__LocationUpdateRequest_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__ML3__MMInformation::PDU__ML3__MMInformation()
{
}

PDU__ML3__MMInformation::PDU__ML3__MMInformation(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< NetworkNameTLV >& par_fullNetworkName,
    const OPTIONAL< NetworkNameTLV >& par_shortNetworkName,
    const OPTIONAL< TimeZoneTV >& par_localtimeZone,
    const OPTIONAL< TimeZoneAndTimeTV >& par_univTime,
    const OPTIONAL< LSA__IdentifierTLV >& par_lSAIdentity,
    const OPTIONAL< DaylightSavingTimeTLV >& par_networkDST)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_fullNetworkName(par_fullNetworkName),
  field_shortNetworkName(par_shortNetworkName),
  field_localtimeZone(par_localtimeZone),
  field_univTime(par_univTime),
  field_lSAIdentity(par_lSAIdentity),
  field_networkDST(par_networkDST)
{
}

PDU__ML3__MMInformation::PDU__ML3__MMInformation(const PDU__ML3__MMInformation& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.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.localtimeZone().is_bound()) field_localtimeZone = other_value.localtimeZone();
else field_localtimeZone.clean_up();
if (other_value.univTime().is_bound()) field_univTime = other_value.univTime();
else field_univTime.clean_up();
if (other_value.lSAIdentity().is_bound()) field_lSAIdentity = other_value.lSAIdentity();
else field_lSAIdentity.clean_up();
if (other_value.networkDST().is_bound()) field_networkDST = other_value.networkDST();
else field_networkDST.clean_up();
}

void PDU__ML3__MMInformation::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_fullNetworkName.clean_up();
field_shortNetworkName.clean_up();
field_localtimeZone.clean_up();
field_univTime.clean_up();
field_lSAIdentity.clean_up();
field_networkDST.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__MMInformation::get_descriptor() const { return &PDU__ML3__MMInformation_descr_; }
PDU__ML3__MMInformation& PDU__ML3__MMInformation::operator=(const PDU__ML3__MMInformation& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.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.localtimeZone().is_bound()) field_localtimeZone = other_value.localtimeZone();
  else field_localtimeZone.clean_up();
  if (other_value.univTime().is_bound()) field_univTime = other_value.univTime();
  else field_univTime.clean_up();
  if (other_value.lSAIdentity().is_bound()) field_lSAIdentity = other_value.lSAIdentity();
  else field_lSAIdentity.clean_up();
  if (other_value.networkDST().is_bound()) field_networkDST = other_value.networkDST();
  else field_networkDST.clean_up();
}
return *this;
}

boolean PDU__ML3__MMInformation::operator==(const PDU__ML3__MMInformation& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_fullNetworkName==other_value.field_fullNetworkName
  && field_shortNetworkName==other_value.field_shortNetworkName
  && field_localtimeZone==other_value.field_localtimeZone
  && field_univTime==other_value.field_univTime
  && field_lSAIdentity==other_value.field_lSAIdentity
  && field_networkDST==other_value.field_networkDST;
}

boolean PDU__ML3__MMInformation::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.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_localtimeZone.get_selection() || field_localtimeZone.is_bound())
  || (OPTIONAL_OMIT == field_univTime.get_selection() || field_univTime.is_bound())
  || (OPTIONAL_OMIT == field_lSAIdentity.get_selection() || field_lSAIdentity.is_bound())
  || (OPTIONAL_OMIT == field_networkDST.get_selection() || field_networkDST.is_bound());
}
boolean PDU__ML3__MMInformation::is_value() const
{
return field_messageType.is_value()
  && field_nsd.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_localtimeZone.get_selection() || field_localtimeZone.is_value())
  && (OPTIONAL_OMIT == field_univTime.get_selection() || field_univTime.is_value())
  && (OPTIONAL_OMIT == field_lSAIdentity.get_selection() || field_lSAIdentity.is_value())
  && (OPTIONAL_OMIT == field_networkDST.get_selection() || field_networkDST.is_value());
}
int PDU__ML3__MMInformation::size_of() const
{
  int ret_val = 2;
  if (field_fullNetworkName.ispresent()) ret_val++;
  if (field_shortNetworkName.ispresent()) ret_val++;
  if (field_localtimeZone.ispresent()) ret_val++;
  if (field_univTime.ispresent()) ret_val++;
  if (field_lSAIdentity.ispresent()) ret_val++;
  if (field_networkDST.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__MMInformation::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", fullNetworkName := ");
field_fullNetworkName.log();
TTCN_Logger::log_event_str(", shortNetworkName := ");
field_shortNetworkName.log();
TTCN_Logger::log_event_str(", localtimeZone := ");
field_localtimeZone.log();
TTCN_Logger::log_event_str(", univTime := ");
field_univTime.log();
TTCN_Logger::log_event_str(", lSAIdentity := ");
field_lSAIdentity.log();
TTCN_Logger::log_event_str(", networkDST := ");
field_networkDST.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__MMInformation::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().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 (!localtimeZone().is_bound()) localtimeZone() = OMIT_VALUE;
else localtimeZone().set_implicit_omit();
if (!univTime().is_bound()) univTime() = OMIT_VALUE;
else univTime().set_implicit_omit();
if (!lSAIdentity().is_bound()) lSAIdentity() = OMIT_VALUE;
else lSAIdentity().set_implicit_omit();
if (!networkDST().is_bound()) networkDST() = OMIT_VALUE;
else networkDST().set_implicit_omit();
}

void PDU__ML3__MMInformation::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_MM_Types.PDU_ML3_MMInformation 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fullNetworkName().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) shortNetworkName().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) localtimeZone().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) univTime().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lSAIdentity().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) networkDST().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "localtimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          localtimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "univTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          univTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "networkDST")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkDST().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_MM_Types.PDU_ML3_MMInformation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_MMInformation");
  }
}

void PDU__ML3__MMInformation::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_fullNetworkName.encode_text(text_buf);
field_shortNetworkName.encode_text(text_buf);
field_localtimeZone.encode_text(text_buf);
field_univTime.encode_text(text_buf);
field_lSAIdentity.encode_text(text_buf);
field_networkDST.encode_text(text_buf);
}

void PDU__ML3__MMInformation::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_fullNetworkName.decode_text(text_buf);
field_shortNetworkName.decode_text(text_buf);
field_localtimeZone.decode_text(text_buf);
field_univTime.decode_text(text_buf);
field_lSAIdentity.decode_text(text_buf);
field_networkDST.decode_text(text_buf);
}

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

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

int PDU__ML3__MMInformation::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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_fullNetworkName = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, NetworkNameTLV_descr_.raw->forceomit);
  decoded_field_length = field_fullNetworkName().RAW_decode(NetworkNameTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_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_8){
  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)(3)) {
    field_shortNetworkName = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, NetworkNameTLV_descr_.raw->forceomit);
  decoded_field_length = field_shortNetworkName().RAW_decode(NetworkNameTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_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_9){
  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)(4)) {
    field_localtimeZone = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, TimeZoneTV_descr_.raw->forceomit);
  decoded_field_length = field_localtimeZone().RAW_decode(TimeZoneTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_localtimeZone = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_localtimeZone.ispresent() || field_localtimeZone().elementIdentifier() !=  bs_0){
  field_localtimeZone=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_localtimeZone=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_univTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, TimeZoneAndTimeTV_descr_.raw->forceomit);
  decoded_field_length = field_univTime().RAW_decode(TimeZoneAndTimeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_univTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_univTime.ispresent() || field_univTime().elementIdentifier() !=  bs_1){
  field_univTime=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_univTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_lSAIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, LSA__IdentifierTLV_descr_.raw->forceomit);
  decoded_field_length = field_lSAIdentity().RAW_decode(LSA__IdentifierTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_lSAIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lSAIdentity.ispresent() || field_lSAIdentity().elementIdentifier() !=  bs_2){
  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)(7)) {
    field_networkDST = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, DaylightSavingTimeTLV_descr_.raw->forceomit);
  decoded_field_length = field_networkDST().RAW_decode(DaylightSavingTimeTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_networkDST = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_networkDST.ispresent() || field_networkDST().elementIdentifier() !=  os_3){
  field_networkDST=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_networkDST=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__MMInformation::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  if (field_fullNetworkName.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NetworkNameTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_shortNetworkName.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, NetworkNameTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_localtimeZone.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TimeZoneTV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_univTime.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, TimeZoneAndTimeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_lSAIdentity.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, LSA__IdentifierTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_networkDST.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, DaylightSavingTimeTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  if (field_fullNetworkName.ispresent()) {
  encoded_length += field_fullNetworkName().RAW_encode(NetworkNameTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_shortNetworkName.ispresent()) {
  encoded_length += field_shortNetworkName().RAW_encode(NetworkNameTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_localtimeZone.ispresent()) {
  encoded_length += field_localtimeZone().RAW_encode(TimeZoneTV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_univTime.ispresent()) {
  encoded_length += field_univTime().RAW_encode(TimeZoneAndTimeTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_lSAIdentity.ispresent()) {
  encoded_length += field_lSAIdentity().RAW_encode(LSA__IdentifierTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_networkDST.ispresent()) {
  encoded_length += field_networkDST().RAW_encode(DaylightSavingTimeTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_fullNetworkName.ispresent() && (!field_fullNetworkName.ispresent() || field_fullNetworkName().elementIdentifier() !=  bs_8)) {
  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_8.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_9)) {
  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_9.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_localtimeZone.ispresent() && (!field_localtimeZone.ispresent() || field_localtimeZone().elementIdentifier() !=  bs_0)) {
  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){
   bs_0.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_univTime.ispresent() && (!field_univTime.ispresent() || field_univTime().elementIdentifier() !=  bs_1)) {
  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){
   bs_1.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_lSAIdentity.ispresent() && (!field_lSAIdentity.ispresent() || field_lSAIdentity().elementIdentifier() !=  bs_2)) {
  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_2.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_networkDST.ispresent() && (!field_networkDST.ispresent() || field_networkDST().elementIdentifier() !=  os_3)) {
  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_3.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 PDU__ML3__MMInformation_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
NetworkNameTLV_template field_fullNetworkName;
NetworkNameTLV_template field_shortNetworkName;
TimeZoneTV_template field_localtimeZone;
TimeZoneAndTimeTV_template field_univTime;
LSA__IdentifierTLV_template field_lSAIdentity;
DaylightSavingTimeTLV_template field_networkDST;
};

void PDU__ML3__MMInformation_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_nsd = ANY_VALUE;
single_value->field_fullNetworkName = ANY_OR_OMIT;
single_value->field_shortNetworkName = ANY_OR_OMIT;
single_value->field_localtimeZone = ANY_OR_OMIT;
single_value->field_univTime = ANY_OR_OMIT;
single_value->field_lSAIdentity = ANY_OR_OMIT;
single_value->field_networkDST = ANY_OR_OMIT;
}
}
}

void PDU__ML3__MMInformation_template::copy_value(const PDU__ML3__MMInformation& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.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.localtimeZone().is_bound()) {
  if (other_value.localtimeZone().ispresent()) single_value->field_localtimeZone = other_value.localtimeZone()();
  else single_value->field_localtimeZone = OMIT_VALUE;
} else {
  single_value->field_localtimeZone.clean_up();
}
if (other_value.univTime().is_bound()) {
  if (other_value.univTime().ispresent()) single_value->field_univTime = other_value.univTime()();
  else single_value->field_univTime = OMIT_VALUE;
} else {
  single_value->field_univTime.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.networkDST().is_bound()) {
  if (other_value.networkDST().ispresent()) single_value->field_networkDST = other_value.networkDST()();
  else single_value->field_networkDST = OMIT_VALUE;
} else {
  single_value->field_networkDST.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__MMInformation_template::copy_template(const PDU__ML3__MMInformation_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.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.localtimeZone().get_selection()) {
single_value->field_localtimeZone = other_value.localtimeZone();
} else {
single_value->field_localtimeZone.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.univTime().get_selection()) {
single_value->field_univTime = other_value.univTime();
} else {
single_value->field_univTime.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.networkDST().get_selection()) {
single_value->field_networkDST = other_value.networkDST();
} else {
single_value->field_networkDST.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__ML3__MMInformation_template[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__ML3__MMInformation_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation.");
break;
}
set_selection(other_value);
}

PDU__ML3__MMInformation_template::PDU__ML3__MMInformation_template()
{
}

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

PDU__ML3__MMInformation_template::PDU__ML3__MMInformation_template(const PDU__ML3__MMInformation& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__MMInformation_template::match(const PDU__ML3__MMInformation& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.fullNetworkName().is_bound()) return FALSE;
if((other_value.fullNetworkName().ispresent() ? !single_value->field_fullNetworkName.match((const 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 NetworkNameTLV&)other_value.shortNetworkName(), legacy) : !single_value->field_shortNetworkName.match_omit(legacy)))return FALSE;
if(!other_value.localtimeZone().is_bound()) return FALSE;
if((other_value.localtimeZone().ispresent() ? !single_value->field_localtimeZone.match((const TimeZoneTV&)other_value.localtimeZone(), legacy) : !single_value->field_localtimeZone.match_omit(legacy)))return FALSE;
if(!other_value.univTime().is_bound()) return FALSE;
if((other_value.univTime().ispresent() ? !single_value->field_univTime.match((const TimeZoneAndTimeTV&)other_value.univTime(), legacy) : !single_value->field_univTime.match_omit(legacy)))return FALSE;
if(!other_value.lSAIdentity().is_bound()) return FALSE;
if((other_value.lSAIdentity().ispresent() ? !single_value->field_lSAIdentity.match((const LSA__IdentifierTLV&)other_value.lSAIdentity(), legacy) : !single_value->field_lSAIdentity.match_omit(legacy)))return FALSE;
if(!other_value.networkDST().is_bound()) return FALSE;
if((other_value.networkDST().ispresent() ? !single_value->field_networkDST.match((const DaylightSavingTimeTLV&)other_value.networkDST(), legacy) : !single_value->field_networkDST.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_MM_Types.PDU_ML3_MMInformation.");
}
return FALSE;
}

boolean PDU__ML3__MMInformation_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_nsd.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_localtimeZone.is_omit() || single_value->field_localtimeZone.is_bound())
 || (single_value->field_univTime.is_omit() || single_value->field_univTime.is_bound())
 || (single_value->field_lSAIdentity.is_omit() || single_value->field_lSAIdentity.is_bound())
 || (single_value->field_networkDST.is_omit() || single_value->field_networkDST.is_bound());
}

boolean PDU__ML3__MMInformation_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.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_localtimeZone.is_omit() || single_value->field_localtimeZone.is_value())
 && (single_value->field_univTime.is_omit() || single_value->field_univTime.is_value())
 && (single_value->field_lSAIdentity.is_omit() || single_value->field_lSAIdentity.is_value())
 && (single_value->field_networkDST.is_omit() || single_value->field_networkDST.is_value());
}

void PDU__ML3__MMInformation_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__ML3__MMInformation PDU__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation.");
PDU__ML3__MMInformation ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.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_localtimeZone.is_omit()) ret_val.localtimeZone() = OMIT_VALUE;
else if (single_value->field_localtimeZone.is_bound()) {
ret_val.localtimeZone() = single_value->field_localtimeZone.valueof();
}
if (single_value->field_univTime.is_omit()) ret_val.univTime() = OMIT_VALUE;
else if (single_value->field_univTime.is_bound()) {
ret_val.univTime() = single_value->field_univTime.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_networkDST.is_omit()) ret_val.networkDST() = OMIT_VALUE;
else if (single_value->field_networkDST.is_bound()) {
ret_val.networkDST() = single_value->field_networkDST.valueof();
}
return ret_val;
}

void PDU__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__MMInformation_template[list_length];
}

PDU__ML3__MMInformation_template& PDU__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__MMInformation_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__MMInformation_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_nsd;
}

NetworkNameTLV_template& PDU__ML3__MMInformation_template::fullNetworkName()
{
set_specific();
return single_value->field_fullNetworkName;
}

const NetworkNameTLV_template& PDU__ML3__MMInformation_template::fullNetworkName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fullNetworkName of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_fullNetworkName;
}

NetworkNameTLV_template& PDU__ML3__MMInformation_template::shortNetworkName()
{
set_specific();
return single_value->field_shortNetworkName;
}

const NetworkNameTLV_template& PDU__ML3__MMInformation_template::shortNetworkName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field shortNetworkName of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_shortNetworkName;
}

TimeZoneTV_template& PDU__ML3__MMInformation_template::localtimeZone()
{
set_specific();
return single_value->field_localtimeZone;
}

const TimeZoneTV_template& PDU__ML3__MMInformation_template::localtimeZone() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field localtimeZone of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_localtimeZone;
}

TimeZoneAndTimeTV_template& PDU__ML3__MMInformation_template::univTime()
{
set_specific();
return single_value->field_univTime;
}

const TimeZoneAndTimeTV_template& PDU__ML3__MMInformation_template::univTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field univTime of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_univTime;
}

LSA__IdentifierTLV_template& PDU__ML3__MMInformation_template::lSAIdentity()
{
set_specific();
return single_value->field_lSAIdentity;
}

const LSA__IdentifierTLV_template& PDU__ML3__MMInformation_template::lSAIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lSAIdentity of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_lSAIdentity;
}

DaylightSavingTimeTLV_template& PDU__ML3__MMInformation_template::networkDST()
{
set_specific();
return single_value->field_networkDST;
}

const DaylightSavingTimeTLV_template& PDU__ML3__MMInformation_template::networkDST() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkDST of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
return single_value->field_networkDST;
}

int PDU__ML3__MMInformation_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_fullNetworkName.is_present()) ret_val++;
      if (single_value->field_shortNetworkName.is_present()) ret_val++;
      if (single_value->field_localtimeZone.is_present()) ret_val++;
      if (single_value->field_univTime.is_present()) ret_val++;
      if (single_value->field_lSAIdentity.is_present()) ret_val++;
      if (single_value->field_networkDST.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_MM_Types.PDU_ML3_MMInformation 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_MM_Types.PDU_ML3_MMInformation containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_MM_Types.PDU_ML3_MMInformation containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_MM_Types.PDU_ML3_MMInformation.");
  }
  return 0;
}

void PDU__ML3__MMInformation_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(", nsd := ");
single_value->field_nsd.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(", localtimeZone := ");
single_value->field_localtimeZone.log();
TTCN_Logger::log_event_str(", univTime := ");
single_value->field_univTime.log();
TTCN_Logger::log_event_str(", lSAIdentity := ");
single_value->field_lSAIdentity.log();
TTCN_Logger::log_event_str(", networkDST := ");
single_value->field_networkDST.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__ML3__MMInformation_template::log_match(const PDU__ML3__MMInformation& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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.localtimeZone().ispresent()){
if(!single_value->field_localtimeZone.match(match_value.localtimeZone(), legacy)){
TTCN_Logger::log_logmatch_info(".localtimeZone");
single_value->field_localtimeZone.log_match(match_value.localtimeZone(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_localtimeZone.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".localtimeZone := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_localtimeZone.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.univTime().ispresent()){
if(!single_value->field_univTime.match(match_value.univTime(), legacy)){
TTCN_Logger::log_logmatch_info(".univTime");
single_value->field_univTime.log_match(match_value.univTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_univTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".univTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_univTime.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.networkDST().ispresent()){
if(!single_value->field_networkDST.match(match_value.networkDST(), legacy)){
TTCN_Logger::log_logmatch_info(".networkDST");
single_value->field_networkDST.log_match(match_value.networkDST(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkDST.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkDST := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkDST.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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), 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(", localtimeZone := ");
if (match_value.localtimeZone().ispresent()) {
single_value->field_localtimeZone.log_match(match_value.localtimeZone(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_localtimeZone.log();
if (single_value->field_localtimeZone.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", univTime := ");
if (match_value.univTime().ispresent()) {
single_value->field_univTime.log_match(match_value.univTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_univTime.log();
if (single_value->field_univTime.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(", networkDST := ");
if (match_value.networkDST().ispresent()) {
single_value->field_networkDST.log_match(match_value.networkDST(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkDST.log();
if (single_value->field_networkDST.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__ML3__MMInformation_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().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 (!localtimeZone().is_bound()) localtimeZone() = OMIT_VALUE;
else localtimeZone().set_implicit_omit();
if (!univTime().is_bound()) univTime() = OMIT_VALUE;
else univTime().set_implicit_omit();
if (!lSAIdentity().is_bound()) lSAIdentity() = OMIT_VALUE;
else lSAIdentity().set_implicit_omit();
if (!networkDST().is_bound()) networkDST() = OMIT_VALUE;
else networkDST().set_implicit_omit();
}

void PDU__ML3__MMInformation_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_nsd.encode_text(text_buf);
single_value->field_fullNetworkName.encode_text(text_buf);
single_value->field_shortNetworkName.encode_text(text_buf);
single_value->field_localtimeZone.encode_text(text_buf);
single_value->field_univTime.encode_text(text_buf);
single_value->field_lSAIdentity.encode_text(text_buf);
single_value->field_networkDST.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_MM_Types.PDU_ML3_MMInformation.");
}
}

void PDU__ML3__MMInformation_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_nsd.decode_text(text_buf);
single_value->field_fullNetworkName.decode_text(text_buf);
single_value->field_shortNetworkName.decode_text(text_buf);
single_value->field_localtimeZone.decode_text(text_buf);
single_value->field_univTime.decode_text(text_buf);
single_value->field_lSAIdentity.decode_text(text_buf);
single_value->field_networkDST.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__ML3__MMInformation_template[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_MM_Types.PDU_ML3_MMInformation.");
}
}

void PDU__ML3__MMInformation_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__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fullNetworkName().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) shortNetworkName().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) localtimeZone().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) univTime().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) lSAIdentity().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) networkDST().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "localtimeZone")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          localtimeZone().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "univTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          univTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "networkDST")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkDST().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_MM_Types.PDU_ML3_MMInformation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__MMInformation_template* precondition = new PDU__ML3__MMInformation_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__MMInformation_template* implied_template = new PDU__ML3__MMInformation_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__MMInformation_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_MMInformation");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__MMInformation_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_MM_Types.PDU_ML3_MMInformation");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_fullNetworkName.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_shortNetworkName.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_localtimeZone.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_univTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_lSAIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
single_value->field_networkDST.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMInformation");
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_MM_Types.PDU_ML3_MMInformation");
}

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

boolean PDU__ML3__MMInformation_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__ML3__MMStatus::PDU__ML3__MMStatus()
{
}

PDU__ML3__MMStatus::PDU__ML3__MMStatus(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OCTETSTRING& par_rejectCause)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_rejectCause(par_rejectCause)
{
}

PDU__ML3__MMStatus::PDU__ML3__MMStatus(const PDU__ML3__MMStatus& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMStatus.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
else field_rejectCause.clean_up();
}

void PDU__ML3__MMStatus::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_rejectCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__MMStatus::get_descriptor() const { return &PDU__ML3__MMStatus_descr_; }
PDU__ML3__MMStatus& PDU__ML3__MMStatus::operator=(const PDU__ML3__MMStatus& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMStatus.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.rejectCause().is_bound()) field_rejectCause = other_value.rejectCause();
  else field_rejectCause.clean_up();
}
return *this;
}

boolean PDU__ML3__MMStatus::operator==(const PDU__ML3__MMStatus& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_rejectCause==other_value.field_rejectCause;
}

boolean PDU__ML3__MMStatus::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_rejectCause.is_bound());
}
boolean PDU__ML3__MMStatus::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_rejectCause.is_value();
}
void PDU__ML3__MMStatus::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
field_rejectCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__MMStatus::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
}

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

void PDU__ML3__MMStatus::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_rejectCause.encode_text(text_buf);
}

void PDU__ML3__MMStatus::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_rejectCause.decode_text(text_buf);
}

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

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

int PDU__ML3__MMStatus::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rejectCause.RAW_decode(General__Types::OCT1_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 PDU__ML3__MMStatus::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rejectCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__MMStatus_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
OCTETSTRING_template field_rejectCause;
};

void PDU__ML3__MMStatus_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_nsd = ANY_VALUE;
single_value->field_rejectCause = ANY_VALUE;
}
}
}

void PDU__ML3__MMStatus_template::copy_value(const PDU__ML3__MMStatus& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.rejectCause().is_bound()) {
  single_value->field_rejectCause = other_value.rejectCause();
} else {
  single_value->field_rejectCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__MMStatus_template::copy_template(const PDU__ML3__MMStatus_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rejectCause().get_selection()) {
single_value->field_rejectCause = other_value.rejectCause();
} else {
single_value->field_rejectCause.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__ML3__MMStatus_template[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__ML3__MMStatus_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__MMStatus_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_MM_Types.PDU_ML3_MMStatus.");
break;
}
set_selection(other_value);
}

PDU__ML3__MMStatus_template::PDU__ML3__MMStatus_template()
{
}

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

PDU__ML3__MMStatus_template::PDU__ML3__MMStatus_template(const PDU__ML3__MMStatus& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__MMStatus_template::match(const PDU__ML3__MMStatus& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.rejectCause().is_bound()) return FALSE;
if(!single_value->field_rejectCause.match(other_value.rejectCause(), 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_MM_Types.PDU_ML3_MMStatus.");
}
return FALSE;
}

boolean PDU__ML3__MMStatus_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_nsd.is_bound()
 || single_value->field_rejectCause.is_bound();
}

boolean PDU__ML3__MMStatus_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_rejectCause.is_value();
}

void PDU__ML3__MMStatus_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__ML3__MMStatus PDU__ML3__MMStatus_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_MM_Types.PDU_ML3_MMStatus.");
PDU__ML3__MMStatus ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_rejectCause.is_bound()) {
ret_val.rejectCause() = single_value->field_rejectCause.valueof();
}
return ret_val;
}

void PDU__ML3__MMStatus_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_MM_Types.PDU_ML3_MMStatus.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__MMStatus_template[list_length];
}

PDU__ML3__MMStatus_template& PDU__ML3__MMStatus_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_MM_Types.PDU_ML3_MMStatus.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_MMStatus.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__MMStatus_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__MMStatus_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMStatus.");
return single_value->field_nsd;
}

OCTETSTRING_template& PDU__ML3__MMStatus_template::rejectCause()
{
set_specific();
return single_value->field_rejectCause;
}

const OCTETSTRING_template& PDU__ML3__MMStatus_template::rejectCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rejectCause of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMStatus.");
return single_value->field_rejectCause;
}

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

void PDU__ML3__MMStatus_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.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__ML3__MMStatus_template::log_match(const PDU__ML3__MMStatus& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rejectCause.match(match_value.rejectCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rejectCause");
single_value->field_rejectCause.log_match(match_value.rejectCause(), 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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", rejectCause := ");
single_value->field_rejectCause.log_match(match_value.rejectCause(), 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__ML3__MMStatus_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (rejectCause().is_bound()) rejectCause().set_implicit_omit();
}

void PDU__ML3__MMStatus_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_nsd.encode_text(text_buf);
single_value->field_rejectCause.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_MM_Types.PDU_ML3_MMStatus.");
}
}

void PDU__ML3__MMStatus_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_nsd.decode_text(text_buf);
single_value->field_rejectCause.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__ML3__MMStatus_template[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_MM_Types.PDU_ML3_MMStatus.");
}
}

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

void PDU__ML3__MMStatus_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_MM_Types.PDU_ML3_MMStatus");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMStatus");
single_value->field_rejectCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMStatus");
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_MM_Types.PDU_ML3_MMStatus");
}

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

boolean PDU__ML3__MMStatus_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__ML3__TMSI__ReallocationCommand::PDU__ML3__TMSI__ReallocationCommand()
{
}

PDU__ML3__TMSI__ReallocationCommand::PDU__ML3__TMSI__ReallocationCommand(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::LocationAreaIdentification__V& par_locationAreaIdentification,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_locationAreaIdentification(par_locationAreaIdentification),
  field_mobileIdentity(par_mobileIdentity)
{
}

PDU__ML3__TMSI__ReallocationCommand::PDU__ML3__TMSI__ReallocationCommand(const PDU__ML3__TMSI__ReallocationCommand& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
else field_locationAreaIdentification.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
}

void PDU__ML3__TMSI__ReallocationCommand::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_locationAreaIdentification.clean_up();
field_mobileIdentity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__TMSI__ReallocationCommand::get_descriptor() const { return &PDU__ML3__TMSI__ReallocationCommand_descr_; }
PDU__ML3__TMSI__ReallocationCommand& PDU__ML3__TMSI__ReallocationCommand::operator=(const PDU__ML3__TMSI__ReallocationCommand& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
  if (other_value.locationAreaIdentification().is_bound()) field_locationAreaIdentification = other_value.locationAreaIdentification();
  else field_locationAreaIdentification.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
}
return *this;
}

boolean PDU__ML3__TMSI__ReallocationCommand::operator==(const PDU__ML3__TMSI__ReallocationCommand& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_locationAreaIdentification==other_value.field_locationAreaIdentification
  && field_mobileIdentity==other_value.field_mobileIdentity;
}

boolean PDU__ML3__TMSI__ReallocationCommand::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_locationAreaIdentification.is_bound())
  || (field_mobileIdentity.is_bound());
}
boolean PDU__ML3__TMSI__ReallocationCommand::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_locationAreaIdentification.is_value()
  && field_mobileIdentity.is_value();
}
void PDU__ML3__TMSI__ReallocationCommand::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
field_locationAreaIdentification.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__TMSI__ReallocationCommand::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
}

void PDU__ML3__TMSI__ReallocationCommand::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_MM_Types.PDU_ML3_TMSI_ReallocationCommand 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
  }
}

void PDU__ML3__TMSI__ReallocationCommand::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_locationAreaIdentification.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
}

void PDU__ML3__TMSI__ReallocationCommand::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_locationAreaIdentification.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
}

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

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

int PDU__ML3__TMSI__ReallocationCommand::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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::LocationAreaIdentification__V_descr_.raw->forceomit);
  decoded_field_length = field_locationAreaIdentification.RAW_decode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_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_mobileIdentity.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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__TMSI__ReallocationCommand::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_locationAreaIdentification.RAW_encode(MobileL3__CommonIE__Types::LocationAreaIdentification__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__TMSI__ReallocationCommand_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::LocationAreaIdentification__V_template field_locationAreaIdentification;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
};

void PDU__ML3__TMSI__ReallocationCommand_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_nsd = ANY_VALUE;
single_value->field_locationAreaIdentification = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
}
}
}

void PDU__ML3__TMSI__ReallocationCommand_template::copy_value(const PDU__ML3__TMSI__ReallocationCommand& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.locationAreaIdentification().is_bound()) {
  single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
  single_value->field_locationAreaIdentification.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__ML3__TMSI__ReallocationCommand_template::copy_template(const PDU__ML3__TMSI__ReallocationCommand_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.locationAreaIdentification().get_selection()) {
single_value->field_locationAreaIdentification = other_value.locationAreaIdentification();
} else {
single_value->field_locationAreaIdentification.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__ML3__TMSI__ReallocationCommand_template[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__ML3__TMSI__ReallocationCommand_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
break;
}
set_selection(other_value);
}

PDU__ML3__TMSI__ReallocationCommand_template::PDU__ML3__TMSI__ReallocationCommand_template()
{
}

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

PDU__ML3__TMSI__ReallocationCommand_template::PDU__ML3__TMSI__ReallocationCommand_template(const PDU__ML3__TMSI__ReallocationCommand& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__TMSI__ReallocationCommand_template::match(const PDU__ML3__TMSI__ReallocationCommand& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.locationAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_locationAreaIdentification.match(other_value.locationAreaIdentification(), 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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
}
return FALSE;
}

boolean PDU__ML3__TMSI__ReallocationCommand_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_nsd.is_bound()
 || single_value->field_locationAreaIdentification.is_bound()
 || single_value->field_mobileIdentity.is_bound();
}

boolean PDU__ML3__TMSI__ReallocationCommand_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_nsd.is_value()
 && single_value->field_locationAreaIdentification.is_value()
 && single_value->field_mobileIdentity.is_value();
}

void PDU__ML3__TMSI__ReallocationCommand_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__ML3__TMSI__ReallocationCommand PDU__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
PDU__ML3__TMSI__ReallocationCommand ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
if (single_value->field_locationAreaIdentification.is_bound()) {
ret_val.locationAreaIdentification() = single_value->field_locationAreaIdentification.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
return ret_val;
}

void PDU__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__TMSI__ReallocationCommand_template[list_length];
}

PDU__ML3__TMSI__ReallocationCommand_template& PDU__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__TMSI__ReallocationCommand_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__TMSI__ReallocationCommand_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
return single_value->field_nsd;
}

MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__TMSI__ReallocationCommand_template::locationAreaIdentification()
{
set_specific();
return single_value->field_locationAreaIdentification;
}

const MobileL3__CommonIE__Types::LocationAreaIdentification__V_template& PDU__ML3__TMSI__ReallocationCommand_template::locationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field locationAreaIdentification of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
return single_value->field_locationAreaIdentification;
}

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

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

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

void PDU__ML3__TMSI__ReallocationCommand_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(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.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__ML3__TMSI__ReallocationCommand_template::log_match(const PDU__ML3__TMSI__ReallocationCommand& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_locationAreaIdentification.match(match_value.locationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".locationAreaIdentification");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), 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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), legacy);
TTCN_Logger::log_event_str(", locationAreaIdentification := ");
single_value->field_locationAreaIdentification.log_match(match_value.locationAreaIdentification(), 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__ML3__TMSI__ReallocationCommand_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (locationAreaIdentification().is_bound()) locationAreaIdentification().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
}

void PDU__ML3__TMSI__ReallocationCommand_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_nsd.encode_text(text_buf);
single_value->field_locationAreaIdentification.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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
}
}

void PDU__ML3__TMSI__ReallocationCommand_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_nsd.decode_text(text_buf);
single_value->field_locationAreaIdentification.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__ML3__TMSI__ReallocationCommand_template[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_MM_Types.PDU_ML3_TMSI_ReallocationCommand.");
}
}

void PDU__ML3__TMSI__ReallocationCommand_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__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand 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) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) locationAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().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(), "nsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "locationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          locationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__TMSI__ReallocationCommand_template* precondition = new PDU__ML3__TMSI__ReallocationCommand_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__TMSI__ReallocationCommand_template* implied_template = new PDU__ML3__TMSI__ReallocationCommand_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__TMSI__ReallocationCommand_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__TMSI__ReallocationCommand_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_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
single_value->field_locationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
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_MM_Types.PDU_ML3_TMSI_ReallocationCommand");
}

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

boolean PDU__ML3__TMSI__ReallocationCommand_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__ML3__TMSI__ReallocationComplete::PDU__ML3__TMSI__ReallocationComplete()
{
}

PDU__ML3__TMSI__ReallocationComplete::PDU__ML3__TMSI__ReallocationComplete(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd)
{
}

PDU__ML3__TMSI__ReallocationComplete::PDU__ML3__TMSI__ReallocationComplete(const PDU__ML3__TMSI__ReallocationComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
}

void PDU__ML3__TMSI__ReallocationComplete::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__TMSI__ReallocationComplete::get_descriptor() const { return &PDU__ML3__TMSI__ReallocationComplete_descr_; }
PDU__ML3__TMSI__ReallocationComplete& PDU__ML3__TMSI__ReallocationComplete::operator=(const PDU__ML3__TMSI__ReallocationComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
}
return *this;
}

boolean PDU__ML3__TMSI__ReallocationComplete::operator==(const PDU__ML3__TMSI__ReallocationComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__TMSI__ReallocationComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__TMSI__ReallocationComplete::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__TMSI__ReallocationComplete::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__TMSI__ReallocationComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

void PDU__ML3__TMSI__ReallocationComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
}

void PDU__ML3__TMSI__ReallocationComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
}

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

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

int PDU__ML3__TMSI__ReallocationComplete::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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 PDU__ML3__TMSI__ReallocationComplete::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__TMSI__ReallocationComplete_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__TMSI__ReallocationComplete_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_nsd = ANY_VALUE;
}
}
}

void PDU__ML3__TMSI__ReallocationComplete_template::copy_value(const PDU__ML3__TMSI__ReallocationComplete& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__TMSI__ReallocationComplete_template::copy_template(const PDU__ML3__TMSI__ReallocationComplete_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.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__ML3__TMSI__ReallocationComplete_template[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__ML3__TMSI__ReallocationComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__TMSI__ReallocationComplete_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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
break;
}
set_selection(other_value);
}

PDU__ML3__TMSI__ReallocationComplete_template::PDU__ML3__TMSI__ReallocationComplete_template()
{
}

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

PDU__ML3__TMSI__ReallocationComplete_template::PDU__ML3__TMSI__ReallocationComplete_template(const PDU__ML3__TMSI__ReallocationComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__TMSI__ReallocationComplete_template::match(const PDU__ML3__TMSI__ReallocationComplete& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), 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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
}
return FALSE;
}

boolean PDU__ML3__TMSI__ReallocationComplete_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_nsd.is_bound();
}

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

void PDU__ML3__TMSI__ReallocationComplete_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__ML3__TMSI__ReallocationComplete PDU__ML3__TMSI__ReallocationComplete_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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
PDU__ML3__TMSI__ReallocationComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
return ret_val;
}

void PDU__ML3__TMSI__ReallocationComplete_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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__TMSI__ReallocationComplete_template[list_length];
}

PDU__ML3__TMSI__ReallocationComplete_template& PDU__ML3__TMSI__ReallocationComplete_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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__TMSI__ReallocationComplete_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__TMSI__ReallocationComplete_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
return single_value->field_nsd;
}

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

void PDU__ML3__TMSI__ReallocationComplete_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(", nsd := ");
single_value->field_nsd.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__ML3__TMSI__ReallocationComplete_template::log_match(const PDU__ML3__TMSI__ReallocationComplete& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), 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__ML3__TMSI__ReallocationComplete_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

void PDU__ML3__TMSI__ReallocationComplete_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_nsd.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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
}
}

void PDU__ML3__TMSI__ReallocationComplete_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_nsd.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__ML3__TMSI__ReallocationComplete_template[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_MM_Types.PDU_ML3_TMSI_ReallocationComplete.");
}
}

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

void PDU__ML3__TMSI__ReallocationComplete_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_MM_Types.PDU_ML3_TMSI_ReallocationComplete");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete");
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_MM_Types.PDU_ML3_TMSI_ReallocationComplete");
}

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

boolean PDU__ML3__TMSI__ReallocationComplete_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__ML3__MMNull::PDU__ML3__MMNull()
{
}

PDU__ML3__MMNull::PDU__ML3__MMNull(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd)
{
}

PDU__ML3__MMNull::PDU__ML3__MMNull(const PDU__ML3__MMNull& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMNull.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
else field_nsd.clean_up();
}

void PDU__ML3__MMNull::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__MMNull::get_descriptor() const { return &PDU__ML3__MMNull_descr_; }
PDU__ML3__MMNull& PDU__ML3__MMNull::operator=(const PDU__ML3__MMNull& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_MM_Types.PDU_ML3_MMNull.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.nsd().is_bound()) field_nsd = other_value.nsd();
  else field_nsd.clean_up();
}
return *this;
}

boolean PDU__ML3__MMNull::operator==(const PDU__ML3__MMNull& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__MMNull::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__MMNull::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__MMNull::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(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__MMNull::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

void PDU__ML3__MMNull::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
}

void PDU__ML3__MMNull::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
}

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

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

int PDU__ML3__MMNull::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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT6_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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_nsd.RAW_decode(General__Types::BIT2_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 PDU__ML3__MMNull::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::BIT6_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nsd.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__MMNull_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__MMNull_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_nsd = ANY_VALUE;
}
}
}

void PDU__ML3__MMNull_template::copy_value(const PDU__ML3__MMNull& 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.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__MMNull_template::copy_template(const PDU__ML3__MMNull_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.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.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__ML3__MMNull_template[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__ML3__MMNull_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__MMNull_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_MM_Types.PDU_ML3_MMNull.");
break;
}
set_selection(other_value);
}

PDU__ML3__MMNull_template::PDU__ML3__MMNull_template()
{
}

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

PDU__ML3__MMNull_template::PDU__ML3__MMNull_template(const PDU__ML3__MMNull& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__MMNull_template::match(const PDU__ML3__MMNull& 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.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), 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_MM_Types.PDU_ML3_MMNull.");
}
return FALSE;
}

boolean PDU__ML3__MMNull_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_nsd.is_bound();
}

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

void PDU__ML3__MMNull_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__ML3__MMNull PDU__ML3__MMNull_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_MM_Types.PDU_ML3_MMNull.");
PDU__ML3__MMNull ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_nsd.is_bound()) {
ret_val.nsd() = single_value->field_nsd.valueof();
}
return ret_val;
}

void PDU__ML3__MMNull_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_MM_Types.PDU_ML3_MMNull.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__MMNull_template[list_length];
}

PDU__ML3__MMNull_template& PDU__ML3__MMNull_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_MM_Types.PDU_ML3_MMNull.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_MM_Types.PDU_ML3_MMNull.");
return value_list.list_value[list_index];
}

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

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

BITSTRING_template& PDU__ML3__MMNull_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__MMNull_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_MM_Types.PDU_ML3_MMNull.");
return single_value->field_nsd;
}

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

void PDU__ML3__MMNull_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(", nsd := ");
single_value->field_nsd.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__ML3__MMNull_template::log_match(const PDU__ML3__MMNull& 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_nsd.match(match_value.nsd(), legacy)){
TTCN_Logger::log_logmatch_info(".nsd");
single_value->field_nsd.log_match(match_value.nsd(), 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(", nsd := ");
single_value->field_nsd.log_match(match_value.nsd(), 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__ML3__MMNull_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

void PDU__ML3__MMNull_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_nsd.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_MM_Types.PDU_ML3_MMNull.");
}
}

void PDU__ML3__MMNull_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_nsd.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__ML3__MMNull_template[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_MM_Types.PDU_ML3_MMNull.");
}
}

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

void PDU__ML3__MMNull_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_MM_Types.PDU_ML3_MMNull");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MMNull");
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_MM_Types.PDU_ML3_MMNull");
}

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

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

void PDU__ML3__MM::copy_value(const PDU__ML3__MM& other_value)
{
switch (other_value.union_selection) {
case ALT_imsiDetachIndication:
field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication(*other_value.field_imsiDetachIndication);
break;
case ALT_locationUpdateAccept:
field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept(*other_value.field_locationUpdateAccept);
break;
case ALT_locationUpdateReject:
field_locationUpdateReject = new PDU__ML3__LocationUpdateReject(*other_value.field_locationUpdateReject);
break;
case ALT_locationUpdateRequest:
field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest(*other_value.field_locationUpdateRequest);
break;
case ALT_authenticationReject:
field_authenticationReject = new PDU__ML3__AuthenticationReject(*other_value.field_authenticationReject);
break;
case ALT_authenticationRequest:
field_authenticationRequest = new PDU__ML3__AuthenticationRequest(*other_value.field_authenticationRequest);
break;
case ALT_authenticationResponse:
field_authenticationResponse = new PDU__ML3__AuthenticationResponse(*other_value.field_authenticationResponse);
break;
case ALT_authenticationFailure:
field_authenticationFailure = new PDU__ML3__AuthenticationFailure(*other_value.field_authenticationFailure);
break;
case ALT_identityRequest:
field_identityRequest = new PDU__ML3__IdentityRequest(*other_value.field_identityRequest);
break;
case ALT_identityResponse:
field_identityResponse = new PDU__ML3__IdentityResponse(*other_value.field_identityResponse);
break;
case ALT_tmsiReallocCommand:
field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand(*other_value.field_tmsiReallocCommand);
break;
case ALT_tmsiReallocComplete:
field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete(*other_value.field_tmsiReallocComplete);
break;
case ALT_cMServiceAbort:
field_cMServiceAbort = new PDU__ML3__CMServiceAbort(*other_value.field_cMServiceAbort);
break;
case ALT_cMServiceAccept:
field_cMServiceAccept = new PDU__ML3__CMServiceAccept(*other_value.field_cMServiceAccept);
break;
case ALT_cMServiceReject:
field_cMServiceReject = new PDU__ML3__CMServiceReject(*other_value.field_cMServiceReject);
break;
case ALT_cMServiceRequest:
field_cMServiceRequest = new PDU__ML3__CMServiceRequest(*other_value.field_cMServiceRequest);
break;
case ALT_cMServicePrompt:
field_cMServicePrompt = new PDU__ML3__CMServicePrompt(*other_value.field_cMServicePrompt);
break;
case ALT_cMReEstablReq:
field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest(*other_value.field_cMReEstablReq);
break;
case ALT_abort:
field_abort = new PDU__ML3__Abort(*other_value.field_abort);
break;
case ALT_mMNull:
field_mMNull = new PDU__ML3__MMNull(*other_value.field_mMNull);
break;
case ALT_mMStatus:
field_mMStatus = new PDU__ML3__MMStatus(*other_value.field_mMStatus);
break;
case ALT_mMInformation:
field_mMInformation = new PDU__ML3__MMInformation(*other_value.field_mMInformation);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
union_selection = other_value.union_selection;
}

PDU__ML3__MM::PDU__ML3__MM()
{
union_selection = UNBOUND_VALUE;
}

PDU__ML3__MM::PDU__ML3__MM(const PDU__ML3__MM& other_value)
: Base_Type(){
copy_value(other_value);
}

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

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

boolean PDU__ML3__MM::operator==(const PDU__ML3__MM& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_imsiDetachIndication:
return *field_imsiDetachIndication == *other_value.field_imsiDetachIndication;
case ALT_locationUpdateAccept:
return *field_locationUpdateAccept == *other_value.field_locationUpdateAccept;
case ALT_locationUpdateReject:
return *field_locationUpdateReject == *other_value.field_locationUpdateReject;
case ALT_locationUpdateRequest:
return *field_locationUpdateRequest == *other_value.field_locationUpdateRequest;
case ALT_authenticationReject:
return *field_authenticationReject == *other_value.field_authenticationReject;
case ALT_authenticationRequest:
return *field_authenticationRequest == *other_value.field_authenticationRequest;
case ALT_authenticationResponse:
return *field_authenticationResponse == *other_value.field_authenticationResponse;
case ALT_authenticationFailure:
return *field_authenticationFailure == *other_value.field_authenticationFailure;
case ALT_identityRequest:
return *field_identityRequest == *other_value.field_identityRequest;
case ALT_identityResponse:
return *field_identityResponse == *other_value.field_identityResponse;
case ALT_tmsiReallocCommand:
return *field_tmsiReallocCommand == *other_value.field_tmsiReallocCommand;
case ALT_tmsiReallocComplete:
return *field_tmsiReallocComplete == *other_value.field_tmsiReallocComplete;
case ALT_cMServiceAbort:
return *field_cMServiceAbort == *other_value.field_cMServiceAbort;
case ALT_cMServiceAccept:
return *field_cMServiceAccept == *other_value.field_cMServiceAccept;
case ALT_cMServiceReject:
return *field_cMServiceReject == *other_value.field_cMServiceReject;
case ALT_cMServiceRequest:
return *field_cMServiceRequest == *other_value.field_cMServiceRequest;
case ALT_cMServicePrompt:
return *field_cMServicePrompt == *other_value.field_cMServicePrompt;
case ALT_cMReEstablReq:
return *field_cMReEstablReq == *other_value.field_cMReEstablReq;
case ALT_abort:
return *field_abort == *other_value.field_abort;
case ALT_mMNull:
return *field_mMNull == *other_value.field_mMNull;
case ALT_mMStatus:
return *field_mMStatus == *other_value.field_mMStatus;
case ALT_mMInformation:
return *field_mMInformation == *other_value.field_mMInformation;
default:
return FALSE;
}
}

PDU__ML3__IMSI__DetachIndication& PDU__ML3__MM::imsiDetachIndication()
{
if (union_selection != ALT_imsiDetachIndication) {
clean_up();
field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication;
union_selection = ALT_imsiDetachIndication;
}
return *field_imsiDetachIndication;
}

const PDU__ML3__IMSI__DetachIndication& PDU__ML3__MM::imsiDetachIndication() const
{
if (union_selection != ALT_imsiDetachIndication) TTCN_error("Using non-selected field imsiDetachIndication in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_imsiDetachIndication;
}

PDU__ML3__LocationUpdateAccept& PDU__ML3__MM::locationUpdateAccept()
{
if (union_selection != ALT_locationUpdateAccept) {
clean_up();
field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept;
union_selection = ALT_locationUpdateAccept;
}
return *field_locationUpdateAccept;
}

const PDU__ML3__LocationUpdateAccept& PDU__ML3__MM::locationUpdateAccept() const
{
if (union_selection != ALT_locationUpdateAccept) TTCN_error("Using non-selected field locationUpdateAccept in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_locationUpdateAccept;
}

PDU__ML3__LocationUpdateReject& PDU__ML3__MM::locationUpdateReject()
{
if (union_selection != ALT_locationUpdateReject) {
clean_up();
field_locationUpdateReject = new PDU__ML3__LocationUpdateReject;
union_selection = ALT_locationUpdateReject;
}
return *field_locationUpdateReject;
}

const PDU__ML3__LocationUpdateReject& PDU__ML3__MM::locationUpdateReject() const
{
if (union_selection != ALT_locationUpdateReject) TTCN_error("Using non-selected field locationUpdateReject in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_locationUpdateReject;
}

PDU__ML3__LocationUpdateRequest& PDU__ML3__MM::locationUpdateRequest()
{
if (union_selection != ALT_locationUpdateRequest) {
clean_up();
field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest;
union_selection = ALT_locationUpdateRequest;
}
return *field_locationUpdateRequest;
}

const PDU__ML3__LocationUpdateRequest& PDU__ML3__MM::locationUpdateRequest() const
{
if (union_selection != ALT_locationUpdateRequest) TTCN_error("Using non-selected field locationUpdateRequest in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_locationUpdateRequest;
}

PDU__ML3__AuthenticationReject& PDU__ML3__MM::authenticationReject()
{
if (union_selection != ALT_authenticationReject) {
clean_up();
field_authenticationReject = new PDU__ML3__AuthenticationReject;
union_selection = ALT_authenticationReject;
}
return *field_authenticationReject;
}

const PDU__ML3__AuthenticationReject& PDU__ML3__MM::authenticationReject() const
{
if (union_selection != ALT_authenticationReject) TTCN_error("Using non-selected field authenticationReject in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_authenticationReject;
}

PDU__ML3__AuthenticationRequest& PDU__ML3__MM::authenticationRequest()
{
if (union_selection != ALT_authenticationRequest) {
clean_up();
field_authenticationRequest = new PDU__ML3__AuthenticationRequest;
union_selection = ALT_authenticationRequest;
}
return *field_authenticationRequest;
}

const PDU__ML3__AuthenticationRequest& PDU__ML3__MM::authenticationRequest() const
{
if (union_selection != ALT_authenticationRequest) TTCN_error("Using non-selected field authenticationRequest in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_authenticationRequest;
}

PDU__ML3__AuthenticationResponse& PDU__ML3__MM::authenticationResponse()
{
if (union_selection != ALT_authenticationResponse) {
clean_up();
field_authenticationResponse = new PDU__ML3__AuthenticationResponse;
union_selection = ALT_authenticationResponse;
}
return *field_authenticationResponse;
}

const PDU__ML3__AuthenticationResponse& PDU__ML3__MM::authenticationResponse() const
{
if (union_selection != ALT_authenticationResponse) TTCN_error("Using non-selected field authenticationResponse in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_authenticationResponse;
}

PDU__ML3__AuthenticationFailure& PDU__ML3__MM::authenticationFailure()
{
if (union_selection != ALT_authenticationFailure) {
clean_up();
field_authenticationFailure = new PDU__ML3__AuthenticationFailure;
union_selection = ALT_authenticationFailure;
}
return *field_authenticationFailure;
}

const PDU__ML3__AuthenticationFailure& PDU__ML3__MM::authenticationFailure() const
{
if (union_selection != ALT_authenticationFailure) TTCN_error("Using non-selected field authenticationFailure in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_authenticationFailure;
}

PDU__ML3__IdentityRequest& PDU__ML3__MM::identityRequest()
{
if (union_selection != ALT_identityRequest) {
clean_up();
field_identityRequest = new PDU__ML3__IdentityRequest;
union_selection = ALT_identityRequest;
}
return *field_identityRequest;
}

const PDU__ML3__IdentityRequest& PDU__ML3__MM::identityRequest() const
{
if (union_selection != ALT_identityRequest) TTCN_error("Using non-selected field identityRequest in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_identityRequest;
}

PDU__ML3__IdentityResponse& PDU__ML3__MM::identityResponse()
{
if (union_selection != ALT_identityResponse) {
clean_up();
field_identityResponse = new PDU__ML3__IdentityResponse;
union_selection = ALT_identityResponse;
}
return *field_identityResponse;
}

const PDU__ML3__IdentityResponse& PDU__ML3__MM::identityResponse() const
{
if (union_selection != ALT_identityResponse) TTCN_error("Using non-selected field identityResponse in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_identityResponse;
}

PDU__ML3__TMSI__ReallocationCommand& PDU__ML3__MM::tmsiReallocCommand()
{
if (union_selection != ALT_tmsiReallocCommand) {
clean_up();
field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand;
union_selection = ALT_tmsiReallocCommand;
}
return *field_tmsiReallocCommand;
}

const PDU__ML3__TMSI__ReallocationCommand& PDU__ML3__MM::tmsiReallocCommand() const
{
if (union_selection != ALT_tmsiReallocCommand) TTCN_error("Using non-selected field tmsiReallocCommand in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_tmsiReallocCommand;
}

PDU__ML3__TMSI__ReallocationComplete& PDU__ML3__MM::tmsiReallocComplete()
{
if (union_selection != ALT_tmsiReallocComplete) {
clean_up();
field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete;
union_selection = ALT_tmsiReallocComplete;
}
return *field_tmsiReallocComplete;
}

const PDU__ML3__TMSI__ReallocationComplete& PDU__ML3__MM::tmsiReallocComplete() const
{
if (union_selection != ALT_tmsiReallocComplete) TTCN_error("Using non-selected field tmsiReallocComplete in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_tmsiReallocComplete;
}

PDU__ML3__CMServiceAbort& PDU__ML3__MM::cMServiceAbort()
{
if (union_selection != ALT_cMServiceAbort) {
clean_up();
field_cMServiceAbort = new PDU__ML3__CMServiceAbort;
union_selection = ALT_cMServiceAbort;
}
return *field_cMServiceAbort;
}

const PDU__ML3__CMServiceAbort& PDU__ML3__MM::cMServiceAbort() const
{
if (union_selection != ALT_cMServiceAbort) TTCN_error("Using non-selected field cMServiceAbort in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMServiceAbort;
}

PDU__ML3__CMServiceAccept& PDU__ML3__MM::cMServiceAccept()
{
if (union_selection != ALT_cMServiceAccept) {
clean_up();
field_cMServiceAccept = new PDU__ML3__CMServiceAccept;
union_selection = ALT_cMServiceAccept;
}
return *field_cMServiceAccept;
}

const PDU__ML3__CMServiceAccept& PDU__ML3__MM::cMServiceAccept() const
{
if (union_selection != ALT_cMServiceAccept) TTCN_error("Using non-selected field cMServiceAccept in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMServiceAccept;
}

PDU__ML3__CMServiceReject& PDU__ML3__MM::cMServiceReject()
{
if (union_selection != ALT_cMServiceReject) {
clean_up();
field_cMServiceReject = new PDU__ML3__CMServiceReject;
union_selection = ALT_cMServiceReject;
}
return *field_cMServiceReject;
}

const PDU__ML3__CMServiceReject& PDU__ML3__MM::cMServiceReject() const
{
if (union_selection != ALT_cMServiceReject) TTCN_error("Using non-selected field cMServiceReject in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMServiceReject;
}

PDU__ML3__CMServiceRequest& PDU__ML3__MM::cMServiceRequest()
{
if (union_selection != ALT_cMServiceRequest) {
clean_up();
field_cMServiceRequest = new PDU__ML3__CMServiceRequest;
union_selection = ALT_cMServiceRequest;
}
return *field_cMServiceRequest;
}

const PDU__ML3__CMServiceRequest& PDU__ML3__MM::cMServiceRequest() const
{
if (union_selection != ALT_cMServiceRequest) TTCN_error("Using non-selected field cMServiceRequest in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMServiceRequest;
}

PDU__ML3__CMServicePrompt& PDU__ML3__MM::cMServicePrompt()
{
if (union_selection != ALT_cMServicePrompt) {
clean_up();
field_cMServicePrompt = new PDU__ML3__CMServicePrompt;
union_selection = ALT_cMServicePrompt;
}
return *field_cMServicePrompt;
}

const PDU__ML3__CMServicePrompt& PDU__ML3__MM::cMServicePrompt() const
{
if (union_selection != ALT_cMServicePrompt) TTCN_error("Using non-selected field cMServicePrompt in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMServicePrompt;
}

PDU__ML3__CMReestablishmentRequest& PDU__ML3__MM::cMReEstablReq()
{
if (union_selection != ALT_cMReEstablReq) {
clean_up();
field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest;
union_selection = ALT_cMReEstablReq;
}
return *field_cMReEstablReq;
}

const PDU__ML3__CMReestablishmentRequest& PDU__ML3__MM::cMReEstablReq() const
{
if (union_selection != ALT_cMReEstablReq) TTCN_error("Using non-selected field cMReEstablReq in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_cMReEstablReq;
}

PDU__ML3__Abort& PDU__ML3__MM::abort()
{
if (union_selection != ALT_abort) {
clean_up();
field_abort = new PDU__ML3__Abort;
union_selection = ALT_abort;
}
return *field_abort;
}

const PDU__ML3__Abort& PDU__ML3__MM::abort() const
{
if (union_selection != ALT_abort) TTCN_error("Using non-selected field abort in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_abort;
}

PDU__ML3__MMNull& PDU__ML3__MM::mMNull()
{
if (union_selection != ALT_mMNull) {
clean_up();
field_mMNull = new PDU__ML3__MMNull;
union_selection = ALT_mMNull;
}
return *field_mMNull;
}

const PDU__ML3__MMNull& PDU__ML3__MM::mMNull() const
{
if (union_selection != ALT_mMNull) TTCN_error("Using non-selected field mMNull in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_mMNull;
}

PDU__ML3__MMStatus& PDU__ML3__MM::mMStatus()
{
if (union_selection != ALT_mMStatus) {
clean_up();
field_mMStatus = new PDU__ML3__MMStatus;
union_selection = ALT_mMStatus;
}
return *field_mMStatus;
}

const PDU__ML3__MMStatus& PDU__ML3__MM::mMStatus() const
{
if (union_selection != ALT_mMStatus) TTCN_error("Using non-selected field mMStatus in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_mMStatus;
}

PDU__ML3__MMInformation& PDU__ML3__MM::mMInformation()
{
if (union_selection != ALT_mMInformation) {
clean_up();
field_mMInformation = new PDU__ML3__MMInformation;
union_selection = ALT_mMInformation;
}
return *field_mMInformation;
}

const PDU__ML3__MMInformation& PDU__ML3__MM::mMInformation() const
{
if (union_selection != ALT_mMInformation) TTCN_error("Using non-selected field mMInformation in a value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *field_mMInformation;
}

boolean PDU__ML3__MM::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return union_selection == checked_selection;
}

boolean PDU__ML3__MM::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean PDU__ML3__MM::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_imsiDetachIndication: return field_imsiDetachIndication->is_value();
case ALT_locationUpdateAccept: return field_locationUpdateAccept->is_value();
case ALT_locationUpdateReject: return field_locationUpdateReject->is_value();
case ALT_locationUpdateRequest: return field_locationUpdateRequest->is_value();
case ALT_authenticationReject: return field_authenticationReject->is_value();
case ALT_authenticationRequest: return field_authenticationRequest->is_value();
case ALT_authenticationResponse: return field_authenticationResponse->is_value();
case ALT_authenticationFailure: return field_authenticationFailure->is_value();
case ALT_identityRequest: return field_identityRequest->is_value();
case ALT_identityResponse: return field_identityResponse->is_value();
case ALT_tmsiReallocCommand: return field_tmsiReallocCommand->is_value();
case ALT_tmsiReallocComplete: return field_tmsiReallocComplete->is_value();
case ALT_cMServiceAbort: return field_cMServiceAbort->is_value();
case ALT_cMServiceAccept: return field_cMServiceAccept->is_value();
case ALT_cMServiceReject: return field_cMServiceReject->is_value();
case ALT_cMServiceRequest: return field_cMServiceRequest->is_value();
case ALT_cMServicePrompt: return field_cMServicePrompt->is_value();
case ALT_cMReEstablReq: return field_cMReEstablReq->is_value();
case ALT_abort: return field_abort->is_value();
case ALT_mMNull: return field_mMNull->is_value();
case ALT_mMStatus: return field_mMStatus->is_value();
case ALT_mMInformation: return field_mMInformation->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void PDU__ML3__MM::clean_up()
{
switch (union_selection) {
case ALT_imsiDetachIndication:
  delete field_imsiDetachIndication;
  break;
case ALT_locationUpdateAccept:
  delete field_locationUpdateAccept;
  break;
case ALT_locationUpdateReject:
  delete field_locationUpdateReject;
  break;
case ALT_locationUpdateRequest:
  delete field_locationUpdateRequest;
  break;
case ALT_authenticationReject:
  delete field_authenticationReject;
  break;
case ALT_authenticationRequest:
  delete field_authenticationRequest;
  break;
case ALT_authenticationResponse:
  delete field_authenticationResponse;
  break;
case ALT_authenticationFailure:
  delete field_authenticationFailure;
  break;
case ALT_identityRequest:
  delete field_identityRequest;
  break;
case ALT_identityResponse:
  delete field_identityResponse;
  break;
case ALT_tmsiReallocCommand:
  delete field_tmsiReallocCommand;
  break;
case ALT_tmsiReallocComplete:
  delete field_tmsiReallocComplete;
  break;
case ALT_cMServiceAbort:
  delete field_cMServiceAbort;
  break;
case ALT_cMServiceAccept:
  delete field_cMServiceAccept;
  break;
case ALT_cMServiceReject:
  delete field_cMServiceReject;
  break;
case ALT_cMServiceRequest:
  delete field_cMServiceRequest;
  break;
case ALT_cMServicePrompt:
  delete field_cMServicePrompt;
  break;
case ALT_cMReEstablReq:
  delete field_cMReEstablReq;
  break;
case ALT_abort:
  delete field_abort;
  break;
case ALT_mMNull:
  delete field_mMNull;
  break;
case ALT_mMStatus:
  delete field_mMStatus;
  break;
case ALT_mMInformation:
  delete field_mMInformation;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void PDU__ML3__MM::log() const
{
switch (union_selection) {
case ALT_imsiDetachIndication:
TTCN_Logger::log_event_str("{ imsiDetachIndication := ");
field_imsiDetachIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_locationUpdateAccept:
TTCN_Logger::log_event_str("{ locationUpdateAccept := ");
field_locationUpdateAccept->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_locationUpdateReject:
TTCN_Logger::log_event_str("{ locationUpdateReject := ");
field_locationUpdateReject->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_locationUpdateRequest:
TTCN_Logger::log_event_str("{ locationUpdateRequest := ");
field_locationUpdateRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_authenticationReject:
TTCN_Logger::log_event_str("{ authenticationReject := ");
field_authenticationReject->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_authenticationRequest:
TTCN_Logger::log_event_str("{ authenticationRequest := ");
field_authenticationRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_authenticationResponse:
TTCN_Logger::log_event_str("{ authenticationResponse := ");
field_authenticationResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_authenticationFailure:
TTCN_Logger::log_event_str("{ authenticationFailure := ");
field_authenticationFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_identityRequest:
TTCN_Logger::log_event_str("{ identityRequest := ");
field_identityRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_identityResponse:
TTCN_Logger::log_event_str("{ identityResponse := ");
field_identityResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tmsiReallocCommand:
TTCN_Logger::log_event_str("{ tmsiReallocCommand := ");
field_tmsiReallocCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_tmsiReallocComplete:
TTCN_Logger::log_event_str("{ tmsiReallocComplete := ");
field_tmsiReallocComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMServiceAbort:
TTCN_Logger::log_event_str("{ cMServiceAbort := ");
field_cMServiceAbort->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMServiceAccept:
TTCN_Logger::log_event_str("{ cMServiceAccept := ");
field_cMServiceAccept->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMServiceReject:
TTCN_Logger::log_event_str("{ cMServiceReject := ");
field_cMServiceReject->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMServiceRequest:
TTCN_Logger::log_event_str("{ cMServiceRequest := ");
field_cMServiceRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMServicePrompt:
TTCN_Logger::log_event_str("{ cMServicePrompt := ");
field_cMServicePrompt->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cMReEstablReq:
TTCN_Logger::log_event_str("{ cMReEstablReq := ");
field_cMReEstablReq->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_abort:
TTCN_Logger::log_event_str("{ abort := ");
field_abort->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mMNull:
TTCN_Logger::log_event_str("{ mMNull := ");
field_mMNull->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mMStatus:
TTCN_Logger::log_event_str("{ mMStatus := ");
field_mMStatus->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mMInformation:
TTCN_Logger::log_event_str("{ mMInformation := ");
field_mMInformation->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void PDU__ML3__MM::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "imsiDetachIndication")) {
    imsiDetachIndication().set_param(*mp_last);
    if (!imsiDetachIndication().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "locationUpdateAccept")) {
    locationUpdateAccept().set_param(*mp_last);
    if (!locationUpdateAccept().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "locationUpdateReject")) {
    locationUpdateReject().set_param(*mp_last);
    if (!locationUpdateReject().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "locationUpdateRequest")) {
    locationUpdateRequest().set_param(*mp_last);
    if (!locationUpdateRequest().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "authenticationReject")) {
    authenticationReject().set_param(*mp_last);
    if (!authenticationReject().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "authenticationRequest")) {
    authenticationRequest().set_param(*mp_last);
    if (!authenticationRequest().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "authenticationResponse")) {
    authenticationResponse().set_param(*mp_last);
    if (!authenticationResponse().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "authenticationFailure")) {
    authenticationFailure().set_param(*mp_last);
    if (!authenticationFailure().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "identityRequest")) {
    identityRequest().set_param(*mp_last);
    if (!identityRequest().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "identityResponse")) {
    identityResponse().set_param(*mp_last);
    if (!identityResponse().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tmsiReallocCommand")) {
    tmsiReallocCommand().set_param(*mp_last);
    if (!tmsiReallocCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "tmsiReallocComplete")) {
    tmsiReallocComplete().set_param(*mp_last);
    if (!tmsiReallocComplete().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMServiceAbort")) {
    cMServiceAbort().set_param(*mp_last);
    if (!cMServiceAbort().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMServiceAccept")) {
    cMServiceAccept().set_param(*mp_last);
    if (!cMServiceAccept().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMServiceReject")) {
    cMServiceReject().set_param(*mp_last);
    if (!cMServiceReject().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMServiceRequest")) {
    cMServiceRequest().set_param(*mp_last);
    if (!cMServiceRequest().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMServicePrompt")) {
    cMServicePrompt().set_param(*mp_last);
    if (!cMServicePrompt().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cMReEstablReq")) {
    cMReEstablReq().set_param(*mp_last);
    if (!cMReEstablReq().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "abort")) {
    abort().set_param(*mp_last);
    if (!abort().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mMNull")) {
    mMNull().set_param(*mp_last);
    if (!mMNull().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mMStatus")) {
    mMStatus().set_param(*mp_last);
    if (!mMStatus().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mMInformation")) {
    mMInformation().set_param(*mp_last);
    if (!mMInformation().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_MM_Types.PDU_ML3_MM.", last_name);
}

void PDU__ML3__MM::set_implicit_omit()
{
switch (union_selection) {
case ALT_imsiDetachIndication:
field_imsiDetachIndication->set_implicit_omit(); break;
case ALT_locationUpdateAccept:
field_locationUpdateAccept->set_implicit_omit(); break;
case ALT_locationUpdateReject:
field_locationUpdateReject->set_implicit_omit(); break;
case ALT_locationUpdateRequest:
field_locationUpdateRequest->set_implicit_omit(); break;
case ALT_authenticationReject:
field_authenticationReject->set_implicit_omit(); break;
case ALT_authenticationRequest:
field_authenticationRequest->set_implicit_omit(); break;
case ALT_authenticationResponse:
field_authenticationResponse->set_implicit_omit(); break;
case ALT_authenticationFailure:
field_authenticationFailure->set_implicit_omit(); break;
case ALT_identityRequest:
field_identityRequest->set_implicit_omit(); break;
case ALT_identityResponse:
field_identityResponse->set_implicit_omit(); break;
case ALT_tmsiReallocCommand:
field_tmsiReallocCommand->set_implicit_omit(); break;
case ALT_tmsiReallocComplete:
field_tmsiReallocComplete->set_implicit_omit(); break;
case ALT_cMServiceAbort:
field_cMServiceAbort->set_implicit_omit(); break;
case ALT_cMServiceAccept:
field_cMServiceAccept->set_implicit_omit(); break;
case ALT_cMServiceReject:
field_cMServiceReject->set_implicit_omit(); break;
case ALT_cMServiceRequest:
field_cMServiceRequest->set_implicit_omit(); break;
case ALT_cMServicePrompt:
field_cMServicePrompt->set_implicit_omit(); break;
case ALT_cMReEstablReq:
field_cMReEstablReq->set_implicit_omit(); break;
case ALT_abort:
field_abort->set_implicit_omit(); break;
case ALT_mMNull:
field_mMNull->set_implicit_omit(); break;
case ALT_mMStatus:
field_mMStatus->set_implicit_omit(); break;
case ALT_mMInformation:
field_mMInformation->set_implicit_omit(); break;
default: break;
}
}

void PDU__ML3__MM::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_imsiDetachIndication:
field_imsiDetachIndication->encode_text(text_buf);
break;
case ALT_locationUpdateAccept:
field_locationUpdateAccept->encode_text(text_buf);
break;
case ALT_locationUpdateReject:
field_locationUpdateReject->encode_text(text_buf);
break;
case ALT_locationUpdateRequest:
field_locationUpdateRequest->encode_text(text_buf);
break;
case ALT_authenticationReject:
field_authenticationReject->encode_text(text_buf);
break;
case ALT_authenticationRequest:
field_authenticationRequest->encode_text(text_buf);
break;
case ALT_authenticationResponse:
field_authenticationResponse->encode_text(text_buf);
break;
case ALT_authenticationFailure:
field_authenticationFailure->encode_text(text_buf);
break;
case ALT_identityRequest:
field_identityRequest->encode_text(text_buf);
break;
case ALT_identityResponse:
field_identityResponse->encode_text(text_buf);
break;
case ALT_tmsiReallocCommand:
field_tmsiReallocCommand->encode_text(text_buf);
break;
case ALT_tmsiReallocComplete:
field_tmsiReallocComplete->encode_text(text_buf);
break;
case ALT_cMServiceAbort:
field_cMServiceAbort->encode_text(text_buf);
break;
case ALT_cMServiceAccept:
field_cMServiceAccept->encode_text(text_buf);
break;
case ALT_cMServiceReject:
field_cMServiceReject->encode_text(text_buf);
break;
case ALT_cMServiceRequest:
field_cMServiceRequest->encode_text(text_buf);
break;
case ALT_cMServicePrompt:
field_cMServicePrompt->encode_text(text_buf);
break;
case ALT_cMReEstablReq:
field_cMReEstablReq->encode_text(text_buf);
break;
case ALT_abort:
field_abort->encode_text(text_buf);
break;
case ALT_mMNull:
field_mMNull->encode_text(text_buf);
break;
case ALT_mMStatus:
field_mMStatus->encode_text(text_buf);
break;
case ALT_mMInformation:
field_mMInformation->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}

void PDU__ML3__MM::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_imsiDetachIndication:
imsiDetachIndication().decode_text(text_buf);
break;
case ALT_locationUpdateAccept:
locationUpdateAccept().decode_text(text_buf);
break;
case ALT_locationUpdateReject:
locationUpdateReject().decode_text(text_buf);
break;
case ALT_locationUpdateRequest:
locationUpdateRequest().decode_text(text_buf);
break;
case ALT_authenticationReject:
authenticationReject().decode_text(text_buf);
break;
case ALT_authenticationRequest:
authenticationRequest().decode_text(text_buf);
break;
case ALT_authenticationResponse:
authenticationResponse().decode_text(text_buf);
break;
case ALT_authenticationFailure:
authenticationFailure().decode_text(text_buf);
break;
case ALT_identityRequest:
identityRequest().decode_text(text_buf);
break;
case ALT_identityResponse:
identityResponse().decode_text(text_buf);
break;
case ALT_tmsiReallocCommand:
tmsiReallocCommand().decode_text(text_buf);
break;
case ALT_tmsiReallocComplete:
tmsiReallocComplete().decode_text(text_buf);
break;
case ALT_cMServiceAbort:
cMServiceAbort().decode_text(text_buf);
break;
case ALT_cMServiceAccept:
cMServiceAccept().decode_text(text_buf);
break;
case ALT_cMServiceReject:
cMServiceReject().decode_text(text_buf);
break;
case ALT_cMServiceRequest:
cMServiceRequest().decode_text(text_buf);
break;
case ALT_cMServicePrompt:
cMServicePrompt().decode_text(text_buf);
break;
case ALT_cMReEstablReq:
cMReEstablReq().decode_text(text_buf);
break;
case ALT_abort:
abort().decode_text(text_buf);
break;
case ALT_mMNull:
mMNull().decode_text(text_buf);
break;
case ALT_mMStatus:
mMStatus().decode_text(text_buf);
break;
case ALT_mMInformation:
mMInformation().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}

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

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

int PDU__ML3__MM::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, PDU__ML3__IMSI__DetachIndication_descr_.raw->forceomit);
      decoded_length = imsiDetachIndication().RAW_decode(PDU__ML3__IMSI__DetachIndication_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, PDU__ML3__LocationUpdateAccept_descr_.raw->forceomit);
      decoded_length = locationUpdateAccept().RAW_decode(PDU__ML3__LocationUpdateAccept_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, PDU__ML3__LocationUpdateReject_descr_.raw->forceomit);
      decoded_length = locationUpdateReject().RAW_decode(PDU__ML3__LocationUpdateReject_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, PDU__ML3__LocationUpdateRequest_descr_.raw->forceomit);
      decoded_length = locationUpdateRequest().RAW_decode(PDU__ML3__LocationUpdateRequest_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, PDU__ML3__AuthenticationReject_descr_.raw->forceomit);
      decoded_length = authenticationReject().RAW_decode(PDU__ML3__AuthenticationReject_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, PDU__ML3__AuthenticationRequest_descr_.raw->forceomit);
      decoded_length = authenticationRequest().RAW_decode(PDU__ML3__AuthenticationRequest_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, PDU__ML3__AuthenticationResponse_descr_.raw->forceomit);
      decoded_length = authenticationResponse().RAW_decode(PDU__ML3__AuthenticationResponse_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, PDU__ML3__AuthenticationFailure_descr_.raw->forceomit);
      decoded_length = authenticationFailure().RAW_decode(PDU__ML3__AuthenticationFailure_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, PDU__ML3__IdentityRequest_descr_.raw->forceomit);
      decoded_length = identityRequest().RAW_decode(PDU__ML3__IdentityRequest_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, PDU__ML3__IdentityResponse_descr_.raw->forceomit);
      decoded_length = identityResponse().RAW_decode(PDU__ML3__IdentityResponse_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, PDU__ML3__TMSI__ReallocationCommand_descr_.raw->forceomit);
      decoded_length = tmsiReallocCommand().RAW_decode(PDU__ML3__TMSI__ReallocationCommand_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, PDU__ML3__TMSI__ReallocationComplete_descr_.raw->forceomit);
      decoded_length = tmsiReallocComplete().RAW_decode(PDU__ML3__TMSI__ReallocationComplete_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 12: {
      RAW_Force_Omit field_force_omit(12, force_omit, PDU__ML3__CMServiceAbort_descr_.raw->forceomit);
      decoded_length = cMServiceAbort().RAW_decode(PDU__ML3__CMServiceAbort_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 13: {
      RAW_Force_Omit field_force_omit(13, force_omit, PDU__ML3__CMServiceAccept_descr_.raw->forceomit);
      decoded_length = cMServiceAccept().RAW_decode(PDU__ML3__CMServiceAccept_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 14: {
      RAW_Force_Omit field_force_omit(14, force_omit, PDU__ML3__CMServiceReject_descr_.raw->forceomit);
      decoded_length = cMServiceReject().RAW_decode(PDU__ML3__CMServiceReject_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 15: {
      RAW_Force_Omit field_force_omit(15, force_omit, PDU__ML3__CMServiceRequest_descr_.raw->forceomit);
      decoded_length = cMServiceRequest().RAW_decode(PDU__ML3__CMServiceRequest_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 16: {
      RAW_Force_Omit field_force_omit(16, force_omit, PDU__ML3__CMServicePrompt_descr_.raw->forceomit);
      decoded_length = cMServicePrompt().RAW_decode(PDU__ML3__CMServicePrompt_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 17: {
      RAW_Force_Omit field_force_omit(17, force_omit, PDU__ML3__CMReestablishmentRequest_descr_.raw->forceomit);
      decoded_length = cMReEstablReq().RAW_decode(PDU__ML3__CMReestablishmentRequest_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 18: {
      RAW_Force_Omit field_force_omit(18, force_omit, PDU__ML3__Abort_descr_.raw->forceomit);
      decoded_length = abort().RAW_decode(PDU__ML3__Abort_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 19: {
      RAW_Force_Omit field_force_omit(19, force_omit, PDU__ML3__MMNull_descr_.raw->forceomit);
      decoded_length = mMNull().RAW_decode(PDU__ML3__MMNull_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 20: {
      RAW_Force_Omit field_force_omit(20, force_omit, PDU__ML3__MMStatus_descr_.raw->forceomit);
      decoded_length = mMStatus().RAW_decode(PDU__ML3__MMStatus_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 21: {
      RAW_Force_Omit field_force_omit(21, force_omit, PDU__ML3__MMInformation_descr_.raw->forceomit);
      decoded_length = mMInformation().RAW_decode(PDU__ML3__MMInformation_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
    boolean already_failed = FALSE;
    BITSTRING temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT6_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_10) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, PDU__ML3__IMSI__DetachIndication_descr_.raw->forceomit);
          decoded_length = imsiDetachIndication().RAW_decode(PDU__ML3__IMSI__DetachIndication_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_imsiDetachIndication).messageType() ==  bs_10) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_11) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, PDU__ML3__LocationUpdateAccept_descr_.raw->forceomit);
          decoded_length = locationUpdateAccept().RAW_decode(PDU__ML3__LocationUpdateAccept_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_locationUpdateAccept).messageType() ==  bs_11) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_12) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(2, force_omit, PDU__ML3__LocationUpdateReject_descr_.raw->forceomit);
          decoded_length = locationUpdateReject().RAW_decode(PDU__ML3__LocationUpdateReject_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_locationUpdateReject).messageType() ==  bs_12) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_13) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(3, force_omit, PDU__ML3__LocationUpdateRequest_descr_.raw->forceomit);
          decoded_length = locationUpdateRequest().RAW_decode(PDU__ML3__LocationUpdateRequest_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_locationUpdateRequest).messageType() ==  bs_13) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_14) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(4, force_omit, PDU__ML3__AuthenticationReject_descr_.raw->forceomit);
          decoded_length = authenticationReject().RAW_decode(PDU__ML3__AuthenticationReject_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_authenticationReject).messageType() ==  bs_14) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_15) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(5, force_omit, PDU__ML3__AuthenticationRequest_descr_.raw->forceomit);
          decoded_length = authenticationRequest().RAW_decode(PDU__ML3__AuthenticationRequest_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_authenticationRequest).messageType() ==  bs_15) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_16) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(6, force_omit, PDU__ML3__AuthenticationResponse_descr_.raw->forceomit);
          decoded_length = authenticationResponse().RAW_decode(PDU__ML3__AuthenticationResponse_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_authenticationResponse).messageType() ==  bs_16) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_17) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(7, force_omit, PDU__ML3__AuthenticationFailure_descr_.raw->forceomit);
          decoded_length = authenticationFailure().RAW_decode(PDU__ML3__AuthenticationFailure_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_authenticationFailure).messageType() ==  bs_17) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_18) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(8, force_omit, PDU__ML3__IdentityRequest_descr_.raw->forceomit);
          decoded_length = identityRequest().RAW_decode(PDU__ML3__IdentityRequest_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_identityRequest).messageType() ==  bs_18) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_19) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(9, force_omit, PDU__ML3__IdentityResponse_descr_.raw->forceomit);
          decoded_length = identityResponse().RAW_decode(PDU__ML3__IdentityResponse_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_identityResponse).messageType() ==  bs_19) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_20) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(10, force_omit, PDU__ML3__TMSI__ReallocationCommand_descr_.raw->forceomit);
          decoded_length = tmsiReallocCommand().RAW_decode(PDU__ML3__TMSI__ReallocationCommand_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_tmsiReallocCommand).messageType() ==  bs_20) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_21) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(11, force_omit, PDU__ML3__TMSI__ReallocationComplete_descr_.raw->forceomit);
          decoded_length = tmsiReallocComplete().RAW_decode(PDU__ML3__TMSI__ReallocationComplete_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_tmsiReallocComplete).messageType() ==  bs_21) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_22) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(12, force_omit, PDU__ML3__CMServiceAbort_descr_.raw->forceomit);
          decoded_length = cMServiceAbort().RAW_decode(PDU__ML3__CMServiceAbort_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMServiceAbort).messageType() ==  bs_22) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_23) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(13, force_omit, PDU__ML3__CMServiceAccept_descr_.raw->forceomit);
          decoded_length = cMServiceAccept().RAW_decode(PDU__ML3__CMServiceAccept_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMServiceAccept).messageType() ==  bs_23) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_24) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(14, force_omit, PDU__ML3__CMServiceReject_descr_.raw->forceomit);
          decoded_length = cMServiceReject().RAW_decode(PDU__ML3__CMServiceReject_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMServiceReject).messageType() ==  bs_24) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_25) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(15, force_omit, PDU__ML3__CMServiceRequest_descr_.raw->forceomit);
          decoded_length = cMServiceRequest().RAW_decode(PDU__ML3__CMServiceRequest_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMServiceRequest).messageType() ==  bs_25) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_26) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(16, force_omit, PDU__ML3__CMServicePrompt_descr_.raw->forceomit);
          decoded_length = cMServicePrompt().RAW_decode(PDU__ML3__CMServicePrompt_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMServicePrompt).messageType() ==  bs_26) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_27) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(17, force_omit, PDU__ML3__CMReestablishmentRequest_descr_.raw->forceomit);
          decoded_length = cMReEstablReq().RAW_decode(PDU__ML3__CMReestablishmentRequest_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cMReEstablReq).messageType() ==  bs_27) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_28) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(18, force_omit, PDU__ML3__Abort_descr_.raw->forceomit);
          decoded_length = abort().RAW_decode(PDU__ML3__Abort_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_abort).messageType() ==  bs_28) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_29) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(19, force_omit, PDU__ML3__MMNull_descr_.raw->forceomit);
          decoded_length = mMNull().RAW_decode(PDU__ML3__MMNull_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_mMNull).messageType() ==  bs_29) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_30) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(20, force_omit, PDU__ML3__MMStatus_descr_.raw->forceomit);
          decoded_length = mMStatus().RAW_decode(PDU__ML3__MMStatus_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_mMStatus).messageType() ==  bs_30) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_31) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(21, force_omit, PDU__ML3__MMInformation_descr_.raw->forceomit);
          decoded_length = mMInformation().RAW_decode(PDU__ML3__MMInformation_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_mMInformation).messageType() ==  bs_31) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int PDU__ML3__MM::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 22;  myleaf.body.node.nodes = init_nodes_of_enc_tree(22);
  memset(myleaf.body.node.nodes, 0, 22 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_imsiDetachIndication:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, PDU__ML3__IMSI__DetachIndication_descr_.raw);
    encoded_length = field_imsiDetachIndication->RAW_encode(PDU__ML3__IMSI__DetachIndication_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &PDU__ML3__IMSI__DetachIndication_descr_;
    if ((*field_imsiDetachIndication).messageType() !=  bs_10) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,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_10.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_locationUpdateAccept:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, PDU__ML3__LocationUpdateAccept_descr_.raw);
    encoded_length = field_locationUpdateAccept->RAW_encode(PDU__ML3__LocationUpdateAccept_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &PDU__ML3__LocationUpdateAccept_descr_;
    if ((*field_locationUpdateAccept).messageType() !=  bs_11) {
  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_11.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_locationUpdateReject:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, PDU__ML3__LocationUpdateReject_descr_.raw);
    encoded_length = field_locationUpdateReject->RAW_encode(PDU__ML3__LocationUpdateReject_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &PDU__ML3__LocationUpdateReject_descr_;
    if ((*field_locationUpdateReject).messageType() !=  bs_12) {
  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_12.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_locationUpdateRequest:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, PDU__ML3__LocationUpdateRequest_descr_.raw);
    encoded_length = field_locationUpdateRequest->RAW_encode(PDU__ML3__LocationUpdateRequest_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &PDU__ML3__LocationUpdateRequest_descr_;
    if ((*field_locationUpdateRequest).messageType() !=  bs_13) {
  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_13.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_authenticationReject:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, PDU__ML3__AuthenticationReject_descr_.raw);
    encoded_length = field_authenticationReject->RAW_encode(PDU__ML3__AuthenticationReject_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &PDU__ML3__AuthenticationReject_descr_;
    if ((*field_authenticationReject).messageType() !=  bs_14) {
  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){
   bs_14.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_authenticationRequest:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, PDU__ML3__AuthenticationRequest_descr_.raw);
    encoded_length = field_authenticationRequest->RAW_encode(PDU__ML3__AuthenticationRequest_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &PDU__ML3__AuthenticationRequest_descr_;
    if ((*field_authenticationRequest).messageType() !=  bs_15) {
  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){
   bs_15.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_authenticationResponse:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, PDU__ML3__AuthenticationResponse_descr_.raw);
    encoded_length = field_authenticationResponse->RAW_encode(PDU__ML3__AuthenticationResponse_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &PDU__ML3__AuthenticationResponse_descr_;
    if ((*field_authenticationResponse).messageType() !=  bs_16) {
  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_16.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_authenticationFailure:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, PDU__ML3__AuthenticationFailure_descr_.raw);
    encoded_length = field_authenticationFailure->RAW_encode(PDU__ML3__AuthenticationFailure_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &PDU__ML3__AuthenticationFailure_descr_;
    if ((*field_authenticationFailure).messageType() !=  bs_17) {
  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_17.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_identityRequest:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, PDU__ML3__IdentityRequest_descr_.raw);
    encoded_length = field_identityRequest->RAW_encode(PDU__ML3__IdentityRequest_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &PDU__ML3__IdentityRequest_descr_;
    if ((*field_identityRequest).messageType() !=  bs_18) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,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_18.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_identityResponse:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, PDU__ML3__IdentityResponse_descr_.raw);
    encoded_length = field_identityResponse->RAW_encode(PDU__ML3__IdentityResponse_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &PDU__ML3__IdentityResponse_descr_;
    if ((*field_identityResponse).messageType() !=  bs_19) {
  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_19.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_tmsiReallocCommand:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, PDU__ML3__TMSI__ReallocationCommand_descr_.raw);
    encoded_length = field_tmsiReallocCommand->RAW_encode(PDU__ML3__TMSI__ReallocationCommand_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &PDU__ML3__TMSI__ReallocationCommand_descr_;
    if ((*field_tmsiReallocCommand).messageType() !=  bs_20) {
  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_20.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_tmsiReallocComplete:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, PDU__ML3__TMSI__ReallocationComplete_descr_.raw);
    encoded_length = field_tmsiReallocComplete->RAW_encode(PDU__ML3__TMSI__ReallocationComplete_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &PDU__ML3__TMSI__ReallocationComplete_descr_;
    if ((*field_tmsiReallocComplete).messageType() !=  bs_21) {
  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){
   bs_21.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_cMServiceAbort:
    myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 12, PDU__ML3__CMServiceAbort_descr_.raw);
    encoded_length = field_cMServiceAbort->RAW_encode(PDU__ML3__CMServiceAbort_descr_, *myleaf.body.node.nodes[12]);
    myleaf.body.node.nodes[12]->coding_descr = &PDU__ML3__CMServiceAbort_descr_;
    if ((*field_cMServiceAbort).messageType() !=  bs_22) {
  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){
   bs_22.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_cMServiceAccept:
    myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 13, PDU__ML3__CMServiceAccept_descr_.raw);
    encoded_length = field_cMServiceAccept->RAW_encode(PDU__ML3__CMServiceAccept_descr_, *myleaf.body.node.nodes[13]);
    myleaf.body.node.nodes[13]->coding_descr = &PDU__ML3__CMServiceAccept_descr_;
    if ((*field_cMServiceAccept).messageType() !=  bs_23) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={13,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::BIT6_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);
  }
    }
    break;
  case ALT_cMServiceReject:
    myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 14, PDU__ML3__CMServiceReject_descr_.raw);
    encoded_length = field_cMServiceReject->RAW_encode(PDU__ML3__CMServiceReject_descr_, *myleaf.body.node.nodes[14]);
    myleaf.body.node.nodes[14]->coding_descr = &PDU__ML3__CMServiceReject_descr_;
    if ((*field_cMServiceReject).messageType() !=  bs_24) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={14,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_24.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_cMServiceRequest:
    myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 15, PDU__ML3__CMServiceRequest_descr_.raw);
    encoded_length = field_cMServiceRequest->RAW_encode(PDU__ML3__CMServiceRequest_descr_, *myleaf.body.node.nodes[15]);
    myleaf.body.node.nodes[15]->coding_descr = &PDU__ML3__CMServiceRequest_descr_;
    if ((*field_cMServiceRequest).messageType() !=  bs_25) {
  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_25.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_cMServicePrompt:
    myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 16, PDU__ML3__CMServicePrompt_descr_.raw);
    encoded_length = field_cMServicePrompt->RAW_encode(PDU__ML3__CMServicePrompt_descr_, *myleaf.body.node.nodes[16]);
    myleaf.body.node.nodes[16]->coding_descr = &PDU__ML3__CMServicePrompt_descr_;
    if ((*field_cMServicePrompt).messageType() !=  bs_26) {
  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_26.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_cMReEstablReq:
    myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 17, PDU__ML3__CMReestablishmentRequest_descr_.raw);
    encoded_length = field_cMReEstablReq->RAW_encode(PDU__ML3__CMReestablishmentRequest_descr_, *myleaf.body.node.nodes[17]);
    myleaf.body.node.nodes[17]->coding_descr = &PDU__ML3__CMReestablishmentRequest_descr_;
    if ((*field_cMReEstablReq).messageType() !=  bs_27) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={17,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::BIT6_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);
  }
    }
    break;
  case ALT_abort:
    myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 18, PDU__ML3__Abort_descr_.raw);
    encoded_length = field_abort->RAW_encode(PDU__ML3__Abort_descr_, *myleaf.body.node.nodes[18]);
    myleaf.body.node.nodes[18]->coding_descr = &PDU__ML3__Abort_descr_;
    if ((*field_abort).messageType() !=  bs_28) {
  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){
   bs_28.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_mMNull:
    myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 19, PDU__ML3__MMNull_descr_.raw);
    encoded_length = field_mMNull->RAW_encode(PDU__ML3__MMNull_descr_, *myleaf.body.node.nodes[19]);
    myleaf.body.node.nodes[19]->coding_descr = &PDU__ML3__MMNull_descr_;
    if ((*field_mMNull).messageType() !=  bs_29) {
  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){
   bs_29.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_mMStatus:
    myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 20, PDU__ML3__MMStatus_descr_.raw);
    encoded_length = field_mMStatus->RAW_encode(PDU__ML3__MMStatus_descr_, *myleaf.body.node.nodes[20]);
    myleaf.body.node.nodes[20]->coding_descr = &PDU__ML3__MMStatus_descr_;
    if ((*field_mMStatus).messageType() !=  bs_30) {
  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){
   bs_30.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  case ALT_mMInformation:
    myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 21, PDU__ML3__MMInformation_descr_.raw);
    encoded_length = field_mMInformation->RAW_encode(PDU__ML3__MMInformation_descr_, *myleaf.body.node.nodes[21]);
    myleaf.body.node.nodes[21]->coding_descr = &PDU__ML3__MMInformation_descr_;
    if ((*field_mMInformation).messageType() !=  bs_31) {
  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){
   bs_31.RAW_encode(General__Types::BIT6_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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void PDU__ML3__MM_template::copy_value(const PDU__ML3__MM& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication_template(other_value.imsiDetachIndication());
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept_template(other_value.locationUpdateAccept());
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject = new PDU__ML3__LocationUpdateReject_template(other_value.locationUpdateReject());
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest_template(other_value.locationUpdateRequest());
break;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject = new PDU__ML3__AuthenticationReject_template(other_value.authenticationReject());
break;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest = new PDU__ML3__AuthenticationRequest_template(other_value.authenticationRequest());
break;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse = new PDU__ML3__AuthenticationResponse_template(other_value.authenticationResponse());
break;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure = new PDU__ML3__AuthenticationFailure_template(other_value.authenticationFailure());
break;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest = new PDU__ML3__IdentityRequest_template(other_value.identityRequest());
break;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse = new PDU__ML3__IdentityResponse_template(other_value.identityResponse());
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand_template(other_value.tmsiReallocCommand());
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete_template(other_value.tmsiReallocComplete());
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort = new PDU__ML3__CMServiceAbort_template(other_value.cMServiceAbort());
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept = new PDU__ML3__CMServiceAccept_template(other_value.cMServiceAccept());
break;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject = new PDU__ML3__CMServiceReject_template(other_value.cMServiceReject());
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest = new PDU__ML3__CMServiceRequest_template(other_value.cMServiceRequest());
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt = new PDU__ML3__CMServicePrompt_template(other_value.cMServicePrompt());
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest_template(other_value.cMReEstablReq());
break;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort = new PDU__ML3__Abort_template(other_value.abort());
break;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull = new PDU__ML3__MMNull_template(other_value.mMNull());
break;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus = new PDU__ML3__MMStatus_template(other_value.mMStatus());
break;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation = new PDU__ML3__MMInformation_template(other_value.mMInformation());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__MM_template::copy_template(const PDU__ML3__MM_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication_template(*other_value.single_value.field_imsiDetachIndication);
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept_template(*other_value.single_value.field_locationUpdateAccept);
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject = new PDU__ML3__LocationUpdateReject_template(*other_value.single_value.field_locationUpdateReject);
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest_template(*other_value.single_value.field_locationUpdateRequest);
break;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject = new PDU__ML3__AuthenticationReject_template(*other_value.single_value.field_authenticationReject);
break;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest = new PDU__ML3__AuthenticationRequest_template(*other_value.single_value.field_authenticationRequest);
break;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse = new PDU__ML3__AuthenticationResponse_template(*other_value.single_value.field_authenticationResponse);
break;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure = new PDU__ML3__AuthenticationFailure_template(*other_value.single_value.field_authenticationFailure);
break;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest = new PDU__ML3__IdentityRequest_template(*other_value.single_value.field_identityRequest);
break;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse = new PDU__ML3__IdentityResponse_template(*other_value.single_value.field_identityResponse);
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand_template(*other_value.single_value.field_tmsiReallocCommand);
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete_template(*other_value.single_value.field_tmsiReallocComplete);
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort = new PDU__ML3__CMServiceAbort_template(*other_value.single_value.field_cMServiceAbort);
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept = new PDU__ML3__CMServiceAccept_template(*other_value.single_value.field_cMServiceAccept);
break;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject = new PDU__ML3__CMServiceReject_template(*other_value.single_value.field_cMServiceReject);
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest = new PDU__ML3__CMServiceRequest_template(*other_value.single_value.field_cMServiceRequest);
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt = new PDU__ML3__CMServicePrompt_template(*other_value.single_value.field_cMServicePrompt);
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest_template(*other_value.single_value.field_cMReEstablReq);
break;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort = new PDU__ML3__Abort_template(*other_value.single_value.field_abort);
break;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull = new PDU__ML3__MMNull_template(*other_value.single_value.field_mMNull);
break;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus = new PDU__ML3__MMStatus_template(*other_value.single_value.field_mMStatus);
break;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation = new PDU__ML3__MMInformation_template(*other_value.single_value.field_mMInformation);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
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__ML3__MM_template[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__ML3__MM_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__MM_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 template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
set_selection(other_value);
}

PDU__ML3__MM_template::PDU__ML3__MM_template()
{
}

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

PDU__ML3__MM_template::PDU__ML3__MM_template(const PDU__ML3__MM& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void PDU__ML3__MM_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
delete single_value.field_imsiDetachIndication;
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
delete single_value.field_locationUpdateAccept;
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
delete single_value.field_locationUpdateReject;
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
delete single_value.field_locationUpdateRequest;
break;
case PDU__ML3__MM::ALT_authenticationReject:
delete single_value.field_authenticationReject;
break;
case PDU__ML3__MM::ALT_authenticationRequest:
delete single_value.field_authenticationRequest;
break;
case PDU__ML3__MM::ALT_authenticationResponse:
delete single_value.field_authenticationResponse;
break;
case PDU__ML3__MM::ALT_authenticationFailure:
delete single_value.field_authenticationFailure;
break;
case PDU__ML3__MM::ALT_identityRequest:
delete single_value.field_identityRequest;
break;
case PDU__ML3__MM::ALT_identityResponse:
delete single_value.field_identityResponse;
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
delete single_value.field_tmsiReallocCommand;
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
delete single_value.field_tmsiReallocComplete;
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
delete single_value.field_cMServiceAbort;
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
delete single_value.field_cMServiceAccept;
break;
case PDU__ML3__MM::ALT_cMServiceReject:
delete single_value.field_cMServiceReject;
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
delete single_value.field_cMServiceRequest;
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
delete single_value.field_cMServicePrompt;
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
delete single_value.field_cMReEstablReq;
break;
case PDU__ML3__MM::ALT_abort:
delete single_value.field_abort;
break;
case PDU__ML3__MM::ALT_mMNull:
delete single_value.field_mMNull;
break;
case PDU__ML3__MM::ALT_mMStatus:
delete single_value.field_mMStatus;
break;
case PDU__ML3__MM::ALT_mMInformation:
delete single_value.field_mMInformation;
default:
break;
}
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__ML3__MM_template& PDU__ML3__MM_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

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

PDU__ML3__MM_template& PDU__ML3__MM_template::operator=(const OPTIONAL<PDU__ML3__MM>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__MM&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
return *this;
}

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

boolean PDU__ML3__MM_template::match(const PDU__ML3__MM& 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:
{
PDU__ML3__MM::union_selection_type value_selection = other_value.get_selection();
if (value_selection == PDU__ML3__MM::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
return single_value.field_imsiDetachIndication->match(other_value.imsiDetachIndication(), legacy);
case PDU__ML3__MM::ALT_locationUpdateAccept:
return single_value.field_locationUpdateAccept->match(other_value.locationUpdateAccept(), legacy);
case PDU__ML3__MM::ALT_locationUpdateReject:
return single_value.field_locationUpdateReject->match(other_value.locationUpdateReject(), legacy);
case PDU__ML3__MM::ALT_locationUpdateRequest:
return single_value.field_locationUpdateRequest->match(other_value.locationUpdateRequest(), legacy);
case PDU__ML3__MM::ALT_authenticationReject:
return single_value.field_authenticationReject->match(other_value.authenticationReject(), legacy);
case PDU__ML3__MM::ALT_authenticationRequest:
return single_value.field_authenticationRequest->match(other_value.authenticationRequest(), legacy);
case PDU__ML3__MM::ALT_authenticationResponse:
return single_value.field_authenticationResponse->match(other_value.authenticationResponse(), legacy);
case PDU__ML3__MM::ALT_authenticationFailure:
return single_value.field_authenticationFailure->match(other_value.authenticationFailure(), legacy);
case PDU__ML3__MM::ALT_identityRequest:
return single_value.field_identityRequest->match(other_value.identityRequest(), legacy);
case PDU__ML3__MM::ALT_identityResponse:
return single_value.field_identityResponse->match(other_value.identityResponse(), legacy);
case PDU__ML3__MM::ALT_tmsiReallocCommand:
return single_value.field_tmsiReallocCommand->match(other_value.tmsiReallocCommand(), legacy);
case PDU__ML3__MM::ALT_tmsiReallocComplete:
return single_value.field_tmsiReallocComplete->match(other_value.tmsiReallocComplete(), legacy);
case PDU__ML3__MM::ALT_cMServiceAbort:
return single_value.field_cMServiceAbort->match(other_value.cMServiceAbort(), legacy);
case PDU__ML3__MM::ALT_cMServiceAccept:
return single_value.field_cMServiceAccept->match(other_value.cMServiceAccept(), legacy);
case PDU__ML3__MM::ALT_cMServiceReject:
return single_value.field_cMServiceReject->match(other_value.cMServiceReject(), legacy);
case PDU__ML3__MM::ALT_cMServiceRequest:
return single_value.field_cMServiceRequest->match(other_value.cMServiceRequest(), legacy);
case PDU__ML3__MM::ALT_cMServicePrompt:
return single_value.field_cMServicePrompt->match(other_value.cMServicePrompt(), legacy);
case PDU__ML3__MM::ALT_cMReEstablReq:
return single_value.field_cMReEstablReq->match(other_value.cMReEstablReq(), legacy);
case PDU__ML3__MM::ALT_abort:
return single_value.field_abort->match(other_value.abort(), legacy);
case PDU__ML3__MM::ALT_mMNull:
return single_value.field_mMNull->match(other_value.mMNull(), legacy);
case PDU__ML3__MM::ALT_mMStatus:
return single_value.field_mMStatus->match(other_value.mMStatus(), legacy);
case PDU__ML3__MM::ALT_mMInformation:
return single_value.field_mMInformation->match(other_value.mMInformation(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}
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 template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
return FALSE;
}

boolean PDU__ML3__MM_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
return single_value.field_imsiDetachIndication->is_value();
case PDU__ML3__MM::ALT_locationUpdateAccept:
return single_value.field_locationUpdateAccept->is_value();
case PDU__ML3__MM::ALT_locationUpdateReject:
return single_value.field_locationUpdateReject->is_value();
case PDU__ML3__MM::ALT_locationUpdateRequest:
return single_value.field_locationUpdateRequest->is_value();
case PDU__ML3__MM::ALT_authenticationReject:
return single_value.field_authenticationReject->is_value();
case PDU__ML3__MM::ALT_authenticationRequest:
return single_value.field_authenticationRequest->is_value();
case PDU__ML3__MM::ALT_authenticationResponse:
return single_value.field_authenticationResponse->is_value();
case PDU__ML3__MM::ALT_authenticationFailure:
return single_value.field_authenticationFailure->is_value();
case PDU__ML3__MM::ALT_identityRequest:
return single_value.field_identityRequest->is_value();
case PDU__ML3__MM::ALT_identityResponse:
return single_value.field_identityResponse->is_value();
case PDU__ML3__MM::ALT_tmsiReallocCommand:
return single_value.field_tmsiReallocCommand->is_value();
case PDU__ML3__MM::ALT_tmsiReallocComplete:
return single_value.field_tmsiReallocComplete->is_value();
case PDU__ML3__MM::ALT_cMServiceAbort:
return single_value.field_cMServiceAbort->is_value();
case PDU__ML3__MM::ALT_cMServiceAccept:
return single_value.field_cMServiceAccept->is_value();
case PDU__ML3__MM::ALT_cMServiceReject:
return single_value.field_cMServiceReject->is_value();
case PDU__ML3__MM::ALT_cMServiceRequest:
return single_value.field_cMServiceRequest->is_value();
case PDU__ML3__MM::ALT_cMServicePrompt:
return single_value.field_cMServicePrompt->is_value();
case PDU__ML3__MM::ALT_cMReEstablReq:
return single_value.field_cMReEstablReq->is_value();
case PDU__ML3__MM::ALT_abort:
return single_value.field_abort->is_value();
case PDU__ML3__MM::ALT_mMNull:
return single_value.field_mMNull->is_value();
case PDU__ML3__MM::ALT_mMStatus:
return single_value.field_mMStatus->is_value();
case PDU__ML3__MM::ALT_mMInformation:
return single_value.field_mMInformation->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}

PDU__ML3__MM PDU__ML3__MM_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
PDU__ML3__MM ret_val;
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
ret_val.imsiDetachIndication() = single_value.field_imsiDetachIndication->valueof();
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
ret_val.locationUpdateAccept() = single_value.field_locationUpdateAccept->valueof();
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
ret_val.locationUpdateReject() = single_value.field_locationUpdateReject->valueof();
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
ret_val.locationUpdateRequest() = single_value.field_locationUpdateRequest->valueof();
break;
case PDU__ML3__MM::ALT_authenticationReject:
ret_val.authenticationReject() = single_value.field_authenticationReject->valueof();
break;
case PDU__ML3__MM::ALT_authenticationRequest:
ret_val.authenticationRequest() = single_value.field_authenticationRequest->valueof();
break;
case PDU__ML3__MM::ALT_authenticationResponse:
ret_val.authenticationResponse() = single_value.field_authenticationResponse->valueof();
break;
case PDU__ML3__MM::ALT_authenticationFailure:
ret_val.authenticationFailure() = single_value.field_authenticationFailure->valueof();
break;
case PDU__ML3__MM::ALT_identityRequest:
ret_val.identityRequest() = single_value.field_identityRequest->valueof();
break;
case PDU__ML3__MM::ALT_identityResponse:
ret_val.identityResponse() = single_value.field_identityResponse->valueof();
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
ret_val.tmsiReallocCommand() = single_value.field_tmsiReallocCommand->valueof();
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
ret_val.tmsiReallocComplete() = single_value.field_tmsiReallocComplete->valueof();
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
ret_val.cMServiceAbort() = single_value.field_cMServiceAbort->valueof();
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
ret_val.cMServiceAccept() = single_value.field_cMServiceAccept->valueof();
break;
case PDU__ML3__MM::ALT_cMServiceReject:
ret_val.cMServiceReject() = single_value.field_cMServiceReject->valueof();
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
ret_val.cMServiceRequest() = single_value.field_cMServiceRequest->valueof();
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
ret_val.cMServicePrompt() = single_value.field_cMServicePrompt->valueof();
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
ret_val.cMReEstablReq() = single_value.field_cMReEstablReq->valueof();
break;
case PDU__ML3__MM::ALT_abort:
ret_val.abort() = single_value.field_abort->valueof();
break;
case PDU__ML3__MM::ALT_mMNull:
ret_val.mMNull() = single_value.field_mMNull->valueof();
break;
case PDU__ML3__MM::ALT_mMStatus:
ret_val.mMStatus() = single_value.field_mMStatus->valueof();
break;
case PDU__ML3__MM::ALT_mMInformation:
ret_val.mMInformation() = single_value.field_mMInformation->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
return ret_val;
}

PDU__ML3__MM_template& PDU__ML3__MM_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return value_list.list_value[list_index];
}
void PDU__ML3__MM_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 ("Internal error: Setting an invalid list for a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__MM_template[list_length];
}

PDU__ML3__IMSI__DetachIndication_template& PDU__ML3__MM_template::imsiDetachIndication()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_imsiDetachIndication) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication_template(ANY_VALUE);
else single_value.field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication_template;
single_value.union_selection = PDU__ML3__MM::ALT_imsiDetachIndication;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_imsiDetachIndication;
}

const PDU__ML3__IMSI__DetachIndication_template& PDU__ML3__MM_template::imsiDetachIndication() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field imsiDetachIndication in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_imsiDetachIndication) TTCN_error("Accessing non-selected field imsiDetachIndication in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_imsiDetachIndication;
}

PDU__ML3__LocationUpdateAccept_template& PDU__ML3__MM_template::locationUpdateAccept()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateAccept) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept_template(ANY_VALUE);
else single_value.field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept_template;
single_value.union_selection = PDU__ML3__MM::ALT_locationUpdateAccept;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_locationUpdateAccept;
}

const PDU__ML3__LocationUpdateAccept_template& PDU__ML3__MM_template::locationUpdateAccept() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field locationUpdateAccept in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateAccept) TTCN_error("Accessing non-selected field locationUpdateAccept in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_locationUpdateAccept;
}

PDU__ML3__LocationUpdateReject_template& PDU__ML3__MM_template::locationUpdateReject()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateReject) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_locationUpdateReject = new PDU__ML3__LocationUpdateReject_template(ANY_VALUE);
else single_value.field_locationUpdateReject = new PDU__ML3__LocationUpdateReject_template;
single_value.union_selection = PDU__ML3__MM::ALT_locationUpdateReject;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_locationUpdateReject;
}

const PDU__ML3__LocationUpdateReject_template& PDU__ML3__MM_template::locationUpdateReject() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field locationUpdateReject in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateReject) TTCN_error("Accessing non-selected field locationUpdateReject in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_locationUpdateReject;
}

PDU__ML3__LocationUpdateRequest_template& PDU__ML3__MM_template::locationUpdateRequest()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateRequest) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest_template(ANY_VALUE);
else single_value.field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest_template;
single_value.union_selection = PDU__ML3__MM::ALT_locationUpdateRequest;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_locationUpdateRequest;
}

const PDU__ML3__LocationUpdateRequest_template& PDU__ML3__MM_template::locationUpdateRequest() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field locationUpdateRequest in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_locationUpdateRequest) TTCN_error("Accessing non-selected field locationUpdateRequest in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_locationUpdateRequest;
}

PDU__ML3__AuthenticationReject_template& PDU__ML3__MM_template::authenticationReject()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_authenticationReject) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_authenticationReject = new PDU__ML3__AuthenticationReject_template(ANY_VALUE);
else single_value.field_authenticationReject = new PDU__ML3__AuthenticationReject_template;
single_value.union_selection = PDU__ML3__MM::ALT_authenticationReject;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_authenticationReject;
}

const PDU__ML3__AuthenticationReject_template& PDU__ML3__MM_template::authenticationReject() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field authenticationReject in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_authenticationReject) TTCN_error("Accessing non-selected field authenticationReject in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_authenticationReject;
}

PDU__ML3__AuthenticationRequest_template& PDU__ML3__MM_template::authenticationRequest()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_authenticationRequest) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_authenticationRequest = new PDU__ML3__AuthenticationRequest_template(ANY_VALUE);
else single_value.field_authenticationRequest = new PDU__ML3__AuthenticationRequest_template;
single_value.union_selection = PDU__ML3__MM::ALT_authenticationRequest;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_authenticationRequest;
}

const PDU__ML3__AuthenticationRequest_template& PDU__ML3__MM_template::authenticationRequest() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field authenticationRequest in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_authenticationRequest) TTCN_error("Accessing non-selected field authenticationRequest in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_authenticationRequest;
}

PDU__ML3__AuthenticationResponse_template& PDU__ML3__MM_template::authenticationResponse()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_authenticationResponse) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_authenticationResponse = new PDU__ML3__AuthenticationResponse_template(ANY_VALUE);
else single_value.field_authenticationResponse = new PDU__ML3__AuthenticationResponse_template;
single_value.union_selection = PDU__ML3__MM::ALT_authenticationResponse;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_authenticationResponse;
}

const PDU__ML3__AuthenticationResponse_template& PDU__ML3__MM_template::authenticationResponse() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field authenticationResponse in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_authenticationResponse) TTCN_error("Accessing non-selected field authenticationResponse in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_authenticationResponse;
}

PDU__ML3__AuthenticationFailure_template& PDU__ML3__MM_template::authenticationFailure()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_authenticationFailure) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_authenticationFailure = new PDU__ML3__AuthenticationFailure_template(ANY_VALUE);
else single_value.field_authenticationFailure = new PDU__ML3__AuthenticationFailure_template;
single_value.union_selection = PDU__ML3__MM::ALT_authenticationFailure;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_authenticationFailure;
}

const PDU__ML3__AuthenticationFailure_template& PDU__ML3__MM_template::authenticationFailure() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field authenticationFailure in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_authenticationFailure) TTCN_error("Accessing non-selected field authenticationFailure in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_authenticationFailure;
}

PDU__ML3__IdentityRequest_template& PDU__ML3__MM_template::identityRequest()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_identityRequest) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_identityRequest = new PDU__ML3__IdentityRequest_template(ANY_VALUE);
else single_value.field_identityRequest = new PDU__ML3__IdentityRequest_template;
single_value.union_selection = PDU__ML3__MM::ALT_identityRequest;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_identityRequest;
}

const PDU__ML3__IdentityRequest_template& PDU__ML3__MM_template::identityRequest() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field identityRequest in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_identityRequest) TTCN_error("Accessing non-selected field identityRequest in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_identityRequest;
}

PDU__ML3__IdentityResponse_template& PDU__ML3__MM_template::identityResponse()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_identityResponse) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_identityResponse = new PDU__ML3__IdentityResponse_template(ANY_VALUE);
else single_value.field_identityResponse = new PDU__ML3__IdentityResponse_template;
single_value.union_selection = PDU__ML3__MM::ALT_identityResponse;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_identityResponse;
}

const PDU__ML3__IdentityResponse_template& PDU__ML3__MM_template::identityResponse() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field identityResponse in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_identityResponse) TTCN_error("Accessing non-selected field identityResponse in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_identityResponse;
}

PDU__ML3__TMSI__ReallocationCommand_template& PDU__ML3__MM_template::tmsiReallocCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_tmsiReallocCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand_template(ANY_VALUE);
else single_value.field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand_template;
single_value.union_selection = PDU__ML3__MM::ALT_tmsiReallocCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tmsiReallocCommand;
}

const PDU__ML3__TMSI__ReallocationCommand_template& PDU__ML3__MM_template::tmsiReallocCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tmsiReallocCommand in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_tmsiReallocCommand) TTCN_error("Accessing non-selected field tmsiReallocCommand in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_tmsiReallocCommand;
}

PDU__ML3__TMSI__ReallocationComplete_template& PDU__ML3__MM_template::tmsiReallocComplete()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_tmsiReallocComplete) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete_template(ANY_VALUE);
else single_value.field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete_template;
single_value.union_selection = PDU__ML3__MM::ALT_tmsiReallocComplete;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_tmsiReallocComplete;
}

const PDU__ML3__TMSI__ReallocationComplete_template& PDU__ML3__MM_template::tmsiReallocComplete() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tmsiReallocComplete in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_tmsiReallocComplete) TTCN_error("Accessing non-selected field tmsiReallocComplete in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_tmsiReallocComplete;
}

PDU__ML3__CMServiceAbort_template& PDU__ML3__MM_template::cMServiceAbort()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMServiceAbort) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMServiceAbort = new PDU__ML3__CMServiceAbort_template(ANY_VALUE);
else single_value.field_cMServiceAbort = new PDU__ML3__CMServiceAbort_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMServiceAbort;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMServiceAbort;
}

const PDU__ML3__CMServiceAbort_template& PDU__ML3__MM_template::cMServiceAbort() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMServiceAbort in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMServiceAbort) TTCN_error("Accessing non-selected field cMServiceAbort in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMServiceAbort;
}

PDU__ML3__CMServiceAccept_template& PDU__ML3__MM_template::cMServiceAccept()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMServiceAccept) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMServiceAccept = new PDU__ML3__CMServiceAccept_template(ANY_VALUE);
else single_value.field_cMServiceAccept = new PDU__ML3__CMServiceAccept_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMServiceAccept;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMServiceAccept;
}

const PDU__ML3__CMServiceAccept_template& PDU__ML3__MM_template::cMServiceAccept() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMServiceAccept in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMServiceAccept) TTCN_error("Accessing non-selected field cMServiceAccept in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMServiceAccept;
}

PDU__ML3__CMServiceReject_template& PDU__ML3__MM_template::cMServiceReject()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMServiceReject) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMServiceReject = new PDU__ML3__CMServiceReject_template(ANY_VALUE);
else single_value.field_cMServiceReject = new PDU__ML3__CMServiceReject_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMServiceReject;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMServiceReject;
}

const PDU__ML3__CMServiceReject_template& PDU__ML3__MM_template::cMServiceReject() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMServiceReject in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMServiceReject) TTCN_error("Accessing non-selected field cMServiceReject in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMServiceReject;
}

PDU__ML3__CMServiceRequest_template& PDU__ML3__MM_template::cMServiceRequest()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMServiceRequest) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMServiceRequest = new PDU__ML3__CMServiceRequest_template(ANY_VALUE);
else single_value.field_cMServiceRequest = new PDU__ML3__CMServiceRequest_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMServiceRequest;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMServiceRequest;
}

const PDU__ML3__CMServiceRequest_template& PDU__ML3__MM_template::cMServiceRequest() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMServiceRequest in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMServiceRequest) TTCN_error("Accessing non-selected field cMServiceRequest in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMServiceRequest;
}

PDU__ML3__CMServicePrompt_template& PDU__ML3__MM_template::cMServicePrompt()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMServicePrompt) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMServicePrompt = new PDU__ML3__CMServicePrompt_template(ANY_VALUE);
else single_value.field_cMServicePrompt = new PDU__ML3__CMServicePrompt_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMServicePrompt;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMServicePrompt;
}

const PDU__ML3__CMServicePrompt_template& PDU__ML3__MM_template::cMServicePrompt() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMServicePrompt in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMServicePrompt) TTCN_error("Accessing non-selected field cMServicePrompt in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMServicePrompt;
}

PDU__ML3__CMReestablishmentRequest_template& PDU__ML3__MM_template::cMReEstablReq()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_cMReEstablReq) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest_template(ANY_VALUE);
else single_value.field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest_template;
single_value.union_selection = PDU__ML3__MM::ALT_cMReEstablReq;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cMReEstablReq;
}

const PDU__ML3__CMReestablishmentRequest_template& PDU__ML3__MM_template::cMReEstablReq() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cMReEstablReq in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_cMReEstablReq) TTCN_error("Accessing non-selected field cMReEstablReq in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_cMReEstablReq;
}

PDU__ML3__Abort_template& PDU__ML3__MM_template::abort()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_abort) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_abort = new PDU__ML3__Abort_template(ANY_VALUE);
else single_value.field_abort = new PDU__ML3__Abort_template;
single_value.union_selection = PDU__ML3__MM::ALT_abort;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_abort;
}

const PDU__ML3__Abort_template& PDU__ML3__MM_template::abort() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field abort in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_abort) TTCN_error("Accessing non-selected field abort in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_abort;
}

PDU__ML3__MMNull_template& PDU__ML3__MM_template::mMNull()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_mMNull) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mMNull = new PDU__ML3__MMNull_template(ANY_VALUE);
else single_value.field_mMNull = new PDU__ML3__MMNull_template;
single_value.union_selection = PDU__ML3__MM::ALT_mMNull;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mMNull;
}

const PDU__ML3__MMNull_template& PDU__ML3__MM_template::mMNull() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mMNull in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_mMNull) TTCN_error("Accessing non-selected field mMNull in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_mMNull;
}

PDU__ML3__MMStatus_template& PDU__ML3__MM_template::mMStatus()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_mMStatus) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mMStatus = new PDU__ML3__MMStatus_template(ANY_VALUE);
else single_value.field_mMStatus = new PDU__ML3__MMStatus_template;
single_value.union_selection = PDU__ML3__MM::ALT_mMStatus;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mMStatus;
}

const PDU__ML3__MMStatus_template& PDU__ML3__MM_template::mMStatus() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mMStatus in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_mMStatus) TTCN_error("Accessing non-selected field mMStatus in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_mMStatus;
}

PDU__ML3__MMInformation_template& PDU__ML3__MM_template::mMInformation()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__ML3__MM::ALT_mMInformation) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mMInformation = new PDU__ML3__MMInformation_template(ANY_VALUE);
else single_value.field_mMInformation = new PDU__ML3__MMInformation_template;
single_value.union_selection = PDU__ML3__MM::ALT_mMInformation;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mMInformation;
}

const PDU__ML3__MMInformation_template& PDU__ML3__MM_template::mMInformation() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mMInformation in a non-specific template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
if (single_value.union_selection != PDU__ML3__MM::ALT_mMInformation) TTCN_error("Accessing non-selected field mMInformation in a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return *single_value.field_mMInformation;
}

boolean PDU__ML3__MM_template::ischosen(PDU__ML3__MM::union_selection_type checked_selection) const
{
if (checked_selection == PDU__ML3__MM::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_MM_Types.PDU_ML3_MM.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == PDU__ML3__MM::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_MM_Types.PDU_ML3_MM containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void PDU__ML3__MM_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
TTCN_Logger::log_event_str("{ imsiDetachIndication := ");
single_value.field_imsiDetachIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
TTCN_Logger::log_event_str("{ locationUpdateAccept := ");
single_value.field_locationUpdateAccept->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
TTCN_Logger::log_event_str("{ locationUpdateReject := ");
single_value.field_locationUpdateReject->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
TTCN_Logger::log_event_str("{ locationUpdateRequest := ");
single_value.field_locationUpdateRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_authenticationReject:
TTCN_Logger::log_event_str("{ authenticationReject := ");
single_value.field_authenticationReject->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_authenticationRequest:
TTCN_Logger::log_event_str("{ authenticationRequest := ");
single_value.field_authenticationRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_authenticationResponse:
TTCN_Logger::log_event_str("{ authenticationResponse := ");
single_value.field_authenticationResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_authenticationFailure:
TTCN_Logger::log_event_str("{ authenticationFailure := ");
single_value.field_authenticationFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_identityRequest:
TTCN_Logger::log_event_str("{ identityRequest := ");
single_value.field_identityRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_identityResponse:
TTCN_Logger::log_event_str("{ identityResponse := ");
single_value.field_identityResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
TTCN_Logger::log_event_str("{ tmsiReallocCommand := ");
single_value.field_tmsiReallocCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
TTCN_Logger::log_event_str("{ tmsiReallocComplete := ");
single_value.field_tmsiReallocComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
TTCN_Logger::log_event_str("{ cMServiceAbort := ");
single_value.field_cMServiceAbort->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
TTCN_Logger::log_event_str("{ cMServiceAccept := ");
single_value.field_cMServiceAccept->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMServiceReject:
TTCN_Logger::log_event_str("{ cMServiceReject := ");
single_value.field_cMServiceReject->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
TTCN_Logger::log_event_str("{ cMServiceRequest := ");
single_value.field_cMServiceRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
TTCN_Logger::log_event_str("{ cMServicePrompt := ");
single_value.field_cMServicePrompt->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
TTCN_Logger::log_event_str("{ cMReEstablReq := ");
single_value.field_cMReEstablReq->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_abort:
TTCN_Logger::log_event_str("{ abort := ");
single_value.field_abort->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_mMNull:
TTCN_Logger::log_event_str("{ mMNull := ");
single_value.field_mMNull->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_mMStatus:
TTCN_Logger::log_event_str("{ mMStatus := ");
single_value.field_mMStatus->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__ML3__MM::ALT_mMInformation:
TTCN_Logger::log_event_str("{ mMInformation := ");
single_value.field_mMInformation->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
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__ML3__MM_template::log_match(const PDU__ML3__MM& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".imsiDetachIndication");
single_value.field_imsiDetachIndication->log_match(match_value.imsiDetachIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ imsiDetachIndication := ");
single_value.field_imsiDetachIndication->log_match(match_value.imsiDetachIndication(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".locationUpdateAccept");
single_value.field_locationUpdateAccept->log_match(match_value.locationUpdateAccept(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ locationUpdateAccept := ");
single_value.field_locationUpdateAccept->log_match(match_value.locationUpdateAccept(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".locationUpdateReject");
single_value.field_locationUpdateReject->log_match(match_value.locationUpdateReject(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ locationUpdateReject := ");
single_value.field_locationUpdateReject->log_match(match_value.locationUpdateReject(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".locationUpdateRequest");
single_value.field_locationUpdateRequest->log_match(match_value.locationUpdateRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ locationUpdateRequest := ");
single_value.field_locationUpdateRequest->log_match(match_value.locationUpdateRequest(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_authenticationReject:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".authenticationReject");
single_value.field_authenticationReject->log_match(match_value.authenticationReject(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ authenticationReject := ");
single_value.field_authenticationReject->log_match(match_value.authenticationReject(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_authenticationRequest:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".authenticationRequest");
single_value.field_authenticationRequest->log_match(match_value.authenticationRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ authenticationRequest := ");
single_value.field_authenticationRequest->log_match(match_value.authenticationRequest(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_authenticationResponse:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".authenticationResponse");
single_value.field_authenticationResponse->log_match(match_value.authenticationResponse(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ authenticationResponse := ");
single_value.field_authenticationResponse->log_match(match_value.authenticationResponse(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_authenticationFailure:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".authenticationFailure");
single_value.field_authenticationFailure->log_match(match_value.authenticationFailure(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ authenticationFailure := ");
single_value.field_authenticationFailure->log_match(match_value.authenticationFailure(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_identityRequest:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".identityRequest");
single_value.field_identityRequest->log_match(match_value.identityRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ identityRequest := ");
single_value.field_identityRequest->log_match(match_value.identityRequest(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_identityResponse:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".identityResponse");
single_value.field_identityResponse->log_match(match_value.identityResponse(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ identityResponse := ");
single_value.field_identityResponse->log_match(match_value.identityResponse(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tmsiReallocCommand");
single_value.field_tmsiReallocCommand->log_match(match_value.tmsiReallocCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tmsiReallocCommand := ");
single_value.field_tmsiReallocCommand->log_match(match_value.tmsiReallocCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".tmsiReallocComplete");
single_value.field_tmsiReallocComplete->log_match(match_value.tmsiReallocComplete(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ tmsiReallocComplete := ");
single_value.field_tmsiReallocComplete->log_match(match_value.tmsiReallocComplete(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMServiceAbort");
single_value.field_cMServiceAbort->log_match(match_value.cMServiceAbort(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMServiceAbort := ");
single_value.field_cMServiceAbort->log_match(match_value.cMServiceAbort(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMServiceAccept");
single_value.field_cMServiceAccept->log_match(match_value.cMServiceAccept(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMServiceAccept := ");
single_value.field_cMServiceAccept->log_match(match_value.cMServiceAccept(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMServiceReject:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMServiceReject");
single_value.field_cMServiceReject->log_match(match_value.cMServiceReject(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMServiceReject := ");
single_value.field_cMServiceReject->log_match(match_value.cMServiceReject(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMServiceRequest");
single_value.field_cMServiceRequest->log_match(match_value.cMServiceRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMServiceRequest := ");
single_value.field_cMServiceRequest->log_match(match_value.cMServiceRequest(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMServicePrompt");
single_value.field_cMServicePrompt->log_match(match_value.cMServicePrompt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMServicePrompt := ");
single_value.field_cMServicePrompt->log_match(match_value.cMServicePrompt(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cMReEstablReq");
single_value.field_cMReEstablReq->log_match(match_value.cMReEstablReq(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cMReEstablReq := ");
single_value.field_cMReEstablReq->log_match(match_value.cMReEstablReq(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_abort:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".abort");
single_value.field_abort->log_match(match_value.abort(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ abort := ");
single_value.field_abort->log_match(match_value.abort(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_mMNull:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mMNull");
single_value.field_mMNull->log_match(match_value.mMNull(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mMNull := ");
single_value.field_mMNull->log_match(match_value.mMNull(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_mMStatus:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mMStatus");
single_value.field_mMStatus->log_match(match_value.mMStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mMStatus := ");
single_value.field_mMStatus->log_match(match_value.mMStatus(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__ML3__MM::ALT_mMInformation:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mMInformation");
single_value.field_mMInformation->log_match(match_value.mMInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mMInformation := ");
single_value.field_mMInformation->log_match(match_value.mMInformation(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
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__ML3__MM_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus->set_implicit_omit(); break;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation->set_implicit_omit(); break;
default: break;
}
}

void PDU__ML3__MM_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus->encode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
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 template of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}

void PDU__ML3__MM_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = PDU__ML3__MM::UNBOUND_VALUE;
PDU__ML3__MM::union_selection_type new_selection = (PDU__ML3__MM::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication = new PDU__ML3__IMSI__DetachIndication_template;
single_value.field_imsiDetachIndication->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept = new PDU__ML3__LocationUpdateAccept_template;
single_value.field_locationUpdateAccept->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject = new PDU__ML3__LocationUpdateReject_template;
single_value.field_locationUpdateReject->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest = new PDU__ML3__LocationUpdateRequest_template;
single_value.field_locationUpdateRequest->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject = new PDU__ML3__AuthenticationReject_template;
single_value.field_authenticationReject->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest = new PDU__ML3__AuthenticationRequest_template;
single_value.field_authenticationRequest->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse = new PDU__ML3__AuthenticationResponse_template;
single_value.field_authenticationResponse->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure = new PDU__ML3__AuthenticationFailure_template;
single_value.field_authenticationFailure->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest = new PDU__ML3__IdentityRequest_template;
single_value.field_identityRequest->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse = new PDU__ML3__IdentityResponse_template;
single_value.field_identityResponse->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand = new PDU__ML3__TMSI__ReallocationCommand_template;
single_value.field_tmsiReallocCommand->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete = new PDU__ML3__TMSI__ReallocationComplete_template;
single_value.field_tmsiReallocComplete->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort = new PDU__ML3__CMServiceAbort_template;
single_value.field_cMServiceAbort->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept = new PDU__ML3__CMServiceAccept_template;
single_value.field_cMServiceAccept->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject = new PDU__ML3__CMServiceReject_template;
single_value.field_cMServiceReject->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest = new PDU__ML3__CMServiceRequest_template;
single_value.field_cMServiceRequest->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt = new PDU__ML3__CMServicePrompt_template;
single_value.field_cMServicePrompt->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq = new PDU__ML3__CMReestablishmentRequest_template;
single_value.field_cMReEstablReq->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort = new PDU__ML3__Abort_template;
single_value.field_abort->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull = new PDU__ML3__MMNull_template;
single_value.field_mMNull->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus = new PDU__ML3__MMStatus_template;
single_value.field_mMStatus->decode_text(text_buf);
break;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation = new PDU__ML3__MMInformation_template;
single_value.field_mMInformation->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
single_value.union_selection = new_selection;
}
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__ML3__MM_template[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: Unrecognized selector was received in a template of type @MobileL3_MM_Types.PDU_ML3_MM.");
}
}

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

boolean PDU__ML3__MM_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 v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void PDU__ML3__MM_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_MM_Types.PDU_ML3_MM'");
    }
    if (strcmp("imsiDetachIndication", param_field) == 0) {
      imsiDetachIndication().set_param(param);
      return;
    } else if (strcmp("locationUpdateAccept", param_field) == 0) {
      locationUpdateAccept().set_param(param);
      return;
    } else if (strcmp("locationUpdateReject", param_field) == 0) {
      locationUpdateReject().set_param(param);
      return;
    } else if (strcmp("locationUpdateRequest", param_field) == 0) {
      locationUpdateRequest().set_param(param);
      return;
    } else if (strcmp("authenticationReject", param_field) == 0) {
      authenticationReject().set_param(param);
      return;
    } else if (strcmp("authenticationRequest", param_field) == 0) {
      authenticationRequest().set_param(param);
      return;
    } else if (strcmp("authenticationResponse", param_field) == 0) {
      authenticationResponse().set_param(param);
      return;
    } else if (strcmp("authenticationFailure", param_field) == 0) {
      authenticationFailure().set_param(param);
      return;
    } else if (strcmp("identityRequest", param_field) == 0) {
      identityRequest().set_param(param);
      return;
    } else if (strcmp("identityResponse", param_field) == 0) {
      identityResponse().set_param(param);
      return;
    } else if (strcmp("tmsiReallocCommand", param_field) == 0) {
      tmsiReallocCommand().set_param(param);
      return;
    } else if (strcmp("tmsiReallocComplete", param_field) == 0) {
      tmsiReallocComplete().set_param(param);
      return;
    } else if (strcmp("cMServiceAbort", param_field) == 0) {
      cMServiceAbort().set_param(param);
      return;
    } else if (strcmp("cMServiceAccept", param_field) == 0) {
      cMServiceAccept().set_param(param);
      return;
    } else if (strcmp("cMServiceReject", param_field) == 0) {
      cMServiceReject().set_param(param);
      return;
    } else if (strcmp("cMServiceRequest", param_field) == 0) {
      cMServiceRequest().set_param(param);
      return;
    } else if (strcmp("cMServicePrompt", param_field) == 0) {
      cMServicePrompt().set_param(param);
      return;
    } else if (strcmp("cMReEstablReq", param_field) == 0) {
      cMReEstablReq().set_param(param);
      return;
    } else if (strcmp("abort", param_field) == 0) {
      abort().set_param(param);
      return;
    } else if (strcmp("mMNull", param_field) == 0) {
      mMNull().set_param(param);
      return;
    } else if (strcmp("mMStatus", param_field) == 0) {
      mMStatus().set_param(param);
      return;
    } else if (strcmp("mMInformation", param_field) == 0) {
      mMInformation().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_MM_Types.PDU_ML3_MM'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__MM_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_MM_Types.PDU_ML3_MM");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "imsiDetachIndication")) {
      imsiDetachIndication().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "locationUpdateAccept")) {
      locationUpdateAccept().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "locationUpdateReject")) {
      locationUpdateReject().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "locationUpdateRequest")) {
      locationUpdateRequest().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "authenticationReject")) {
      authenticationReject().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "authenticationRequest")) {
      authenticationRequest().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "authenticationResponse")) {
      authenticationResponse().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "authenticationFailure")) {
      authenticationFailure().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "identityRequest")) {
      identityRequest().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "identityResponse")) {
      identityResponse().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tmsiReallocCommand")) {
      tmsiReallocCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "tmsiReallocComplete")) {
      tmsiReallocComplete().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMServiceAbort")) {
      cMServiceAbort().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMServiceAccept")) {
      cMServiceAccept().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMServiceReject")) {
      cMServiceReject().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMServiceRequest")) {
      cMServiceRequest().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMServicePrompt")) {
      cMServicePrompt().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cMReEstablReq")) {
      cMReEstablReq().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "abort")) {
      abort().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mMNull")) {
      mMNull().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mMStatus")) {
      mMStatus().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mMInformation")) {
      mMInformation().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_MM_Types.PDU_ML3_MM.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__MM_template* precondition = new PDU__ML3__MM_template;
    precondition->set_param(*m_p->get_elem(0));
    PDU__ML3__MM_template* implied_template = new PDU__ML3__MM_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PDU__ML3__MM_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_MM_Types.PDU_ML3_MM");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__MM_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;
switch (single_value.union_selection) {
case PDU__ML3__MM::ALT_imsiDetachIndication:
single_value.field_imsiDetachIndication->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_locationUpdateAccept:
single_value.field_locationUpdateAccept->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_locationUpdateReject:
single_value.field_locationUpdateReject->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_locationUpdateRequest:
single_value.field_locationUpdateRequest->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_authenticationReject:
single_value.field_authenticationReject->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_authenticationRequest:
single_value.field_authenticationRequest->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_authenticationResponse:
single_value.field_authenticationResponse->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_authenticationFailure:
single_value.field_authenticationFailure->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_identityRequest:
single_value.field_identityRequest->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_identityResponse:
single_value.field_identityResponse->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_tmsiReallocCommand:
single_value.field_tmsiReallocCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_tmsiReallocComplete:
single_value.field_tmsiReallocComplete->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMServiceAbort:
single_value.field_cMServiceAbort->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMServiceAccept:
single_value.field_cMServiceAccept->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMServiceReject:
single_value.field_cMServiceReject->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMServiceRequest:
single_value.field_cMServiceRequest->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMServicePrompt:
single_value.field_cMServicePrompt->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_cMReEstablReq:
single_value.field_cMReEstablReq->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_abort:
single_value.field_abort->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_mMNull:
single_value.field_mMNull->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_mMStatus:
single_value.field_mMStatus->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
case PDU__ML3__MM::ALT_mMInformation:
single_value.field_mMInformation->check_restriction(t_res, t_name ? t_name : "@MobileL3_MM_Types.PDU_ML3_MM");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_MM_Types.PDU_ML3_MM.");
}
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_MM_Types.PDU_ML3_MM");
}


/* Bodies of functions, altsteps and testcases */

void AuthenticationParameterRANDTV_encoder(const AuthenticationParameterRANDTV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationParameterRANDTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationParameterRANDTV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationParameterRANDTV_decoder(OCTETSTRING& input_stream, AuthenticationParameterRANDTV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationParameterRANDTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationParameterRANDTV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationParameterAUTNTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationParameterAUTNTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationParameterAUTNTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationParameterAUTNTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationParameterAUTNTLV_encoder(const AuthenticationParameterAUTNTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationParameterAUTNTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationParameterAUTNTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationParameterAUTNTLV_decoder(OCTETSTRING& input_stream, AuthenticationParameterAUTNTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationParameterAUTNTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationParameterAUTNTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationResponseParameterTV_valueField_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationResponseParameterTV_valueField_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationResponseParameterTV_valueField_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationResponseParameterTV_valueField_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationResponseParameterTV_encoder(const AuthenticationResponseParameterTV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationResponseParameterTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationResponseParameterTV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationResponseParameterTV_decoder(OCTETSTRING& input_stream, AuthenticationResponseParameterTV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationResponseParameterTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationResponseParameterTV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationResponseParameterUMTSTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationResponseParameterUMTSTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationResponseParameterUMTSTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationResponseParameterUMTSTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationResponseParameterUMTSTLV_valueField_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationResponseParameterUMTSTLV_valueField_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationResponseParameterUMTSTLV_encoder(const AuthenticationResponseParameterUMTSTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationResponseParameterUMTSTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationResponseParameterUMTSTLV_decoder(OCTETSTRING& input_stream, AuthenticationResponseParameterUMTSTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationResponseParameterUMTSTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationResponseParameterUMTSTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationFailureParametersTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationFailureParametersTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationFailureParametersTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationFailureParametersTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationFailureParametersTLV_valueField_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationFailureParametersTLV_valueField_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationFailureParametersTLV_valueField_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationFailureParametersTLV_valueField_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void AuthenticationFailureParametersTLV_encoder(const AuthenticationFailureParametersTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationFailureParametersTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(AuthenticationFailureParametersTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AuthenticationFailureParametersTLV_decoder(OCTETSTRING& input_stream, AuthenticationFailureParametersTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.AuthenticationFailureParametersTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(AuthenticationFailureParametersTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void LocationUpdatingType_encoder(const LocationUpdatingType& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LocationUpdatingType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(LocationUpdatingType_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER LocationUpdatingType_decoder(OCTETSTRING& input_stream, LocationUpdatingType& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LocationUpdatingType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(LocationUpdatingType_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NetworkNameTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NetworkNameTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NetworkNameTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NetworkNameTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NetworkNameV_textString_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NetworkNameV_textString_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NetworkNameV_encoder(const NetworkNameV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.NetworkNameV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NetworkNameV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NetworkNameV_decoder(OCTETSTRING& input_stream, NetworkNameV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.NetworkNameV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NetworkNameV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NetworkNameTLV_encoder(const NetworkNameTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.NetworkNameTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NetworkNameTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NetworkNameTLV_decoder(OCTETSTRING& input_stream, NetworkNameTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.NetworkNameTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NetworkNameTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TimeZoneV_encoder(const TimeZoneV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TimeZoneV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TimeZoneV_decoder(OCTETSTRING& input_stream, TimeZoneV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TimeZoneV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TimeZoneTV_encoder(const TimeZoneTV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TimeZoneTV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TimeZoneTV_decoder(OCTETSTRING& input_stream, TimeZoneTV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TimeZoneTV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TimeZoneAndTimeV_encoder(const TimeZoneAndTimeV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneAndTimeV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TimeZoneAndTimeV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TimeZoneAndTimeV_decoder(OCTETSTRING& input_stream, TimeZoneAndTimeV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneAndTimeV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TimeZoneAndTimeV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TimeZoneAndTimeTV_encoder(const TimeZoneAndTimeTV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneAndTimeTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TimeZoneAndTimeTV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TimeZoneAndTimeTV_decoder(OCTETSTRING& input_stream, TimeZoneAndTimeTV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.TimeZoneAndTimeTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TimeZoneAndTimeTV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void LSA__IdentifierTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(LSA__IdentifierTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER LSA__IdentifierTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(LSA__IdentifierTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void LSA__IdentifierV_lsa__id_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER LSA__IdentifierV_lsa__id_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void LSA__IdentifierV_encoder(const LSA__IdentifierV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LSA_IdentifierV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(LSA__IdentifierV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER LSA__IdentifierV_decoder(OCTETSTRING& input_stream, LSA__IdentifierV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LSA_IdentifierV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(LSA__IdentifierV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void LSA__IdentifierTLV_encoder(const LSA__IdentifierTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LSA_IdentifierTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(LSA__IdentifierTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER LSA__IdentifierTLV_decoder(OCTETSTRING& input_stream, LSA__IdentifierTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.LSA_IdentifierTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(LSA__IdentifierTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void DaylightSavingTimeTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(DaylightSavingTimeTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER DaylightSavingTimeTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(DaylightSavingTimeTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void DaylightSavingTimeV_encoder(const DaylightSavingTimeV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.DaylightSavingTimeV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(DaylightSavingTimeV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER DaylightSavingTimeV_decoder(OCTETSTRING& input_stream, DaylightSavingTimeV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.DaylightSavingTimeV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(DaylightSavingTimeV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void DaylightSavingTimeTLV_encoder(const DaylightSavingTimeTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.DaylightSavingTimeTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(DaylightSavingTimeTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER DaylightSavingTimeTLV_decoder(OCTETSTRING& input_stream, DaylightSavingTimeTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.DaylightSavingTimeTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(DaylightSavingTimeTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyNumberListTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyNumberListTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumberListTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyNumberListTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

boolean operator==(null_type, const EmergencyNumberListV& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @MobileL3_MM_Types.EmergencyNumberListV.");
return other_value.val_ptr->n_elements == 0;
}

void EmergencyNumber_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyNumber_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumber_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyNumber_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyServiceCategory_encoder(const EmergencyServiceCategory& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyServiceCategory' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyServiceCategory_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyServiceCategory_decoder(OCTETSTRING& input_stream, EmergencyServiceCategory& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyServiceCategory' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyServiceCategory_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyNumber_emergencyNumber_encoder(const HEXSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumber_emergencyNumber_decoder(OCTETSTRING& input_stream, HEXSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `hexstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(HEXSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyNumber_encoder(const EmergencyNumber& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumber' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyNumber_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumber_decoder(OCTETSTRING& input_stream, EmergencyNumber& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumber' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyNumber_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyNumberListV_encoder(const EmergencyNumberListV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumberListV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyNumberListV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumberListV_decoder(OCTETSTRING& input_stream, EmergencyNumberListV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumberListV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyNumberListV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void EmergencyNumberListTLV_encoder(const EmergencyNumberListTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumberListTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(EmergencyNumberListTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER EmergencyNumberListTLV_decoder(OCTETSTRING& input_stream, EmergencyNumberListTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.EmergencyNumberListTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(EmergencyNumberListTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void MM__TimerTLV_lengthIndicator_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MM__TimerTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MM__TimerTLV_lengthIndicator_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MM__TimerTLV_lengthIndicator_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void MM__TimerV_encoder(const MM__TimerV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.MM_TimerV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MM__TimerV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MM__TimerV_decoder(OCTETSTRING& input_stream, MM__TimerV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.MM_TimerV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MM__TimerV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void MM__TimerTLV_encoder(const MM__TimerTLV& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.MM_TimerTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MM__TimerTLV_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MM__TimerTLV_decoder(OCTETSTRING& input_stream, MM__TimerTLV& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.MM_TimerTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MM__TimerTLV_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__AuthenticationReject_encoder(const PDU__ML3__AuthenticationReject& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__AuthenticationReject_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__AuthenticationReject_decoder(OCTETSTRING& input_stream, PDU__ML3__AuthenticationReject& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__AuthenticationReject_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__AuthenticationRequest_encoder(const PDU__ML3__AuthenticationRequest& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__AuthenticationRequest_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__AuthenticationRequest_decoder(OCTETSTRING& input_stream, PDU__ML3__AuthenticationRequest& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__AuthenticationRequest_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__AuthenticationResponse_encoder(const PDU__ML3__AuthenticationResponse& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__AuthenticationResponse_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__AuthenticationResponse_decoder(OCTETSTRING& input_stream, PDU__ML3__AuthenticationResponse& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationResponse' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__AuthenticationResponse_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__AuthenticationFailure_encoder(const PDU__ML3__AuthenticationFailure& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__AuthenticationFailure_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__AuthenticationFailure_decoder(OCTETSTRING& input_stream, PDU__ML3__AuthenticationFailure& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_AuthenticationFailure' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__AuthenticationFailure_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMReestablishmentRequest_encoder(const PDU__ML3__CMReestablishmentRequest& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMReestablishmentRequest_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMReestablishmentRequest_decoder(OCTETSTRING& input_stream, PDU__ML3__CMReestablishmentRequest& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMReestablishmentRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMReestablishmentRequest_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMServiceAccept_encoder(const PDU__ML3__CMServiceAccept& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceAccept' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMServiceAccept_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMServiceAccept_decoder(OCTETSTRING& input_stream, PDU__ML3__CMServiceAccept& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceAccept' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMServiceAccept_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMServicePrompt_encoder(const PDU__ML3__CMServicePrompt& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServicePrompt' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMServicePrompt_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMServicePrompt_decoder(OCTETSTRING& input_stream, PDU__ML3__CMServicePrompt& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServicePrompt' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMServicePrompt_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMServiceReject_encoder(const PDU__ML3__CMServiceReject& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMServiceReject_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMServiceReject_decoder(OCTETSTRING& input_stream, PDU__ML3__CMServiceReject& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMServiceReject_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMServiceAbort_encoder(const PDU__ML3__CMServiceAbort& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceAbort' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMServiceAbort_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMServiceAbort_decoder(OCTETSTRING& input_stream, PDU__ML3__CMServiceAbort& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceAbort' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMServiceAbort_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__Abort_encoder(const PDU__ML3__Abort& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_Abort' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__Abort_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__Abort_decoder(OCTETSTRING& input_stream, PDU__ML3__Abort& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_Abort' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__Abort_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__CMServiceRequest_encoder(const PDU__ML3__CMServiceRequest& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__CMServiceRequest_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__CMServiceRequest_decoder(OCTETSTRING& input_stream, PDU__ML3__CMServiceRequest& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_CMServiceRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__CMServiceRequest_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__IdentityRequest_encoder(const PDU__ML3__IdentityRequest& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IdentityRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__IdentityRequest_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__IdentityRequest_decoder(OCTETSTRING& input_stream, PDU__ML3__IdentityRequest& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IdentityRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__IdentityRequest_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__IdentityResponse_encoder(const PDU__ML3__IdentityResponse& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IdentityResponse' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__IdentityResponse_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__IdentityResponse_decoder(OCTETSTRING& input_stream, PDU__ML3__IdentityResponse& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IdentityResponse' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__IdentityResponse_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__IMSI__DetachIndication_encoder(const PDU__ML3__IMSI__DetachIndication& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__IMSI__DetachIndication_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__IMSI__DetachIndication_decoder(OCTETSTRING& input_stream, PDU__ML3__IMSI__DetachIndication& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_IMSI_DetachIndication' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__IMSI__DetachIndication_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__LocationUpdateAccept_encoder(const PDU__ML3__LocationUpdateAccept& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__LocationUpdateAccept_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__LocationUpdateAccept_decoder(OCTETSTRING& input_stream, PDU__ML3__LocationUpdateAccept& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateAccept' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__LocationUpdateAccept_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__LocationUpdateReject_encoder(const PDU__ML3__LocationUpdateReject& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__LocationUpdateReject_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__LocationUpdateReject_decoder(OCTETSTRING& input_stream, PDU__ML3__LocationUpdateReject& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateReject' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__LocationUpdateReject_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__LocationUpdateRequest_encoder(const PDU__ML3__LocationUpdateRequest& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__LocationUpdateRequest_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__LocationUpdateRequest_decoder(OCTETSTRING& input_stream, PDU__ML3__LocationUpdateRequest& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_LocationUpdateRequest' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__LocationUpdateRequest_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MMInformation_encoder(const PDU__ML3__MMInformation& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MMInformation_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MMInformation_decoder(OCTETSTRING& input_stream, PDU__ML3__MMInformation& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MMInformation_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MMStatus_encoder(const PDU__ML3__MMStatus& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MMStatus_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MMStatus_decoder(OCTETSTRING& input_stream, PDU__ML3__MMStatus& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MMStatus_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__TMSI__ReallocationCommand_encoder(const PDU__ML3__TMSI__ReallocationCommand& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__TMSI__ReallocationCommand_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__TMSI__ReallocationCommand_decoder(OCTETSTRING& input_stream, PDU__ML3__TMSI__ReallocationCommand& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationCommand' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__TMSI__ReallocationCommand_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__TMSI__ReallocationComplete_encoder(const PDU__ML3__TMSI__ReallocationComplete& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__TMSI__ReallocationComplete_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__TMSI__ReallocationComplete_decoder(OCTETSTRING& input_stream, PDU__ML3__TMSI__ReallocationComplete& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_TMSI_ReallocationComplete' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__TMSI__ReallocationComplete_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MMNull_encoder(const PDU__ML3__MMNull& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMNull' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MMNull_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MMNull_decoder(OCTETSTRING& input_stream, PDU__ML3__MMNull& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MMNull' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MMNull_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MM_encoder(const PDU__ML3__MM& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MM' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MM_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MM_decoder(OCTETSTRING& input_stream, PDU__ML3__MM& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_MM_Types.PDU_ML3_MM' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MM_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("MobileL3_MM_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_MM_Types");
MobileL3__CommonIE__Types::module_object.pre_init_module();
}

void post_init_module()
{
TTCN_Location current_location("MobileL3_MM_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_MM_Types");
MobileL3__CommonIE__Types::module_object.post_init_module();
}


} /* end of namespace */
